Skip to content

ci(cli): publish config schemas to supabase.com from stable releases (CLI-2864) - #7397

Merged
Coly010 merged 4 commits into
developfrom
columferry/cli-2864-publish-schemas-to-supabasecom-from-cli-stable-releases
Oct 30, 2026
Merged

Coly010 merged 4 commits into
developfrom
columferry/cli-2864-publish-schemas-to-supabasecom-from-cli-stable-releases

Conversation

@Coly010

@Coly010 Coly010 commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Since #7366 the config, project-config and supabase.lock schemas have $ids under https://supabase.com/schemas/, but nothing serves them yet. supabase/supabase#52509 sets up apps/www/public/schemas in supabase/supabase, and this publishes to it from every stable release.

  • New scripts/publish-schemas.ts copies the newest version of each schema in apps/docs/public/schemas to apps/www/public/schemas on a cli/schemas branch in supabase/supabase. It only opens a PR (or reuses the open one) when a file changed, and arms auto-merge on it
  • Before pushing, it checks that each schema is a JSON object, declares draft-07, and has an $id matching the URL it'll be served from. Lower versions are never written, and it refuses to publish if supabase.com already serves a newer version or the cli/schemas branch changes anything else, so a published version can't be modified
  • --dry-run validates and prints what it would publish without touching supabase/supabase. Release dry runs pass it
  • The clone, branch, commit and PR steps move into scripts/publish-pull-request.ts, shared with publish-docs-spec.ts. The CLI reference publisher behaves the same as before
  • The release docs job is now "Publish to supabase.com" and runs both publishers, each without stopping the other. A failed publish adds an error annotation and a step summary line, turns the job red and posts to Slack (new publish-failure message). The release itself still succeeds

Auto-merge still waits on a code-owner approval, since supabase/supabase master requires one and the releaser App can't approve its own PR. The schemas path is owned by @supabase/cli, so one of us approves and it merges itself. Making it fully hands-off would need the App added as a bypass actor on that ruleset.

There's no v*.x branch at the minute, so no cherry-pick is needed.

Linked issue

Closes CLI-2864

…LI-2864)

Stable releases copy the newest version of each schema in
apps/docs/public/schemas to apps/www/public/schemas in supabase/supabase,
opening or reusing a cli/schemas PR with auto-merge armed when a file
changed. The publisher validates each schema first and refuses to write
below a version supabase.com already serves.

The clone/commit/PR flow moves into scripts/publish-pull-request.ts,
shared with the CLI reference publisher. A failed publish turns the
renamed "Publish to supabase.com" job red and posts to Slack.

@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

Adjudicated all six findings and merged two duplicate pairs. Confirmed a major frozen-schema safeguard bug, a minor notification gap, and a test-naming nit. Refuted the Slack rerun instruction concern.

Findings

Severity Location Category Sources Claim
🟠 MAJOR apps/cli/scripts/publish-schemas.ts:110 correctness claude+codex The frozen-version safeguard checks the reused publishing branch instead of the destination base, allowing changes to versions already frozen on master.
🟡 MINOR .github/workflows/release.yml:386 error-handling claude+codex Publishing failures can escape Slack notification when the docs job terminates before exporting its report.
⚪ NIT apps/cli/scripts/publish-schemas.integration.test.ts:112 test-conventions claude This subprocess-based suite uses the integration-test suffix despite the documented convention reserving that behavior for E2E tests.
Refuted findings (kept for transparency, not posted as review comments)
  • .github/workflows/slack-notify.yml:111 (operability): The Slack rerun instruction is insufficient because Re-run failed jobs may skip the publishing job under job-level continue-on-error.
    Refuted: The message already directs the operator to rerun the specific job and links its workflow run. It does not instruct them to use Re-run failed jobs. The proposed clarification repeats the existing instruction; job-level continue-on-error does not prevent rerunning a named job.

Stats

Claude findings: 4 · Codex findings: 2 · Confirmed: 3 · Refuted: 1 · Uncertain: 0


