Repository navigation
Call GCP Monitoring, Cloud Asset, IAM and Search Console through the distilled SDK - #2861
Conversation
|
Caution Review failedThe pull request is closed.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Devin Review found 1 potential issue.
1 flag not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)
91a3349 to
47810fd
Compare
a175e20 to
2880c2a
Compare
This comment has been minimized.
This comment has been minimized.
47810fd to
264743b
Compare
…hrough the distilled SDK Cloud Monitoring time series, Cloud Asset search and assets, IAM generateAccessToken and the Search Console sites and Search Analytics calls go through @distilled.cloud/gcp via vendor-sdk. The OAuth token exchange and BigQuery stay on plain HTTP: the SDK drops BigQuery's error.errors[].reason, which tells a quota or billing 403 from a missing role. vendor-sdk takes per-client retry settings, retryInvalidResponse and a detail hook, and drops a message that is only the bare status. Marks @distilled.cloud/gcp pure for the Worker build.
2880c2a to
6da601f
Compare
Maple review🟢 Confidence 10/10 · safe to merge. Every SDK-backed call is pinned by fetch-stub tests asserting exact URL, Moves the GCP connector's Monitoring, Cloud Asset and IAM calls plus the Search Console client onto
Still open from earlier reviews
|
Stacked on #2858. Moves the GCP connector's Google calls and the Search Console client onto
@distilled.cloud/gcpthroughvendor-sdk.What changed
integrations/gcp/api.ts: Cloud MonitoringtimeSeries.list(projects, folders or organizations by scope), Cloud AssetsearchAllResourcesandassets.list, and IAMgenerateAccessTokengo through the SDK. Exports,GcpApiErrorand its reasons are unchanged. The reader's token and quota project go in as the SDK'sCredentials(X-Goog-User-Projectas before).google-search-console/client.ts: sites and Search Analytics go through the SDK, pinned to the host Maple has used (www.googleapis.com) with the SDK'sEndpointoverride.vendor-sdk.ts(the tracing fix now lives in Call Vercel teams, projects, deployments and drains through the distilled SDK #2858):retry,retryInvalidResponseand adetailhook, so GCP keeps one retry, a re-read of an undecodable page and no wait on a 429.Behaviour to know about
status,messageanddetails, soSERVICE_DISABLED,BILLING_DISABLEDand the message-read reasons come out as before.error.errors[].reason, the only place BigQuery saysrateLimitExceeded,quotaExceededorbillingNotEnabledon a 403 that otherwise reads like a missing role. Its job calls also use a per-call timeout and arequestIdjoin.error.messagewas used.Bundle cost
@distilled.cloud/gcpis added to the Worker build's pure list, as alchemy's default does for every distilled package.Measured with esbuild (
--platform=neutral --conditions=worker,workerd --minify), importing only the five service modules used plusCredentials, against an effect-only baseline: +92 KB minified, +15 KB gzipped. The SDK'sworkercredentials entry importsnode:fs/promisesfor Application Default Credentials. It is never called here, and Maple Workers getnodejs_compatby default.Verification
vitestoverservices/integrations,services/cost,services/securityandservices/auth: 1,878 passed. The GCP leak tests and the Search Console message tests pass unchanged.New GCP regression test:
keeps the stored inventory when a resource search answers an empty 200. The SDK reads an empty ornullbody as{}; the adapter (Call Vercel teams, projects, deployments and drains through the distilled SDK #2858) now hands our schemanull, so the read fails and nothing stored is removed. The test fails without that fix.packages/backendtypecheck: no errors.oxlint -c .oxlintrc.effect.jsonandoxfmton every changed file: clean.No UI change, so no screenshots.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.