Skip to content

add the supabase plugin - #109

Merged
brandonphelps1212 merged 2 commits into
mainfrom
supabase-plugin
Nov 19, 2026
Merged

brandonphelps1212 merged 2 commits into
mainfrom
supabase-plugin

Conversation

@brandonphelps1212

Copy link
Copy Markdown
Contributor

What this changes

Adds the supabase plugin on the openapi format plugin. Part of #69 (I11.1 · Watch Supabase), under #14.

  • Source: the Supabase Management API spec, apps/docs/spec/api_v1_openapi.json in supabase/supabase.
    • The repo tags no spec releases, so each version is pinned by the commit that last changed it, found through the GitHub commits API.
    • An event's version is that commit's date, because the API has no version beyond /v1 and its info.version is a fixed 1.0.0.
  • Reports: the same rule as vercel, now shared as deprecationsOnly. Path templates are matched, so a path-parameter rename isn't a change.
    • operation deprecations (the deprecated flag);
    • removals (breaking) of operations the previous spec had marked deprecated.
  • diff/: new Options.QuoteDeprecatedOperation. A deprecation by the flag cites the whole operation instead of the bare true, so the reason in its description ("This endpoint is deprecated - use the deploy endpoint.") is in the excerpt. It defaults to false, so the other openapi plugins are unchanged.

Checklist

  • Added to docs/plugins.md: new supabase row with status paused, like vercel and cloudflare. I compared the registered plugins with the table.
  • Every commit is signed off (git commit -s, DCO)
  • Golden test over real saved copies of the source (plugins/openapi/testdata/golden/supabase.json):
    • the POST /v1/projects/{ref}/functions deprecation (2025-02-19), run as a daily ingest;
    • the replay of 693bdc38 → eb21ae25: the GET …/analytics/endpoints/logs.all deprecation (2026-06-29).
  • testdata/README.md lists each file: URL, date fetched, license, quote. The copies are trimmed to the operations involved, with values unchanged. They're re-indented, because the source is Prettier-formatted, and minified before 2025.
  • Pinned drop test: 8aef4a08 → 90b71e3e, where 14 analytics warehouse operations left the spec without being deprecated. A second test covers the /v1/branches/{branch_id} → {branch_id_or_ref} rename.
  • providers/supabase.md written from providers/_template.md, including Why this source
  • Fetches only through env.Get / kit/: the adapter uses the shared fetch layer under adapter/, like the other openapi adapters.
  • go build ./... && go vet ./... && gofmt -l . && go test -race ./... pass locally, and so does scripts/leak_guard.py --all.
  • Nothing private: no credentials, internal hosts, private links, customer names

Notes for the reviewer

  • Volume: the whole history (90 spec commits, 2024-05-31 to 2026-11-18) gives 2 events, both deprecations.
    • 22 operations left the spec, none deprecated first: 14 warehouse operations, 7 path-parameter renames, and one that came back 12 days later.
    • Without credentials every route answers 401, made-up ones included, so removals can't be checked from outside. Precision over recall: they're dropped.
  • Why not the changelog or the SDKs:
    • Supabase's changelog has about 30 breaking or deprecation posts, but they're about the platform (Postgres versions, pooler ports, OAuth providers, the CLI) or behavior changes with nothing to name.
    • supabase-js (2.119) and supabase-py (2.34) haven't had a major release in years.
  • A known gap the tests surfaced: on 2026-09-30 the logs.all description became "This endpoint has been removed and always responds with 410 Gone", with the operation still in the spec. A change of words only, so the diff doesn't see it.
  • Live check: the registered plugin against GitHub replayed the full-size specs.
    • 693bdc38 → eb21ae25: 12 raw changes, 1 event (the logs.all deprecation).
    • The warehouse pair: 24 changes, 0 events.
  • Client side: like cloudflare, these events are versioned by date (2026-06-29). The patch-it client needs the same rule for date-versioned api_operation events before this plugin goes live.
  • An independent review found no defects. Its wording fixes are included.

🤖 Generated with Claude Code

