fix(cli-go): repoint overlay.yaml at renamed JitListAccessResponse schema - #6425
Conversation
…hema The live Management API spec split every response schema into base and _Output variants; JitListAccessResponse became JitListAccessResponse_Output, breaking overlay selectors and failing the Codegen CI job repo-wide since the API sync in #6417. Regenerates pkg/api and renames all downstream Go references to the *Output types.
Supabase CLI previewnpx --yes https://pkg.pr.new/supabase/cli/supabase@3bfd17952a80603702b36c68cb97bc18826caadfPreview package for commit |
There was a problem hiding this comment.
Superseded by a newer AI review
🤖 AI Review
Claude reported five findings and Codex reported none. Code inspection confirms all five observations: three are minor compatibility/behavior changes from regeneration, while two are non-blocking maintainability/scope notes. No critical or major defect was verified.
Findings
| Severity | Location | Category | Sources | Claim |
|---|---|---|---|---|
| 🟡 MINOR | apps/cli-go/pkg/api/types.gen.go:6525 |
api-compatibility |
claude | Regeneration removes previously exported response-model names, creating a source-breaking change for consumers of the independently tagged Go module. |
| 🟡 MINOR | apps/cli-go/pkg/api/client.gen.go:12381 |
behavior-change |
claude | Regeneration changes V1RestoreABranch response decoding from HTTP 200/JSON200 to HTTP 201/JSON201. |
| 🟡 MINOR | apps/cli-go/pkg/api/types.gen.go:6578 |
behavior-change |
claude | Regeneration removes AdditionalProperties preservation from database-metadata and advisor response structures, causing unknown JSON fields to be discarded. |
| ⚪ NIT | apps/cli-go/api/overlay.yaml:41 |
maintainability |
claude | The repaired JIT overlay selectors remain coupled to the exact upstream component name and will fail again if that component is renamed. |
| ⚪ NIT | apps/cli-go/pkg/config/db.go:95 |
scope |
claude | The PR includes unrelated gofmt-only changes in db.go and deploy_test.go. |
Stats
Claude findings: 5 · Codex findings: 0 · Confirmed: 5 · Refuted: 0 · Uncertain: 0
Models: claude-opus-5 + gpt-5.6-sol · Trigger: auto · Workflow run
This review runs once per PR. A maintainer can request another with a /ai-review comment.
The generated pkg/api types the previous commit regenerated renamed BranchResponse/OrganizationResponseV1/SslEnforcementResponse/GetProviderResponse to their *Output counterparts; the drift-check test's goTypeName lookups need to follow. Field shapes are unchanged, only the type names moved.
|
/ai-review |
There was a problem hiding this comment.
🤖 AI Review
Both independent reviews completed. After deduplication, four findings remain and are confirmed: two minor API-contract regressions and two nits involving stale documentation and fragile overlay selectors.
Findings
| Severity | Location | Category | Sources | Claim |
|---|---|---|---|---|
| 🟡 MINOR | apps/cli-go/pkg/api/client.gen.go:19424 |
api-contract |
claude+codex | The regenerated client decodes branch-restore responses only for HTTP 201, although the previous client and the checked-in production OpenAPI contract specify HTTP 200; a 200 response therefore leaves the typed body unset. |
| 🟡 MINOR | apps/cli-go/pkg/api/types.gen.go:6578 |
data-loss |
claude+codex | The regenerated database-metadata and advisor output models no longer preserve arbitrary extension properties, so unknown response keys are discarded during JSON decoding and cannot be round-tripped. |
| ⚪ NIT | apps/cli/src/legacy/shared/legacy-go-struct-output.types-gen-drift.unit.test.ts:54 |
documentation |
claude | Comments surrounding the updated drift-check registry still reference pre-rename Go type names that no longer exist in types.gen.go. |
| ⚪ NIT | apps/cli-go/api/overlay.yaml:41 |
maintainability |
claude | The repaired JIT overlay selectors remain coupled to the concrete JitListAccessResponse_Output schema name, leaving code generation vulnerable to the same failure mode on another upstream rename. |
Stats
Claude findings: 4 · Codex findings: 2 · Confirmed: 4 · Refuted: 0 · Uncertain: 0
Models: claude-opus-5 + gpt-5.6-sol · Trigger: manual · Workflow run
This review runs once per PR. A maintainer can request another with a /ai-review comment.
| case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: | ||
| var dest BranchRestoreResponseOutput | ||
| if err := json.Unmarshal(bodyBytes, &dest); err != nil { | ||
| return nil, err | ||
| } | ||
| response.JSON200 = &dest | ||
| response.JSON201 = &dest |
There was a problem hiding this comment.
🟡 MINOR · api-contract · source: claude+codex
The regenerated client decodes branch-restore responses only for HTTP 201, although the previous client and the checked-in production OpenAPI contract specify HTTP 200; a 200 response therefore leaves the typed body unset.
Evidence: apps/cli-go/pkg/api/client.gen.go:19424-19429 only handles status 201 and assigns JSON201. packages/api/src/generated/openapi.json:469-479 still declares a 200 JSON response, while the diff shows the old Go parser also handled 200.
Suggested fix: Restore HTTP 200 decoding, or accept both 200 and 201 until the upstream contract and deployed endpoint are confirmed consistent.
| type GetProjectDbMetadataResponseOutput struct { | ||
| Databases []struct { | ||
| Name string `json:"name"` | ||
| Schemas []struct { | ||
| Name string `json:"name"` | ||
| } `json:"schemas"` | ||
| } `json:"databases"` | ||
| } |
There was a problem hiding this comment.
🟡 MINOR · data-loss · source: claude+codex
The regenerated database-metadata and advisor output models no longer preserve arbitrary extension properties, so unknown response keys are discarded during JSON decoding and cannot be round-tripped.
Evidence: apps/cli-go/pkg/api/types.gen.go:6578-6585 and 8724-8745 use anonymous structs without AdditionalProperties. The removed models had AdditionalProperties maps and custom JSON handlers, while packages/api/src/generated/openapi.json:19844-19870 and 19394-19430 declare additionalProperties for these objects.
Suggested fix: Preserve additionalProperties for the corresponding output schemas through the overlay or upstream OpenAPI definition, then regenerate the named structs and JSON handlers.
| specName: "LEGACY_GO_ORGANIZATION_RESPONSE", | ||
| spec: LEGACY_GO_ORGANIZATION_RESPONSE, | ||
| goTypeName: "OrganizationResponseV1", | ||
| goTypeName: "OrganizationResponseV1Output", |
There was a problem hiding this comment.
⚪ NIT · documentation · source: claude
Comments surrounding the updated drift-check registry still reference pre-rename Go type names that no longer exist in types.gen.go.
Evidence: apps/cli/src/legacy/shared/legacy-go-struct-output.types-gen-drift.unit.test.ts:37-39 names GetProviderResponse while lines 49-64 use the new Output names. Related go-payload comments name BranchResponse, OrganizationResponseV1, and SslEnforcementResponse; none has a matching type declaration in apps/cli-go/pkg/api/types.gen.go.
Suggested fix: Update the affected comments to use BranchResponseOutput, OrganizationResponseV1Output, SslEnforcementResponseOutput, and GetProviderResponseOutput.
| description: Removes deprecated null-only field that oapi-codegen cannot map | ||
| remove: true | ||
| - target: $.components.schemas.JitListAccessResponse.properties.items.items.anyOf[0].properties.invite_id | ||
| - target: $.components.schemas.JitListAccessResponse_Output.properties.items.items.anyOf[0].properties.invite_id |
There was a problem hiding this comment.
⚪ NIT · maintainability · source: claude
The repaired JIT overlay selectors remain coupled to the concrete JitListAccessResponse_Output schema name, leaving code generation vulnerable to the same failure mode on another upstream rename.
Evidence: apps/cli-go/api/overlay.yaml:41-57 hardcodes JitListAccessResponse_Output in all three selectors, while apps/cli-go/main.go:7-8 regenerates from a live API specification and other structural overlay selectors use schema wildcards.
Suggested fix: Use a sufficiently specific structural wildcard selector, with a test or uniqueness check ensuring it only matches the intended JIT response shape.
What kind of change does this PR introduce?
Bug fix (CI).
What is the current behavior?
The
Codegenjob in theCIworkflow runsgo generateagainst the live Management API spec (api.supabase.green) and fails the build if the checked-inpkg/apifiles drift from what it produces. Upstream started splitting every response component schema into a base and_Outputvariant (e.g.JitListAccessResponse->JitListAccessResponse_Output), which broke threeapps/cli-go/api/overlay.yamlselectors targeting the old schema name:This has failed the
Codegencheck on everydevelopcommit since #6417 (merged 2026-09-01), blocking the merge queue for all PRs since themerge_grouptrigger has no path filter.What is the new behavior?
overlay.yamlselectors repointed atJitListAccessResponse_Output(schema shape is unchanged, only the name).pkg/api/{types,client}.gen.goagainst the current live spec, which also renames every other response schema type to its*Outputcounterpart.pkg/config,pkg/function,internal/utils,internal/telemetry,internal/functions/download) to the new*Outputtype names so the module still builds.Verified:
go build ./...,go vet ./...,golangci-lint run, andgo generate(re-run to confirm idempotency) all pass inapps/cli-go.go test ./...inapps/cli-gois green aside from two pre-existing, environment-only failures (no local Docker daemon).pkg/config's test suite has ~20 pre-existing failures that are identical on a cleandevelopcheckout (confirmed via a baseline worktree) — unrelated to this change, and that submodule isn't part of the CITestjob's scope anyway.Related Issue(s)
Unblocks the merge queue (e.g. #6423).