Repository navigation
Compliance checking tooling and infrastructure for Go - #92
Merged
Merged
Conversation
…tructure. Co-Authored-By: Claude <[email protected]>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…ublic) repository workflow. Co-Authored-By: Claude <[email protected]>
Resolving: validate / Check public API against capability matrix Restore cache failed: Dependencies file is not found in /home/runner/work/supabase-go/supabase-go. Supported file pattern: go.mod
Member
Author
|
Proven end-to-end in this run via supabase/supabase-go#48 |
QuintinWillison
marked this pull request as ready for review
August 26, 2026 11:39
spydon
added a commit
that referenced
this pull request
Aug 26, 2026
## What
Restructures the repository into a lightweight monorepo (no Nx or
similar tooling): one `packages/` directory of flat sibling packages,
each with a single toolchain.
```
packages/
capability-matrix/ # TypeScript — capability data + validator + site generator
capabilities/ # moved from repo root
specs/ # moved from repo root
schema/ # moved from repo root
docs/ # moved from repo root
src/, test/, ... # moved from scripts/capability-matrix
dart-symbol-extractor/ # Dart — moved from scripts/dart_symbol_extractor
# (directory hyphenated; Dart package name keeps underscores)
go-symbol-extractor/ # Go — moved from scripts/go_symbol_extractor (added on main
# in #92 and folded into the new layout on rebase)
postgrest-typegen/ # empty scaffold — will generate types from PostgREST
# schemas; implementation comes later
```
All moves use `git mv`, so history follows the files. The capability
data (`capabilities/`, `specs/`, `schema/`, `docs/`) now lives inside
the package that consumes it, and the TypeScript root-resolution helpers
(`repoRoot()` in `cli.ts`, `compliance-cli.ts`, `aggregate.ts`,
`generate-site.ts`, `sync-compliance-cli.ts`) were changed to a
`packageRoot()` that resolves one level up from `src/`. GitHub blob URLs
emitted by the tools (spec links in the site, the drift-check docs link)
were updated to the new paths. The Go extractor's `go.mod` module path
was updated to `github.com/supabase/sdk/packages/go-symbol-extractor`.
## Rationale
- One `packages/` directory keeps the repository ready to host more
projects (the postgrest-typegen scaffold is the first addition) without
adopting workspace or monorepo build tooling.
- Flat siblings, one toolchain per package: npm/Vitest for
capability-matrix, pub/dart test for dart-symbol-extractor, the Go
toolchain for go-symbol-extractor. No cross-package dependency
management is needed.
- Each package is self-contained: the capability YAML data moved next to
the validator that reads it.
## External interface: unchanged
`.github/workflows/` and `.github/actions/` did **not** move, and no
externally consumed name changed:
- `validate-sdk-compliance-{dart,javascript,python,swift,go}.yml` and
`sync-sdk-compliance.yml` keep their exact names and locations (called
by supabase-flutter/js/py/swift as
`supabase/sdk/.github/workflows/<name>@<ref>`).
- The `sdk-compliance-{validate,check-setup,check-symbols,check-drift}`
composite actions keep their exact names and locations (referenced as
`supabase/sdk/.github/actions/<name>@main`).
- Inside those workflows and actions, every `working-directory`/path
reference flipped from `_sdk-spec/scripts/...` to
`_sdk-spec/packages/...` in this same commit, so the composite actions
and the scripts they check out flip together atomically. `grep -r
"scripts/" .github/` returns nothing.
**Compatibility symlinks:** the SDK repos pin the reusable workflows to
release SHAs (v1.1.x/v1.2.0) while the `sdk-ref` input for the
`_sdk-spec` checkout defaults to `main`. Those pinned workflow
definitions reference `_sdk-spec/scripts/...` inline, so the old paths
must keep resolving in a `main` checkout. `scripts/capability-matrix`
and `scripts/dart_symbol_extractor` are therefore kept as symlinks into
`packages/`. They can be removed once every caller has bumped past the
restructure release (Dependabot picks up the next tag). No symlink is
needed for the Go extractor: `validate-sdk-compliance-go.yml` is newer
than the latest release, so no caller pins a pre-monorepo revision of it
(verified by code search).
## Internal workflow renames
Two workflows are only triggered inside this repo and were renamed with
a project prefix (verified via code search that no external repository
references them):
- `validate-capabilities.yml` → `capability-matrix-validate.yml`
(display name `Validate Capabilities` kept, since `release.yml` triggers
on it via `workflow_run`)
- `deploy-pages.yml` → `capability-matrix-deploy-pages.yml`
Path filters and `working-directory` values in both now use
`packages/capability-matrix/**`, `packages/dart-symbol-extractor/**`,
and `packages/go-symbol-extractor/**`. The Pages build now aggregates
and uploads from `packages/capability-matrix/site/`.
Docs were updated accordingly: the root README is now a repository
overview with a package index (the capability-matrix content moved to
`packages/capability-matrix/README.md`), plus path updates in
CONTRIBUTING.md, CLAUDE.md, CODEOWNERS (per-directory package
ownership), `.gitignore`, and the capability-matrix project skill.
Action pins are untouched.
## Test results
- `packages/capability-matrix`: `npm ci`, `npm test` (14 files, 195
tests passed), `npm run typecheck`, `npm run validate` all pass.
- `packages/dart-symbol-extractor`: `dart pub get`, `dart test` (14
tests passed), `dart format` (no changes), `dart analyze` (no issues).
- `packages/go-symbol-extractor`: `gofmt` (no changes), `go vet`, `go
test ./...` all pass.
- Smoke checks through the compatibility symlinks: `npm run validate`,
`npm run report`, and `npm run validate-compliance` against
supabase-flutter's `sdk-compliance.yaml` from
`scripts/capability-matrix`, and `dart run bin/extract.dart` against a
local supabase-flutter checkout from `scripts/dart_symbol_extractor`,
all work.
- `npm run build-site` renders to
`packages/capability-matrix/site/index.html` (gitignored).
## Post-merge verification
After merge, trigger one caller repository's compliance workflow (for
example supabase-flutter's `validate-capabilities.yml` via
`workflow_dispatch`) to confirm the cross-repository paths: the pinned
reusable workflow should resolve the old `scripts/` paths through the
symlinks, and the `@main` composite actions should resolve the new
`packages/` paths.
Merged
spydon
added a commit
that referenced
this pull request
Aug 27, 2026
## What Empty commit carrying a `Release-As: 1.3.0` footer, to force release-please to cut a `v1.3.0` tag. ## Why Two commits have landed since `v1.2.0`, and neither is releasable by release-please: | Commit | Subject | Why no bump | |---|---|---| | `32e39e9` | Compliance checking tooling and infrastructure for Go (#92) | no conventional commit prefix | | `2097c67` | `chore(repo):` restructure into packages/ monorepo layout (#93) | `chore` does not bump | So no release PR was opened and there is no post-restructure tag. That blocks the SDK repos: `supabase-flutter` and `supabase-swift` pin `v1.2.0`, `supabase-js` and `supabase-py` pin `v1.1.1`, all pre-restructure. Their pinned workflow bodies hardcode `_sdk-spec/scripts/...` while the composite actions they call are `@main` and check out this repo at `main`, so the transitional `scripts/` symlinks are currently load-bearing. A `v1.3.0` tag gives those repos something to bump to, after which `scripts/` can be deleted. Minor rather than patch because #92 added the Go compliance tooling, a new feature. The externally consumed interface (reusable workflow names, composite action names and inputs) did not change in #93. ## Note The generated changelog entry for 1.3.0 will be thin, since the two underlying commits are not changelog-eligible. Worth hand-editing the release notes afterwards to mention the Go tooling and the `packages/` restructure. Release-As: 1.3.0
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.
The contents of this PR are entirely AI generated. It looks sensible to me on a brief skim read, though there's a lot of
sdk-repo and other domain knowledge coming together that I have not taken time to independently verify - so the proof will be when it gets first ran end to end - after which we can refine. The risk is low, this is internal tooling, to be utilised by a downstream, internal repository.Note
The
supabase/supabase-gorepository is currently Internal, so not visible in the public domain. It will be opened up soon. See https://github.com/orgs/supabase/discussions/49311🤖 AI-Generated Summary of Local Validations ran thus far...
Every command below was run locally before opening this PR, with output reproduced verbatim. Reading notes: pure navigation (
cd,pwd) and blank prompts are elided, a bracketed number in a prompt (for example[1]) is the shell reporting the previous command's exit status, and one output is truncated where marked.v1.2.0(29e402d).supabase/supabase-goat8d47358, clean tree - the only Go SDK carrying ansdk-compliance.yamltoday.go version go1.26.6 darwin/arm64), Node.js 26.7.0 via asdf.Step 1 - extractor hygiene
Byte-for-byte what the new
go-parserCI job runs, fromscripts/go_symbol_extractor:Formatted, vet-clean, unit suite green. The suite covers a golden walk of a two-module fixture workspace (generics, embedded fields, interfaces,
internal/,testdata/, nested modules,package main,_test.goand.sdk-parse-ignorerules), table tests for the ignore matcher and thego.workparser, the-moduleescape hatch, the missing-workspace error and the package-name-collision failure.Step 2 - dump a real SDK
This shows, on a real repository: package-qualified names in the registered spelling (
postgrest.FilterBuilder.Eq), theParsedSymbolkinds mapped from Go declarations (types asclass, fields asproperty, funcs and methods, consts and vars asvariable), root-relative paths with line numbers and name-sorted output. The exclusions hold too: nointernal/packages, no test files, no tooling modules, and unexported members are absent (postgrest.Queryappears while its unexported interface method does not).Step 3 - prepare the comparison inputs
Steps 4 and 5 compare files. These four commands created them (no output from any):
dump-names.txt- every symbol name the extractor emits for supabase-go.registered-names.txt- every symbol name registered in supabase-go'ssdk-compliance.yaml.base-symbols.json- the dump verbatim, standing in for a pull request's base branch.pr-symbols.json- the dump plus one fabricated symbol,postgrest.Scratch, which exists in no source file and no registration. It is planted so that step 5 has an unregistered addition to catch: the ❌ there is that test passing.Step 4 - every registered symbol resolves against the dump
Set difference: any registered name missing from the dump would print.
Empty. All 52 distinct registered names (53 registrations - one symbol sits under two features) resolve, so the package-qualified name contract holds against the one real Go compliance file with no respell needed.
Step 5 - end to end through the canonical
check-api-symbolsCLITwo runs against the step 3 dumps: the pair differing only by the planted
postgrest.Scratch, where ❌ is the wanted outcome, then the identical pair, expected clean. The transcript keeps the one-time environment setup hit on the way (asdf Node pin, then installing the validator's dependencies) since anyone reproducing this will hit it too:Exactly as intended: the dump is directly consumable by the canonical checker, the planted unregistered symbol blocks with exit 1 and an actionable message carrying its file and line straight from the dump, and the unchanged pair passes. The
npm auditandallowScriptswarnings are the validator's own pre-existing development-dependency posture, untouched by this PR.Not exercised locally
The two workflow files only execute on GitHub.
go-parserruns on this PR itself via thevalidate-capabilities.ymlpaths filter, andvalidate-sdk-compliance-go.ymlisworkflow_call-only, so its first execution comes from a calling repository - thesdk-refinput exists for exactly that pre-merge trial from a branch.