fix(admin): admit iceberg fields in warehouse PUT strict-decode#557
Merged
Conversation
PR #554 added the Iceberg fields to ManagedWarehouse (configstore) and to the upsert column allowlist, but missed the strict-decode struct managedWarehouseRequest that gates which top-level keys a PUT body may carry. The doc comment on that struct literally warns: "If you add a field here without a matching tag on ManagedWarehouse, strict decode will accept it and the merge will silently drop it." Without this fix, `PUT /orgs/<id>/warehouse` with `{"iceberg":{...}}` returns 400 "unknown field iceberg" — making it impossible to enable Iceberg via admin API on existing warehouses (the whole reason the drift correction in #555 exists). Adds the matching test mirroring TestPutWarehouseDisablesPgBouncerWhenSetToFalse. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
Closes a missing piece in #554. PR #554 added the Iceberg fields to
ManagedWarehouseand to the upsert column allowlist, but missedmanagedWarehouseRequest— the strict-decode struct that gates which top-level keys a PUT body may carry. Without this,PUT /orgs/<id>/warehouse -d '{"iceberg":{"enabled":true}}'returns:— defeating the entire admin-API path that the drift correction in #555 was built around.
The doc comment on
managedWarehouseRequestexplicitly warns about this trap. Caught while attempting to enable iceberg for the posthog org on prod-us.Test plan
TestPutWarehouseEnablesIcebergWhenSetToTruemirrors the pgbouncer pattern (TestPutWarehouseDisablesPgBouncerWhenSetToFalse).go build -tags kubernetes ./...clean.go test -tags kubernetes ./controlplane/admin/...green.PUT /api/v1/orgs/<posthog>/warehouse -d '{"iceberg":{"enabled":true}}', expect 200 +iceberg.enabled=truein GET.🤖 Generated with Claude Code