Watches the Supabase Management API through the OpenAPI spec in
supabase/supabase, pinned by commit since the repo tags no spec
releases; an event's version is the commit's date. Uses vercel's rule,
now shared as deprecationsOnly: operation deprecations, and removals of
operations marked deprecated first. diff gains
Options.QuoteDeprecatedOperation, so a flag deprecation can quote the
operation and the reason in its description.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: brandonphelps1212 <bphelps1212@gmail.com>
@claude

claude Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Claude finished @brandonphelps1212's task in 1m 42s —— View job


✅ Ready to merge: the plugin follows every repo rule, the build, vet, gofmt, race tests and leak guard all pass, and I found no correctness problems.

Rules

Rule Status Evidence
Plugin list (Rule 1) ✅ New supabase row in docs/plugins.md:17, between the markers, plain table, absolute links, status paused with a reason. I counted 16 plugin.Register calls (6 openapi, 2 retirements, 1 migrationguide, 1 removedmembers, 2 changelog, 3 feed) against 16 rows. They match.
Provider page ✅ providers/supabase.md follows the template. Why this source has the link, the check date (2026-11-19), why it's the best source, the alternatives not used (live v1-json, the changelog, the missing deprecations page, the SDKs) and a quote. It's also listed in providers/README.md.
Golden test and quote ✅ testdata/golden/supabase.json holds 2 deprecation events. Each one carries the pinned raw URL with the full SHA, a JSON pointer and an excerpt. The test checks each excerpt against the saved file, so it's not just a golden match. testdata/README.md has a row for each pair of files: URL, date, Apache-2.0, quote.
Drop test ✅ TestSupabaseDropsRemovalsThatWerentDeprecated replays 8aef4a08 → 90b71e3e and expects 0 events. It also checks that the same pair without the filter gives 14 removals, so the test can't pass on an empty fixture. The branch-rename test is a good second drop case.
Fetch only via env / fetch layer ✅ adapter/supabase.go calls only fetch.Get. Plugin code has no net/http, the only file reads are of testdata/ in tests, and there's no database. contract/fixtures/ is untouched.
Nothing private (Rule 2) ✅ No credentials, internal hosts, private links or session links in the code, tests, docs, commit message or PR body. The hosted service is called "patch-it's hosted ingestion service". The DCO sign-off carries the author's own address, which is normal for DCO.

Bugs

None found. What I checked:

  • diff.Options.QuoteDeprecatedOperation: defaults to false, and only the new switch branch reads it, so the other openapi plugins behave as before. TestQuoteDeprecatedOperation covers both settings.
  • The vercelKeep → deprecationsOnly(vercelDiff) refactor: the logic is the same as before, and vercel's existing tests still pass.
  • Precision: supabaseKeep keeps only operation deprecations, and removals of operations the old spec had marked deprecated. With PathTemplates: true, a path-parameter rename can't show up as a removal, and the second drop test covers that.
  • Adapter: it pins the full SHA even when given a short one, takes the version from the committer date (UTC), and returns an error for a missing commit, a missing date, a missing spec, or a spec that isn't JSON. Each case is tested.

Verified

  • go build ./...: OK
  • go vet ./...: no output
  • gofmt -l .: no output
  • go test -race ./...: all 19 packages ok, including adapter, diff and plugins/openapi
  • python3 scripts/leak_guard.py --all: "no banned terms (8 hashed terms checked)"

I couldn't compare the trimmed testdata/supabase-*.json copies with the upstream commits, because this runner has no network access. That part relies on the README rows and the excerpt-vs-file check in the golden test.

Non-blocking (optional)

  • On days with two spec commits, an event's previous_version equals its version. The provider page already lists this as a known gap. If it ever matters to the client, a fallback such as YYYY-MM-DD+<short sha> would make the versions unique, but it doesn't need to be in this PR.
  • The tests reuse vercelEnv(s). It works, but a neutral name like openapiEnv would read better now that two plugins share it.

Thanks for a careful PR. The volume analysis and the known-gaps section (the 410 Gone change that happened in words only) are especially useful.

Signed-off-by: brandonphelps1212 <bphelps1212@gmail.com>
@brandonphelps1212

Copy link
Copy Markdown
Contributor Author

@claude review

@claude

