test: make local unit runs truthful#1048
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 95a494c936
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| install_git_hooks() { | ||
| if [[ ! -d "$ROOT_DIR/.git" ]]; then | ||
| if ! (cd "$ROOT_DIR" && git rev-parse --is-inside-work-tree >/dev/null 2>&1); then |
There was a problem hiding this comment.
Avoid installing hooks into an enclosing repository
When init.sh is run from a source tree nested inside another Git worktree but not itself a checkout, this broader git rev-parse --is-inside-work-tree check succeeds for the parent repo. The later git config core.hooksPath .githooks then writes to that parent repository's config, hijacking its hooks path instead of skipping hook installation for this non-checkout; verify the Git top-level is ROOT_DIR (or that $ROOT_DIR/.git exists as a file or directory) before configuring hooks.
Useful? React with 👍 / 👎.
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
Why
Closes #1042. Parent epic: #1041.
The protected path is a developer or coding agent running the standard local unit command from a fresh checkout or linked worktree. Before this change, missing dependencies looked like hundreds of product failures, contract tests could be discovered and skip inside the unit lane, local and CI Bun versions drifted, and init.sh silently skipped hook installation in linked worktrees.
What changed
Out of scope
How it was verified
Red evidence
Blocked setup evidence
Green deterministic evidence
Full local integration evidence
Evidence quality
Deterministic unit coverage plus a real temporary Git linked-worktree regression fixture, a dependency-free blocked-path run, the complete local isolated suite, repo-level CI, and a CI-style Next build. Hosted GitHub CI and reviewer checks are pending on this PR.
Risk and rollback
This changes developer and CI tooling only; there is no application runtime, database, migration, or deploy-state mutation. The main compatibility risk is the Bun 1.3.14 upgrade across CI and smoke workflows. The full local suite and production-style build passed on that exact version. Roll back the runner, packageManager, and workflow pin changes together so parity remains invariant.
The lane now excludes directories named contract, integration, or journey. Tests for implementation modules whose filenames contain those words still run; only directory boundaries are excluded.
Reviewer guide
Start with scripts/testing/isolated-runner.ts and its focused tests. Then review the init.sh fixture, the package/workflow pin alignment, and the small packages/agent/tools/tools.test.ts timing cleanup. Workflow and documentation edits are mechanical parity updates.