Repository navigation
Require gitPullRequest's environment and drop a duplicate restore-name test - #509
Merged
Merged
Conversation
pondorasti
force-pushed
the
codevisor/test-audit-core-pkgs-3
branch
from
October 14, 2026 19:22
7ef2d2e to
04bf6da
Compare
…e test The only production caller of gitPullRequest always passes the server's environment, so the process.env fallback ran only in a test. The pure chooseRestoreName exhaustion test repeated the restoreWorktree exhaustion test, which also asserts the user-facing error. The surviving gh test now checks that gh runs with prompts disabled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pondorasti
force-pushed
the
codevisor/test-audit-core-pkgs-3
branch
from
October 14, 2026 19:26
04bf6da to
3a40902
Compare
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
A test audit of
packages/worktrees, rebased onto the comment-free main.Removed:
process.envfallback ingitPullRequest(dir, env?), and its test "uses the process environment when none is given".cachedPullRequestinapps/server/src/routes/git-review.ts:61, always passes the server'senv. That means the fallback branch ran only in this test, which had to stubPATHto reach it.envis now required ongitPullRequestand on its privateghhelper.chooseRestoreName"gives up rather than looping forever when the space is exhausted".-2…-99taken set as therestoreWorktreeboundary test "fails loudly rather than restoring under an unrelated name".Strengthened:
ghtest. It now checks thatghruns withGH_PROMPT_DISABLED=1on top of the caller's environment. I confirmed it fails when that variable is dropped. Without the check, a regression could leaveghblocked on an auth prompt.Candidate evidence
gitPullRequestenv fallbackgit-review.ts:61passesenv??branch is gonechooseRestoreNameexhaustion testrestoreWorktree name exhaustionRetained false positives
chooseRestoreName"prefers the original name and falls back to readable suffixes", and the export it needs.-3case (original and-2both taken) is the only check that the suffix search moves past-2. Code review pointed this out.git.test.ts"resolves no start point for a repo without an origin/main ref".Code review
The review found no bugs in this diff. Two of its findings were pre-existing bugs in
restoreWorktree:worktreeStartPointwithoutenv.env.Those go in a separate PR at the owner. I didn't take the suggestion to keep
envoptional for consistency with siblings: a test-only default is exactly what this audit removes.Validation
bun run checkranformat:check,lint,comments:check,ratchet:check, and boundaries, plus typecheck and coverage for worktrees and everything that depends on it, including the server. All passed.git diff --checkpassed.LOC (
git diff --numstat)git-pull-request.ts)🤖 Generated with Claude Code