Repository navigation
ci: auto-open and auto-approve management API types sync PRs - #627
Merged
Merged
Conversation
Coverage Report for CI Build 45827700551Coverage increased (+0.001%) to 98.267%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats💛 - Coveralls |
- Trigger sync-management-api-types.yml on failed Check Management API Types runs with a concurrency group - Add narrow CODEOWNERS entries for the two generated management-api types.ts files with @supabase-oss - Add auto-approve-management-api-types.yml to approve and enable auto-merge after Tests pass on verified bot PRs
Rodriguespn
force-pushed
the
Rodriguespn/auto-sync-approve-mgmt-api-types
branch
from
November 26, 2026 13:17
4839eac to
39099cb
Compare
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.
Auto-opens the Management API types sync PR whenever
Check Management API Typesfails, and auto-approves + auto-merges it onceTestspass. Follows the samesupabase-osspattern team CLI uses in bot-pr-auto-merge.yml and CODEOWNERS.sync-management-api-types.ymlon failedCheck Management API Typesworkflow_runcompletions, serialized with async-management-api-typesconcurrency group. Existingchore/regenerate-management-api-typesPRs are updated in place (or skipped as a no-op if unchanged).@supabase-ossalongside@supabase/aiin.github/CODEOWNERSonly for the two generatedtypes.tsfiles (management-api/types.tsandmanagement-api-v2/types.ts).auto-approve-management-api-types.yml, triggered onTestsworkflow_runsuccess inmain's context (never checks out PR code). Validates same repo,maintarget, non-draft,supabase-releaser[bot], exactHEADSHA, and 1–2modifiedfiles strictly within those twotypes.tspaths before approving viaAUTO_APPROVE_PR_PATand enabling/executing squash auto-merge.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-restrictedauto-approveenvironment withAUTO_APPROVE_PR_PAT,supabase-osswrite access,allow_auto_merge=true). Verified withactionlint+shellcheckand by running the file-allowlist script against #609 and negative fixtures (extra file, rename, added file).