Skip to content

fix(admin): admit iceberg fields in warehouse PUT strict-decode#557

Merged
fuziontech merged 1 commit into
mainfrom
fix/admin-api-iceberg-decode
May 10, 2026
Merged

fix(admin): admit iceberg fields in warehouse PUT strict-decode#557
fuziontech merged 1 commit into
mainfrom
fix/admin-api-iceberg-decode

Conversation

@fuziontech
Copy link
Copy Markdown
Member

Summary

Closes a missing piece in #554. PR #554 added the Iceberg fields to ManagedWarehouse and to the upsert column allowlist, but missed managedWarehouseRequest — 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:

HTTP/1.1 400 Bad Request
{"error":"json: unknown field \"iceberg\""}

— defeating the entire admin-API path that the drift correction in #555 was built around.

The doc comment on managedWarehouseRequest explicitly warns about this trap. Caught while attempting to enable iceberg for the posthog org on prod-us.

Test plan

  • New TestPutWarehouseEnablesIcebergWhenSetToTrue mirrors the pgbouncer pattern (TestPutWarehouseDisablesPgBouncerWhenSetToFalse).
  • go build -tags kubernetes ./... clean.
  • go test -tags kubernetes ./controlplane/admin/... green.
  • Manual: redeploy duckgres to prod-us, retry PUT /api/v1/orgs/<posthog>/warehouse -d '{"iceberg":{"enabled":true}}', expect 200 + iceberg.enabled=true in GET.

🤖 Generated with Claude Code

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>
@fuziontech fuziontech merged commit dba3308 into main May 10, 2026
22 checks passed
@fuziontech fuziontech deleted the fix/admin-api-iceberg-decode branch May 10, 2026 06:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant