Skip to content

CI: fail on drift between generated SQL and its fragments - #72

Merged
seanwevans merged 2 commits into
mainfrom
claude/pg-git-upgrade-deps-rk0oxk-ci-drift
Sep 3, 2026
Merged

seanwevans merged 2 commits into
mainfrom
claude/pg-git-upgrade-deps-rk0oxk-ci-drift

Conversation

@seanwevans

Copy link
Copy Markdown
Owner

The problem

The workflow ran make before sudo make install, and make regenerates sql/pg_git--0.4.0.sql in place. So a hand edit to the generated file, or a fragment change committed without regenerating, was repaired by the build itself and never reported.

The fix

Add make check-generated and run it as the first step of test-core, before anything else invokes make.

The target uses make -B rather than relying on the normal timestamp rule. In a fresh clone git writes every file at about the same moment, so make cannot reliably tell a stale artifact from a current one; forcing the rebuild makes the comparison against real output rather than against a guess.

Also documents the generated-file rule in CONTRIBUTING.md.

Verification

Both failure modes now fail the check:

  • committed hand edit to sql/pg_git--0.4.0.sql → is out of sync with the fragments it is generated from
  • fragment edited without regenerating → same failure

And a clean tree passes: sql/pg_git--0.4.0.sql matches its fragments.

🤖 Generated with Claude Code

https://claude.ai/code/session_017nq3xZcPqSTKtskyP2DzkK


Generated by Claude Code

claude and others added 2 commits September 3, 2026 17:37
The workflow ran `make` before `sudo make install`, and `make`
regenerates sql/pg_git--0.4.0.sql in place. A hand edit to the generated
file, or a fragment change committed without regenerating, was therefore
repaired by the build itself and never reported.

Add `make check-generated` and run it as the first step of test-core,
before anything else invokes make.

The target uses `make -B` rather than relying on the normal timestamp
rule. In a fresh clone git writes every file at about the same moment, so
make cannot reliably tell a stale artifact from a current one; forcing
the rebuild makes the comparison against real output rather than against
a guess.

Verified both failure modes fail the check: a committed hand edit to
sql/pg_git--0.4.0.sql, and a fragment edited without regenerating.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017nq3xZcPqSTKtskyP2DzkK
@seanwevans
seanwevans merged commit 4994d2e into main Sep 3, 2026
3 checks passed
@seanwevans
seanwevans deleted the claude/pg-git-upgrade-deps-rk0oxk-ci-drift branch September 3, 2026 23:04
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