Skip to content

fix(ci): make pr-merge refuses a head behind its base - #145

Merged
jayleaton merged 1 commit into
mainfrom
fix/merge-requires-current-base
Oct 31, 2026
Merged

jayleaton merged 1 commit into
mainfrom
fix/merge-requires-current-base

Conversation

@jayleaton

@jayleaton jayleaton commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner

Rules. Before merge, run what this change needs on its exact head (docs/CI.md, "What to run"): for Go, make lint test scoped with LINT_DIRS/TEST_PKGS (scripts/affected.sh prints them) or make check-fast, plus the checks of what you touched. Then make ci-local RAN="<what you ran>" posts local-ci and fills "Local verification" with that statement and the head SHA. Never edit that section by hand. The Local verification check, make pr-merge and the staging gate refuse the PR while it is missing, names another head, or differs from what local-ci attested. A new push or rebase needs a new attestation. A reported failure (FAILED=) is final for that head: fix it in a new commit (docs/CI.md, "Local verification").

Problem

make pr-merge merged a head that was behind main whenever GitHub could apply it cleanly. GitHub then squashed it into a tree nobody had built: the base's newer commits plus the PR. That is how two green PRs broke sparkrack's main. #50 merged first; then #49, whose head lacked #50, removed server.ManualPayments and changed NewBuybackService, which #50 still called.

Fix

Local verification

Filled by make ci-local, 2026-10-31T17:56:04Z. Never edit this section by hand.

Head b49322600ff9aa9713402e41f116f33ffcfd65bf · tree ef8dba7f9f76 · passed
Attested by JJ Eaton on MacBook-Pro-3.local

Ran: make ci on this exact head in a 4 vCPU Davit box (passed); go test ./scripts/cilocal/... (verify 100% coverage), golangci-lint on scripts/cilocal; the real sparkrack #49/#50 reproduction against GitHub's compare (behind_by=1, Decide refuses; merged tree fails go build); make secret-scan.

🤖 Generated with Claude Code

make pr-merge merged a head behind main when GitHub could apply it
cleanly, squashing a tree nobody had built (the base's newer commits plus
the PR). That is how two green PRs broke sparkrack's main: #50 merged,
then #49, whose head lacked #50, removed a function #50 still called.

verify.Decide now refuses a head behind its base (Pull.Behind, from
GitHub's compare) with "rebase onto origin/main and re-attest". The merge
reads the base once more right before gh pr merge. On the real case (base
5210400 = #50's squash, #49's head b8fa04f) compare gives behind_by=1 and
Decide refuses. docs/CI.md and the github-prs skill say so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jayleaton
jayleaton merged commit 3d558d6 into main Oct 31, 2026
4 checks passed
@jayleaton

Copy link
Copy Markdown
Owner Author

Authorized by JJ, merged by Claude (Opus 5.5, Doug) with --admin after make ci-local attested b493226

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