Skip to content

fix(cli-go): repoint overlay.yaml at renamed JitListAccessResponse schema - #6425

Merged
Coly010 merged 2 commits into
developfrom
fix/codegen-overlay-jit-list-access
Sep 1, 2026
Merged

fix(cli-go): repoint overlay.yaml at renamed JitListAccessResponse schema#6425
Coly010 merged 2 commits into
developfrom
fix/codegen-overlay-jit-list-access

Conversation

@Coly010

@Coly010 Coly010 commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

Bug fix (CI).

What is the current behavior?

The Codegen job in the CI workflow runs go generate against the live Management API spec (api.supabase.green) and fails the build if the checked-in pkg/api files drift from what it produces. Upstream started splitting every response component schema into a base and _Output variant (e.g. JitListAccessResponse -> JitListAccessResponse_Output), which broke three apps/cli-go/api/overlay.yaml selectors targeting the old schema name:

failed to apply Overlay "api/overlay.yaml" ... selector "$.components.schemas.JitListAccessResponse.properties.items.items.anyOf[0].properties.invite_id" did not match any targets

This has failed the Codegen check on every develop commit since #6417 (merged 2026-09-01), blocking the merge queue for all PRs since the merge_group trigger has no path filter.

What is the new behavior?

  • overlay.yaml selectors repointed at JitListAccessResponse_Output (schema shape is unchanged, only the name).
  • Regenerated pkg/api/{types,client}.gen.go against the current live spec, which also renames every other response schema type to its *Output counterpart.
  • Renamed all downstream Go references (pkg/config, pkg/function, internal/utils, internal/telemetry, internal/functions/download) to the new *Output type names so the module still builds.

Verified: go build ./..., go vet ./..., golangci-lint run, and go generate (re-run to confirm idempotency) all pass in apps/cli-go. go test ./... in apps/cli-go is 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 clean develop checkout (confirmed via a baseline worktree) — unrelated to this change, and that submodule isn't part of the CI Test job's scope anyway.

Related Issue(s)

Unblocks the merge queue (e.g. #6423).

…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.
@Coly010
Coly010 requested a review from a team as a code owner September 1, 2026 17:01
@Coly010 Coly010 self-assigned this Sep 1, 2026
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Supabase CLI preview

npx --yes https://pkg.pr.new/supabase/cli/supabase@3bfd17952a80603702b36c68cb97bc18826caadf

Preview package for commit 3bfd179.

@Coly010
Coly010 enabled auto-merge September 1, 2026 17:09

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread apps/cli-go/pkg/api/types.gen.go
Comment thread apps/cli-go/pkg/api/client.gen.go
Comment thread apps/cli-go/pkg/api/types.gen.go
Comment thread apps/cli-go/api/overlay.yaml
Comment thread apps/cli-go/pkg/config/db.go
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.
@Coly010

Coly010 commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

/ai-review

@Coly010
Coly010 added this pull request to the merge queue Sep 1, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 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.

Comment on lines +19424 to +19429
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.

Comment on lines +6578 to 6585
type GetProjectDbMetadataResponseOutput struct {
Databases []struct {
Name string `json:"name"`
Schemas []struct {
Name string `json:"name"`
} `json:"schemas"`
} `json:"databases"`
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚪ 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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚪ 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.

Merged via the queue into develop with commit f50e083 Sep 1, 2026
65 checks passed
@Coly010
Coly010 deleted the fix/codegen-overlay-jit-list-access branch September 1, 2026 17:44
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.

3 participants