chore(devex): install a make check pre-push hook via make setup (backend#1606) - #657
Merged
Conversation
…end#1606) Step 4 of backend#1606, fanned out to client. `make setup` now installs a git pre-push hook that runs `make check`, factored into a standalone, independently runnable `install-hooks` target. Mirrors the merged reference e2e-test-agent#46. Honest by construction: the hook catches forgetting, not defiance (`git push --no-verify` always skips it); it declines to clobber a foreign pre-push hook rather than stomping it; and it resolves the hooks dir via `git rev-parse --git-path hooks` so it is worktree/submodule-safe. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…(backend#1606) The copied block said 'need not rebuild the (minutes-long) venv', which is false for cli (Go) and client (tool-check only) and loose elsewhere. Generalise to 'need not rerun the full make setup' — true in every repo. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…urvives worktrees (backend#1606) Git exports GIT_DIR/GIT_WORK_TREE/etc into hook processes; a nested git (e.g. Go buildvcs under go test) then fails with 'exit status 128' in a linked worktree. The generated hook now unsets those before exec make check. Uniform with the fix on cli#482 (the Go repo where it actually bites); harmless in normal clones. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…eport false success (backend#1606) Bugbot (Low) on cli#482: the install steps were ';'-chained, so a failed printf or chmod still exited 0 and printed 'installed'. Git skips a non-executable hook, so make setup could look green while no hook runs. Chain with '&&' so any failure fails the recipe. Uniform across the fleet. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
aptracebloc
approved these changes
Aug 11, 2026
aptracebloc
left a comment
Contributor
There was a problem hiding this comment.
@LukasWodka — Approved. Verified the hook behavior end-to-end on GNU Make 3.81 / macOS (the portability floor).
make install-hookswrites an executable.git/hooks/pre-pushrunningmake check;make setupwires it in.- Clobber-safe: with a foreign pre-push hook present, the target declines and leaves it byte-for-byte untouched (marker-based detection); idempotent over its own hook.
- Degrades gracefully outside a checkout (
exit 0);--no-verifyescape hatch documented in the hook,setup,help, and header. - Failure propagates: forced an unwritable hooks dir →
make Error, no false "installed" (the earlier;→&&Bugbot fix, confirmed working). No unresolved Bugbot findings; rootMakefileisn't code-owned.
Two Low nits only (marker substring-match could false-positive a hook literally containing the marker text; hook assumes make on PATH at push time) — neither worth changing.
🤖 Generated with Claude Code
LukasWodka
added a commit
that referenced
this pull request
Aug 11, 2026
… PR trigger (backend#1681) (#665) `Source-of-truth drift` is a REQUIRED status check on develop and on main, but `drift-checks.yaml` only fires on PRs touching scripts/, client/ or itself. A PR outside those paths therefore never produces the check, GitHub leaves it at "Expected - waiting for status to be reported", and the PR is unmergeable with no failing check to point at. Measured on 2026-08-11 this was blocking three open PRs at once - client#651 (org-standards sync), #657 (Makefile) and #660 (docs) - none of which touch the filtered paths. Two of the three had already been approved. `pull_request` loses its paths filter so the required check always reports. The job is ~10s (measured across its last three runs), which is nothing next to a permanently stuck PR. `push` keeps its filter: pushes are not gated by required checks, so path-scoping there is free and correct. The repo already documents this hazard in standard-checks.yml's header; this is the same rule applied to the workflow that broke it. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
4 tasks
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
Step 4 of #1606, fanned out to client.
make setupnow installs a git pre-push hook that runsmake check; factored into a standaloneinstall-hookstarget. Mirrors the merged reference e2e-test-agent#46.Design (honest by construction)
git push --no-verifyalways skips it.git rev-parse --git-path hooks.Test plan
Mirrors #46 (verified end-to-end there). Here:
make -n install-hooksandmake helpparse cleanly.Parent epic: #1680.
Note
Low Risk
Makefile-only developer workflow change; no runtime, auth, or deployment behavior is affected.
Overview
make setupnow installs a git pre-push hook that runsmake check, so fast lint/drift/helm checks run before pushes without relying on contributor memory.A new
install-hookstarget writes the hook (also invoked fromsetup). The hook is worktree/submodule-safe viagit rev-parse --git-path hooks, refuses to overwrite an existing non-tracebloc pre-push hook, and unsetsGIT_*env vars in the hook so nested git (e.g. Go buildvcs) does not fail in linked worktrees.helpand header comments documentinstall-hooksandgit push --no-verifyas the escape hatch.Reviewed by Cursor Bugbot for commit ce2dbbd. Bugbot is set up for automated code reviews on this repo. Configure here.