feat: generate splinter.json manifest and publish via release workflow - #175
Merged
Conversation
Emit a structured manifest (splinter.json) alongside splinter.sql so
downstream consumers can select, filter, and combine lints by reading
fields instead of parsing the monolithic union-all SQL blob.
- bin/compile.py: refactor into importable compile_sql()/main() under a
__main__ guard; splinter.sql output is byte-identical.
- bin/compile_json.py: new generator emitting {version, setup, lints[]}
where each lint is {name, categories, query}. name/categories are
lifted from each lint's SQL at build time, so a malformed lint fails
CI rather than a consumer's regex failing silently at runtime.
- .github/workflows/release.yml: on push to main, release when there is
a Conventional Commit since the last tag (prefix-indifferent), compute
CalVer YYYY.MM.Micro, tag + create the GitHub release, and publish to
s3://<shared-services-bucket>/splinter/<calver>/splinter.json
(OIDC role-chaining, mirroring the supautils release).
- .gitignore: splinter.json is generated/published, never committed.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Gate the release on a release-worthy Conventional Commit since the last tag: feat:, fix:, any breaking change (type!: or a BREAKING CHANGE: / BREAKING-CHANGE: footer). chore/docs/refactor/test/ci/perf no longer trigger a release. All release-worthy commits bump the single micro equally (no feat->minor / fix->patch distinction in CalVer). - Comment out the S3 upload steps for now; publishing to GitHub Releases only until the shared-services bucket wiring is ready. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
soedirgo
force-pushed
the
feat/splinter-json-manifest
branch
from
July 31, 2026 10:01
906751e to
36f1205
Compare
soedirgo
marked this pull request as ready for review
July 31, 2026 10:05
utkarash2991
approved these changes
Jul 31, 2026
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.
What
Emit a structured
splinter.jsonmanifest alongsidesplinter.sql, and add a release workflow that publishes it to GitHub Releases + S3.splinter.sqlis a single monolithicunion allquery. Consumers that want to select/filter/combine individual lints (e.g. supabase/platform's advisor) currently reverse-engineer structure out of that blob with a paren-depth scanner and regexes — fragile, and it fails silently against live customer DBs when the SQL shape changes. The manifest exposes that structure as data instead.Shape
{ "version": "<CalVer YYYY.MM.Micro>", "setup": "set local search_path = '';\n\ndo $$ ... $$;", "lints": [ { "name": "...", "categories": ["SECURITY"], "query": "(select ...)" } ] }queryis the same union-ready parenthesized SQL thatsplinter.sqluses — consumers treat it as opaque.name/categoriesare lifted from each lint's SQL at build time, so a malformed lint fails CI rather than a consumer's regex failing silently later.setupis the existing header (search_path=''+ thedo $$block), run once before the union.Changes
bin/compile.py— refactored into importablecompile_sql()/main()under a__main__guard.splinter.sqloutput is byte-identical (verified: empty diff).bin/compile_json.py(new) — the manifest generator. Reusescompile.load_sql_files..github/workflows/release.yml(new) — on push tomain:feat:,fix:, or any breaking change (type!:, or aBREAKING CHANGE:/BREAKING-CHANGE:footer).chore/docs/refactor/test/ci/perfdo not trigger a release.YYYY.MM.Micro(micro = next counter for the current month). All release-worthy commits bump the single micro equally — nofeat→minor /fix→patch distinction in CalVer.splinter.json.s3://<shared-services-bucket>/splinter/<calver>/splinter.jsonvia OIDC role-chaining (mirrors the supautils release)..gitignore—splinter.jsonis generated/published, never committed.PutObjectundersplinter/*: supabase/platform#36435 (must be deployed first).SHARED_SERVICES_OIDC,SHARED_SERVICES_ROLE(= the new role's ARN),SHARED_SERVICES_BUCKETmust be set.repo:supabase/*, so no OIDC-provider change is needed.Consumer side
supabase/platform#36414 — advisor consumes this manifest instead of scraping
splinter.sql.🤖 Generated with Claude Code