duckling: stop deriving the CR name — stored duckling_name is authoritative#891
Merged
Conversation
…tative The Duckling CR name was derived from the org ID at every use site (lowercase transform + a hyphen-stripped legacy fallback on NotFound), with the stored duckling_name only consulted sometimes. Now the config store column (NOT NULL since 000012) is the single source of truth: - DucklingClient methods take the explicit CR name and use it verbatim; ducklingName()/legacyDucklingName() and the legacy getCR fallback are deleted. Create names the CR exactly what it is given. - The provisioner controller, both resolveDucklingStatus closures (worker activation + query-log writer), and the drift scanner pass the warehouse row's duckling_name (org-ID fallback only for zero-value fixtures; the column is NOT NULL in the DB). - Warehouse create stamps duckling_name = org_id verbatim (org IDs are validated lowercase DNS-1123 labels; no ToLower). Public provisioning API unchanged. - Admin UI drops the client-side ducklingName() derive helper and the hyphen-stripped matching in ducklingEntryFor; views render the stored field only. Verified beforehand that every prod warehouse's duckling_name exactly matches its live CR, so removing the legacy fallback strands nothing.
Test Impact PlanDeterministic summary of how this PR changes tests, CI runners, and coverage-risk signals. Summary
Signals
Coverage risk: neutral or increased No coverage-reduction warnings detected. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Removes all duckling-name derivation/resolution logic. The config-store
duckling_namecolumn (NOT NULL since migration000012, editable + audited via the admin UI) is now the single source of truth for a warehouse's Duckling CR name.Backend
DucklingClienttakes the explicit CR name in every method (Create/Get/Delete/CRStatus/pgbouncer/bucket accessors) and uses it verbatim.ducklingName(),legacyDucklingName(), and the hyphen-stripped legacy fallback ingetCRare deleted — the CP never re-derives or guesses a name again.ducklingCRName(w)helper), bothresolveDucklingStatusclosures (worker activation + query-log writer — these keep their(ctx, orgID)signature and resolve the name from the warehouse row internally, via a newConfigStore.GetManagedWarehouse), and the drift scanner (orphan set no longer includes legacy hyphen-stripped variants).duckling_name = org_idverbatim (org IDs are validated lowercase DNS-1123 labels at the provision endpoint, so no transform). Public provisioning API shape unchanged; the Duckling CR is created under exactly the stored name.Frontend
ducklingName()derive helper;ducklingEntryFormatches exactly (stored name / org), no canonical+stripped variant list. All views render the stored field only.Safety
duckling_namewas verified byte-identical to its live Duckling CR (and no orphan CRs), so removing the legacy fallback strands nothing. New tests:Createuses the given name verbatim; reconcile creates/deletes under a stored name that differs from the org ID.Build / test
go build -tags kubernetes ./...,go vet,gofmt— clean.go test— controlplane + provisioner + provisioning ok; admin skips are the pre-existing Postgres-container tests (run in CI).npm run build+ lint + vitest — clean.🤖 Generated with Claude Code