claude Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Claude finished @brandonphelps1212's task in 53s —— View job


✅ Ready to merge

I checked the PR against every rule in AGENTS.md and found no blocking problems. I can't run the tests from here; CI_go covers build, vet, gofmt and go test -race, and CI_leak_guard covers the internal-names check.

Rules

Rule Status Evidence
1. Row in docs/plugins.md ✅ New supabase row between the plugins:start/plugins:end markers. It's a plain table row with absolute links only, and its status is paused like vercel. The new plugin.Register call in plugins/openapi/openapi.go:38 matches it.
2. providers/supabase.md with Why this source ✅ The page follows _template.md. Why this source has the link, the check date (2026-11-19), why it's the best source, four alternatives with reasons (live v1-json, the changelog, no deprecations page, the SDKs) and a quote. The page is also listed in providers/README.md.
3. Golden test, testdata row, drop test, source on every event ✅ testdata/golden/supabase.json has 2 events. Each has a full-SHA source_url, a source_pointer and a source_excerpt, and TestSupabaseGolden checks each excerpt against the saved file (supabase_test.go:442). testdata/README.md has a row for each of the 4 file pairs with URL, date, license (Apache-2.0) and quote, plus a note that the copies are re-indented. The pinned drop test (TestSupabaseDropsRemovalsThatWerentDeprecated) also checks that the same pair gives 14 removals without the filter, so it can't pass on an empty fixture. This is a new golden file, so no golden edits needed explaining.
4. Fetch only via env.Get/kit/, no stray net/http or filesystem ✅ adapter/supabase.go calls only fetch.Get. net/http appears only in adapter/supabase_test.go, under adapter/. File reads are only of testdata/ in tests. contract/fixtures/ is untouched.
5. Precision over recall ✅ deprecationsOnly keeps only operation deprecations, and removals of operations the old spec had marked deprecated. PathTemplates: true pairs up path-parameter renames, and TestSupabaseBranchParameterRenameIsNoChange tests that. A daily run compares the spec's content hash (openapi.go:81), so two commits on the same date don't cause a missed or duplicate run.
6. Nothing private ✅ I found no credentials, internal hosts or service names, private links, customer names or AI-session links in the code, docs, testdata or PR body. The service is called "patch-it's hosted ingestion service".

Blocking bugs

None.

What I checked:

  • diff.Options.QuoteDeprecatedOperation
    • It defaults to false and only the new case reads it, so the other openapi plugins behave as before. TestQuoteDeprecatedOperation covers both settings.
    • The sorted-keys note holds: of the standard Operation Object fields, only callbacks sorts before deprecated, and x- extensions sort after it.
  • The vercelKeep → deprecationsOnly(vercelDiff) refactor: the logic is the same as before.
  • adapter.Supabase
    • It pins the citation to the full SHA even when given a short one, and takes the version from the UTC committer date.
    • It returns an error for a missing commit, a missing date, a missing spec, or a spec that isn't JSON. Each case is tested.

Non-blocking suggestions

  • Shared test helper name: the Supabase tests reuse vercelEnv(s). A neutral name such as openapiEnv would read better now that two plugins use it.
  • Unique versions: when two spec commits land on one day, previous_version == version. The provider page already lists this under known gaps. If the client ever needs unique versions, something like YYYY-MM-DD+<short sha> would do it, but it doesn't belong in this PR.
  • Removed, then restored: if a deprecated operation leaves the spec and comes back a few commits later (an operation did this once, though it wasn't deprecated), the removal would still emit a breaking event. That's an unlikely edge case and Vercel has the same behaviour, so it's only worth a line under known gaps.

Thanks for a careful, well-documented PR. The volume analysis, the drop test that proves its fixture still shows the removals, and the honest note about the 410 Gone change made only in words are especially helpful.

@brandonphelps1212
brandonphelps1212 merged commit f275f81 into main Nov 19, 2026
4 checks passed
@brandonphelps1212
brandonphelps1212 deleted the supabase-plugin branch November 19, 2026 17:34
@brandonphelps1212 brandonphelps1212 mentioned this pull request Nov 19, 2026
15 tasks
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.

1 participant