Repository navigation
fix: resolve .commit-info.json info/exclude path against the checkout - #37
Merged
Merged
Conversation
Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Research Review
Verified
git rev-parse --git-pathis relative to the-Cdirectory, not the caller's cwd. I reproduced this: running the old entrypoint'swrite_commit_infofrom a cwd outside the repo leaves?? .commit-info.jsoningit status, a count != 1 for the exclude entry, and a stray.gitin the caller cwd. The fix iscase "$excl" in /*) ;; *) excl="$repo_dir/$excl" ;; esacinscripts/docker-entrypoint.sh. It handles both absolute output (worktrees/linked gitdirs) and relative output.- Test reproduced locally with git 2.39.5: on the PR head all 6 checks pass. Against
origin/main's entrypoint (viaENTRYPOINT_OVERRIDE) exactly 3 checks fail, as the PR body states. - Sibling consistency: the fix matches the web-runner#74 diff line for line (same comment, same
case), and the test is the same shape. - "Only place that writes
.commit-info.json" confirmed by grep: onlyscripts/docker-entrypoint.shand the new test reference it.
Adjacent Stubs Detected
- Swept
scripts/docker-entrypoint.sh: only|| trueguards on best-effort cleanup/reads (lines 136, 176-178, 218, 237). None is on the path this PR touches in a way that erases input. Nothing blocks merge.
Orphaned Files Detected
- None. The test is a standalone script and the entrypoint is the Docker entry point.
Escape Hatch Coverage
- No new terminal-rejection branch (no
exit/throw/4xx added).
Object Shape Verification
- No spread or re-serialisation of fetched objects.
Contract diff
- No request handler or timeout changed. Files checked:
scripts/docker-entrypoint.sh(shell functionwrite_commit_info) andtests/test-entrypoint-commit-info-exclude.sh. The.commit-info.jsoncontent is unchanged. The only behavioural change is where the exclude line is appended, which is now$repo_dir/.git/info/exclude.
Impact Analysis
- Blast radius: container start-up of python-runner only, in
write_commit_info. - Downstream consumers: none in other repos for this function. web-runner already carries the same fix.
- Coordinated changes needed: none identified.
- Breaking change risk: low. Before the fix the append went to a path relative to
/runner, i.e. outside the checkout. Existing PVC-cached checkouts just gain the missing exclude line on next start.
Risks Not Tested
- Real container start-up on OSC was not exercised. I only exercised the extracted function in a bash harness.
- The repo reports no CI checks on this branch, so the new test is not wired into automation. It passes only when run by hand, and I ran it locally.
evalof the extracted function in the test relies on the function body ending at the first^}line. This holds today.
Research Suggestions
- Optional: wire
tests/test-entrypoint-commit-info-exclude.shinto a CI workflow so the regression stays covered.
Verdict
No blocking issues found.
Reviewed by PR Research Validator. This review checks whether code is based on verified sources rather than assumptions.
3 tasks
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.
Fixes the
.commit-info.jsonexclude entry landing in the wrong place.git -C "$repo_dir" rev-parse --git-path info/excludeprints a path relative to$repo_dir, but the entrypoint runs from/runner, so the append never reached/usercontent/.git/info/exclude. The path is now made absolute against$repo_dirbeforemkdir -pand append (same approach as Eyevinn/web-runner#74).exclis also nowlocal.write_commit_infois the only place in this repo that writes.commit-info.jsonor sets the exclude, so there are no sibling paths.Added
tests/test-entrypoint-commit-info-exclude.sh. It extracts the real function and calls it twice from a cwd that is not the repo. Against the old entrypoint it fails 3 checks (?? .commit-info.jsonin status, exclude count, stray.gitin the cwd). Against the fix it passes all checks. No tracked file is touched and no commit is created.Closes #36
Lessons
git path-printing commands (
--git-path) are relative to-C, not to the caller's cwd. The old code looked fine when run from inside the repo, so only a test that calls from another cwd catches it.What a human does next: Nothing.
Co-Authored-By: Claude noreply@anthropic.com
🤖 Generated with Claude Code