fix(data-connections): target GCS, align DataProvider with storage_type - #453
fix(data-connections): target GCS, align DataProvider with storage_type#453alukach wants to merge 3 commits into
Conversation
The GCP data connection persisted `provider: "gcp"`, but the backend
addresses Google Cloud Storage as "gcs" — the same latent mismatch existed
for Azure ("az" vs "azure"). Root cause: `DataProvider` and a mirror's
`storage_type` were two vocabularies bridged by a hand-written
`STORAGE_TYPE_BY_PROVIDER` map duplicated in products.ts and
product-mirrors.ts.
Detangle: align `DataProvider`'s values to the backend storage vocabulary
(`Azure="azure"`, `GCS="gcs"`), so a mirror's `storage_type` is just the
connection's provider. Both translation maps deleted; `storage_type =
details.provider` directly.
- Rename member GCP→GCS and schema/type Gcp*→Gcs* (auth type stays
`gcp_workload_identity` — WIF is a GCP-platform feature, not storage).
- Read-shim in the data-connections DynamoDB client normalizes legacy rows
on read ("az"→"azure", "gcp"→"gcs"); mirrors already store the correct
storage_type via the old map, so only connection rows need it.
- Tests for the shim and for the DataProvider ⊆ storage_type invariant that
now backs the cast.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Claude finished @alukach's task in 3m 8s —— View job Review complete
❌ Changes requested — see findings below.
Everything else in the migration checks out:
|
…igning) (#191) ## What Enables the Google Cloud Storage backend in the data proxy so source.coop data connections with `provider: "gcs"` resolve to a real storage client instead of erroring. ## Changes (Cargo.toml / Cargo.lock only) 1. **`gcp` feature** on `multistore` and `multistore-cf-workers` → `BackendType::Gcs` builds a `GoogleCloudStorageBuilder` instead of returning `ConfigError("GCS backend support not enabled")`. 2. **`ring` `wasm32_unknown_unknown_js` feature** (via a direct wasm-target entry): `object_store`'s GCS credential module signs JWTs with `ring::rand::SystemRandom`, whose `SecureRandom` impl on `wasm32-unknown-unknown` is gated behind that ring feature (enables getrandom 0.2's js backend). Without it the Workers build fails to compile: ``` error[E0277]: the trait bound `SystemRandom: SecureRandom` is not satisfied --> object_store-0.13.2/src/gcp/credential.rs ``` ring is transitive (via `object_store`); this only turns the feature on for the wasm target. ## Runtime note source.coop uses **keyless Workload Identity Federation** for GCS, so the RSA private-key signing path isn't exercised at runtime — but the code must compile, which this enables. (getrandom's js backend maps to Web Crypto, which the Workers runtime provides, so it's also safe if ever hit.) ## Pairs with source-cooperative/source.coop#453 — aligns the persisted provider value to `"gcs"` (the string this backend accepts). ## Verification `cargo check` + `cargo clippy -D warnings` + `cargo fmt --check` for **wasm32-unknown-unknown**, and the full `cargo test` suite — all pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Problem
Creating a GCP data connection persisted
details.provider: "gcp", but the backend (data.source.coop) addresses Google Cloud Storage as"gcs". The same latent mismatch existed for Azure ("az"vs"azure").Root cause:
DataProviderand a mirror's storage type were two vocabularies bridged by a hand-writtenSTORAGE_TYPE_BY_PROVIDERmap duplicated inproducts.tsandproduct-mirrors.ts.Change — align
DataProvidervalues to the backend vocabularyGCP→GCS, schema/typeGcp*→Gcs*. Auth type staysgcp_workload_identity(WIF is a GCP-platform feature, not storage). Form label → "Google Cloud Storage".Migration (legacy
az/gcprows)DynamoDB reads bypass Zod, so
normalizeConnectionin the data-connections client remaps"az"→"azure"/"gcp"→"gcs"onfetchById/listAll. Markedponytail:— drop after backfill.Backend compatibility (verified against data.source.coop)
"az"and"azure"→ compatible during rollout. GCS: old"gcp"never worked (hit the error arm);"gcs"is accepted. This is the fix, not a regression.gcpfeature + a wasm-compatible signing path) — tracked in data.source.coop.Verification
tscclean ·jestaffected suites pass · lint clean on changed files.🤖 Generated with Claude Code