Skip to content

chore: regenerate management API types - #609

Merged
Rodriguespn merged 1 commit into
mainfrom
chore/regenerate-management-api-types
Nov 25, 2026
Merged

Rodriguespn merged 1 commit into
mainfrom
chore/regenerate-management-api-types

Conversation

@supabase-releaser

Copy link
Copy Markdown
Contributor

Automatically generated by the Sync Management API Types workflow.

This regenerates the Management API types from the current v1 and v2 OpenAPI specs.

@supabase-releaser
supabase-releaser Bot requested a review from a team as a code owner November 25, 2026 11:48
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 45607819771

Coverage remained the same at 98.356%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 6390
Covered Lines: 6310
Line Coverage: 98.75%
Relevant Branches: 1397
Covered Branches: 1349
Branch Coverage: 96.56%
Branches in Coverage %: Yes
Coverage Strength: 298.97 hits per line

💛 - Coveralls

@Rodriguespn
Rodriguespn merged commit d670445 into main Nov 25, 2026
11 of 13 checks passed
Rodriguespn added a commit that referenced this pull request Nov 26, 2026
Auto-opens the Management API types sync PR whenever `Check Management
API Types` fails, and auto-approves + auto-merges it once `Tests` pass.
Follows the same `supabase-oss` pattern team CLI uses in
[bot-pr-auto-merge.yml](https://github.com/supabase/cli/blob/develop/.github/workflows/bot-pr-auto-merge.yml)
and
[CODEOWNERS](https://github.com/supabase/cli/blob/develop/.github/CODEOWNERS).

- Triggers `sync-management-api-types.yml` on failed `Check Management
API Types` `workflow_run` completions, serialized with a
`sync-management-api-types` concurrency group. Existing
`chore/regenerate-management-api-types` PRs are updated in place (or
skipped as a no-op if unchanged).
- Adds `@supabase-oss` alongside `@supabase/ai` in `.github/CODEOWNERS`
only for the two generated `types.ts` files (`management-api/types.ts`
and `management-api-v2/types.ts`).
- Adds `auto-approve-management-api-types.yml`, triggered on `Tests`
`workflow_run` success in `main`'s context (never checks out PR code).
Validates same repo, `main` target, non-draft, `supabase-releaser[bot]`,
exact `HEAD` SHA, and 1–2 `modified` files strictly within those two
`types.ts` paths before approving via `AUTO_APPROVE_PR_PAT` and
enabling/executing squash auto-merge.

```mermaid
flowchart TD
    T1["PR fails Check Management API Types"] --> SYNC
    T2["Daily cron 06:00 UTC"] --> SYNC
    T3["Manual workflow_dispatch"] --> SYNC

    SYNC["sync-management-api-types.yml\n(runs on main, serialized by concurrency)"] --> OPEN{"PR already open on\nchore/regenerate-management-api-types?"}

    OPEN -->|No| PR["Opens PR as supabase-releaser[bot]"]
    OPEN -->|Yes, same spec diff| NOOP["Clean no-op\n(no push, no duplicate PR)"]
    OPEN -->|Yes, newer spec diff| PR2["Force-pushes updated commit\nto existing PR in place"]

    PR --> CI1["Code Quality (biome.yml)\nrequired on main"]
    PR --> CI2["Tests (tests.yml)\nbuild + typecheck + vitest + ui-test"]
    PR2 --> CI1
    PR2 --> CI2

    CI2 -->|fails: e.g. breaking OpenAPI change| STOP1["Stops: PR stays open,\nno approval, no merge"]
    CI2 -->|succeeds| AA["auto-approve-management-api-types.yml\n(runs on main, never checks out PR code)"]

    AA --> GATE{"Strict gates:\n• same repo + main target + non-draft\n• actor == sender == supabase-releaser[bot]\n• HEAD SHA matches Tests run\n• only 1-2 modified types.ts files (no renames)"}

    GATE -->|any check fails| STOP2["Aborts: no approval, no merge"]
    GATE -->|all pass| APP["supabase-oss approves exact HEAD SHA\n(satisfies CODEOWNERS on types.ts only)"]

    APP --> AM{"Repo allow_auto_merge?"}
    AM -->|false| HOLD["Approved only — human merges"]
    AM -->|true| MERGE["Squash-merges at exact HEAD SHA\n(immediately if CLEAN, or waits for Code Quality)"]
```

Repo prerequisites are already configured (`main`-restricted
`auto-approve` environment with `AUTO_APPROVE_PR_PAT`, `supabase-oss`
write access, `allow_auto_merge=true`). Verified with `actionlint` +
`shellcheck` and by running the file-allowlist script against #609 and
negative fixtures (extra file, rename, added file).
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.

2 participants