Skip to content

fix: serialize pre-push hook to avoid dist/ race#218

Merged
nahiyankhan merged 1 commit into
mainfrom
fix/serialize-pre-push-hook
Jul 9, 2026
Merged

fix: serialize pre-push hook to avoid dist/ race#218
nahiyankhan merged 1 commit into
mainfrom
fix/serialize-pre-push-hook

Conversation

@nahiyankhan

Copy link
Copy Markdown
Collaborator

Category: infrastructure
User Impact: Contributors no longer hit flaky pre-push failures caused by parallel hook commands racing on build output.
Problem: The pre-push hook ran check, test, and build with parallel: true. Both just check (via check:packed-package) and just build rebuild packages/ghost/dist while just test runs CLI tests against dist/bin.js, so pushes failed flakily on tests that pass in isolation. This bit during the docs pass in #216, which had to push with --no-verify.
Solution: Replace the three parallel commands with one serial just ci (check → test → build, already defined in the justfile), with a comment explaining why serial is deliberate.

Validation:

  • git push: pre-push hook ran the serialized just ci end to end and passed (this branch's own push)
  • pre-commit hook (check + test): passed on commit

Changeset: not needed — repo hook config only; nothing ships through @design-intelligence/ghost.

Ghost Review:

  • ghost check / ghost review: not run — no fingerprint-claimed surface touched.
File changes

lefthook.yml
Pre-push: drop parallel: true and the three separate commands; run just ci serially. Comment documents the dist/ race so nobody re-parallelizes it later.

Screenshots/Demos: N/A

The parallel pre-push commands raced: 'just check' (via check:packed-package)
and 'just build' both rebuild packages/ghost/dist while 'just test' runs CLI
tests against dist/bin.js, failing flakily. Run 'just ci' (check, test, build
in order) instead.
@nahiyankhan nahiyankhan marked this pull request as ready for review July 9, 2026 17:06
@nahiyankhan nahiyankhan merged commit 319024b into main Jul 9, 2026
5 checks passed
@nahiyankhan nahiyankhan deleted the fix/serialize-pre-push-hook branch July 9, 2026 17:06
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