Models: claude-opus-5-5 + gpt-6.1-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/scripts/publish-schemas.ts Resolved
Comment thread .github/workflows/release.yml Resolved
@Coly010 Coly010 self-assigned this Oct 29, 2026
…publish-schemas-to-supabasecom-from-cli-stable-releases
The publisher now reads served versions from origin/<base> rather than
a reused cli/schemas checkout, and refuses when the branch changes any
file other than the current versions. A docs job that never exports
failed=false now counts as a failed publish for the Slack notice. The
git-backed publisher suite moves to e2e with stale-branch coverage.
@github-actions

Copy link
Copy Markdown
Contributor

CLI benchmark: no changes found

Commit 5694894 against develop at b73be06 · 10 runs each · report only, never blocks merging

Command Before After Change
supabase --version 264 ms 226 ms no real change (-14%, within normal variation)
supabase --help 220 ms 213 ms no real change
supabase init 206 ms 208 ms no real change
supabase migration new bench 233 ms 237 ms no real change
supabase gen types --lang typescript --project-id replayfixtureprojref 292 ms 272 ms no real change (-7%, within normal variation)
supabase projects list 255 ms 255 ms no real change
supabase functions list --project-ref replayfixtureprojref 278 ms 267 ms no real change

API calls: unchanged for all 7 commands.

Binary size: 133.8 MB, unchanged.

Details: timing ranges, API calls per command, slowest phases

Timing ranges

Command Before range After range Change Verdict
supabase --version 204-349 ms 199-287 ms -37 ms (-14%) within noise
supabase --help 189-249 ms 188-276 ms -6 ms (-3%) within noise
supabase init 192-224 ms 196-232 ms +2 ms (+1%) within noise
supabase migration new bench 216-291 ms 220-301 ms +4 ms (+2%) within noise
supabase gen types --lang typescript --project-id replayfixtureprojref 253-325 ms 253-304 ms -20 ms (-7%) within noise
supabase projects list 221-297 ms 227-308 ms 0 ms (0%) within noise
supabase functions list --project-ref replayfixtureprojref 246-382 ms 228-305 ms -11 ms (-4%) within noise

API calls per command

Command Before After Endpoint changes
supabase --version 0 0
supabase --help 0 0
supabase init 0 0
supabase migration new bench 0 0
supabase gen types --lang typescript --project-id replayfixtureprojref 2 2
supabase projects list 1 1
supabase functions list --project-ref replayfixtureprojref 2 2

Slowest phases

No command moved beyond noise, so there are no phase deltas.

Comment /bench to run it again on the latest commit.

Workflow run

Coly010 added a commit to supabase/supabase that referenced this pull request Oct 29, 2026
## Problem

The Supabase CLI's config, project-config and `supabase.lock` JSON
schemas declare `$id`s under
`https://supabase.com/schemas/<name>/v<N>.json`, and editors such as
Even Better TOML fetch them from the `$schema` URL. Nothing is served at
that path yet, so those URLs 404.

## Solution

- Adds `apps/www/public/schemas` with v1 of the three schemas. They're
generated in supabase/cli, and from now on its stable releases open a PR
here when one changes (supabase/cli#7397)
- `/schemas/:path*` responses send `access-control-allow-origin: *` and
`cache-control: public, max-age=3600`, so browser-based editors and
validators can fetch them and a new release shows up within the hour.
Covered in `next.config.test.ts`
- `/apps/www/public/schemas/ @supabase/cli` in CODEOWNERS, so the CLI
team reviews those release PRs
- The folder is in `.prettierignore`. The CLI publishes these files byte
for byte, so reformatting them here would show up as a change on every
release

## Review instructions

1. Open `/schemas/config/v1.json` on the www preview
2. Check it returns the schema as JSON, with
`access-control-allow-origin: *` and the cache header (`curl -sI
<preview>/schemas/config/v1.json`)

Closes CLI-2865
@Coly010
Coly010 added this pull request to the merge queue Oct 30, 2026
Merged via the queue into develop with commit 4435e0b Oct 30, 2026
49 checks passed
@Coly010
Coly010 deleted the columferry/cli-2864-publish-schemas-to-supabasecom-from-cli-stable-releases branch October 30, 2026 12:24
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