chore(#111): upgrade pre-push-gate from advisory reminder to blocking check-runner#121
Merged
Merged
Conversation
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
Upgrades
pre-push-gate.shfrom an advisory reminder (prints a checklist and exits 0) to a blocking check-runner (reads a configured list of shell commands, executes them, blocks on red with exit 2).The rule in
.claude/rules/pr-workflow.md § Before git push (HARD STOP)has always said "Never push without running CI checks locally." The old hook printed a reminder, so the mechanical enforcement didn't actually match the written rule. This PR closes that asymmetry..pre_push.commandsfrom project config (shared reader from [Chore] Make ticket-prefix whitelist + schema project-configurable (not hardcoded) #109) and runs each entry'srunfield in sequence.<!-- pre-push: skip -->in the HEAD commit message. Grep-able on purpose so bypasses are auditable.Changed files:
.claude/hooks/pre-push-gate.sh— rewritten.claude/hooks/tests/test_pre_push_gate.sh— new, 7 cases.claude/project-config.defaults.json— addedpre_push.commandssubtree (empty by default)docs/rule-audit.md— flipped "Before git push" rule from "partial" to "yes" + updated the footnoteTesting
Also dogfood: this very PR was pushed through the upgraded hook. Since the framework repo has no configured
.pre_push.commandsin its defaults file, the gate exits 0 silently — proving the "empty-commands-noop" path works end-to-end against the apexyard repo itself.What a per-fork override looks like
Minimal example in a fork's
.claude/project-config.json:{ "pre_push": { "commands": [ { "name": "lint", "run": "npm run lint" }, { "name": "typecheck", "run": "npm run typecheck" }, { "name": "test", "run": "npm run test" }, { "name": "build", "run": "npm run build" } ] } }Teams on yarn, pnpm, make, cargo, go, mix and so on all configure here — the hook doesn't care about the package manager. The command runs in a sub-shell rooted at the repo top-level.
Scope — what this does NOT do
parallel: trueflag in a follow-up.pre-push-gate.sh's matcher wiring in.claude/settings.json— same matcher, new behaviour.Follow-ups
run_if_exists: "package.json"to skip on repos without that file).commit_typeskey invalidate-commit-format.sh(noted in AgDR-0006 as a deferred item).Glossary
Bashcommands matchinggit push. Enforces the HARD STOP rule that local checks must pass before pushing.Closes #111