chore(sqlc): CI gate for stale generated query code (#7) - #26
Merged
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
make sqlc-checkMakefile target wrappingsqlc difffor local use.CONTRIBUTING.mdWorkflow step 4 to documentmake sqlc/make sqlc-checkwhen SQL sources change.sqlc diffgate to the backend CI job: installs sqlc v1.31.1 (matching the committed generated-code header) and fails ifinternal/platform/postgres/db/is stale relative toqueries/*.sql.Closes #7
Changed files
Makefilesqlc-checkto.PHONY; addedsqlc-checktarget aftersqlcCONTRIBUTING.mdmake sqlc/make sqlc-checkinstructions.github/workflows/ci.ymldocs/superpowers/plans/2026-06-18-sqlc-ci-gate.mdArchitecture
No application code changes. The sqlc query layer was already complete when this PR was opened:
queries/*.sql,internal/platform/postgres/db/*.go, all three store packages,make sqlc, anddocs/operations/local-development.mdwere all in place. This PR adds the optional CI gate from the issue scope and the accompanying discoverability improvements (Makefile shortcut, CONTRIBUTING.md note).The
sqlc diffstep is inserted early in the backend job (after Go setup, before gofmt) so that stale generated code is caught before test and build steps run.Security considerations
// versions: sqlc v1.31.1in committed generated files) prevents unexpected output reformatting from version upgrades.sqlc diffperforms file comparison only; it does not connect to any database.Testing evidence
git diff --check: empty output (no whitespace errors, no conflict markers).sqlc diffexits 0 against the current committed generated code (no drift) — verified by CI, which will run on this PR.gonot on local PATH; CI backend job covers this. No Go source files were modified so regression is not possible.Known limitations
linux_amd64-specific. Localmake sqlc-checkrequires a platform-appropriate sqlc install (seedocs/operations/local-development.md).make verifyintentionally does not callmake sqlcormake sqlc-check— regeneration is always a manual step so developers decide when to evolve the schema.Follow-up issues
None — this closes #7.