fix(data-connections): align provider values to the backend vocabulary - #455
Conversation
Creating a GCP data connection persisted `details.provider: "gcp"`, but the
data proxy reads `details.provider` directly and only accepts "gcs"/"gs"
for Google (never "gcp"); the same latent mismatch existed for Azure ("az"
vs the accepted "azure"). The provider→storage_type map already emitted the
right values, so mirrors were fine — only the stored provider string was
wrong.
Rename the DataProvider values to what the backend accepts: Azure "az"→
"azure", GCP→GCS "gcp"→"gcs". Member GCP→GCS, schema/type Gcp*→Gcs*. Auth
type stays `gcp_workload_identity` (WIF is a GCP-platform feature, not
storage). Provider labels spelled out in the form.
Legacy rows: reads bypass Zod, so `normalizeConnection` in the
data-connections DynamoDB client remaps "az"→"azure" / "gcp"→"gcs" on
fetchById/listAll. Marked ponytail; drop after backfill.
The now-redundant provider→storage_type translation is left in place here
and removed in the follow-up that drops ProductMirror.storage_type.
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 1m 51s —— View job Reviewing PR #455
✅ No blocking issues — safe to merge. The rename is applied consistently: enum member ( One thing worth double-checking operationally rather than a code bug:
Everything else — the migration script's dry-run default, |
The azure-data-connection fixture still carried the pre-rename provider value; AzureDataConnectionSchema now requires "azure", and utils.mock.ts eagerly parses this fixture at module load, so every test importing it (and local dev seeding via init-local.ts) threw. Caught in CI review. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Fixed in de9b172 — The remaining |
Replace the runtime normalizeConnection read-shim (LEGACY_PROVIDER_ALIASES) with a one-time migration script that converts persisted provider values "az"->"azure" / "gcp"->"gcs". Keeps the DB read path free of legacy-value handling; the conversion is done once at deploy instead of on every read. - Remove normalizeConnection + its test; fetchById/listAll return rows as-is. - Add scripts/migrate-provider-values.ts, matching the existing migration convention (positional table arg, DynamoDB scan + guarded UpdateCommand, progress logging). Dry-run by default; --apply to write. Re-runnable (canonical rows are skipped). Run the migration (dry-run, then --apply) before deploying the value rename. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Replaced the runtime |
🤖 I have created a release *beep* *boop* --- ## [1.4.3](v1.4.2...v1.4.3) (2026-07-27) ### Bug Fixes * **data-connections:** align provider values to the backend vocabulary ([#455](#455)) ([06adc4c](06adc4c)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: source-release-bot[bot] <265100246+source-release-bot[bot]@users.noreply.github.com>
Problem
Creating a GCP data connection persisted
details.provider: "gcp", but the data proxy (data.source.coop) readsdetails.providerdirectly and only accepts"gcs"/"gs"for Google — never"gcp". The same latent mismatch existed for Azure ("az"vs the accepted"azure"). Theprovider→storage_typemap already emitted the right values, so mirrors were fine — only the stored provider string was wrong.Change — rename
DataProvidervalues to what the backend acceptsGCP→GCS, schema/typeGcp*→Gcs*. Auth type staysgcp_workload_identity(WIF is a GCP-platform feature, not storage). Provider labels spelled out in the form.provider→storage_typetranslation is left in place here and removed in the stacked follow-up (refactor(mirrors): drop denormalized ProductMirror.storage_type #456).Migration (legacy
az/gcprows)A one-time script —
scripts/migrate-provider-values.ts— converts persisteddetails.providervalues ("az"→"azure","gcp"→"gcs"), matching the repo's existing migration convention (positional table arg, DynamoDB scan + guardedUpdateCommand, progress logging). Dry-run by default;--applyto write. Re-runnable (canonical rows are skipped). Run it (dry-run, then--apply) at/before deploy:(Earlier revisions used a runtime read-shim; replaced with this script so the DB read path carries no legacy-value handling.)
Backend compatibility (verified against data.source.coop)
S3 unchanged. Azure accepts both
"az"and"azure"→ compatible during rollout. GCS: old"gcp"never worked (hit the error arm);"gcs"is accepted. Pairs with data.source.coop#191 (enables the GCS backend).Verification
tscclean ·jestaffected suites green · lint clean · fixtureproviderfixed (az→azure) so module-load parsing passes.🤖 Generated with Claude Code