Repository navigation
Conversation
Observing a path that is not a git checkout (for example actions/checkout with path: while the Action observes the workspace) refuses with no non-interference evidence. worktreeUnchanged is false there, which the console line, the job summary and the Action's PR comment all read as 'the working tree changed - report this'. Warn only when evidence shows a difference or goes missing; worktreeUnchanged itself is unchanged, so such a run still never narrows. Fixes DiffCI#278 Signed-off-by: FredApps <[email protected]>
Contributor
Author
|
CI note: Merge gate smoke failed on this PR for a reason unrelated to the change. It's the existing
I'm re-running CI with an empty commit. |
…#192) Signed-off-by: FredApps <[email protected]>
…-depth Observing a directory that is not a git checkout refused with the 'add fetch-depth: 0' hint, which no history depth fixes. Before the shallow-history fetch, check whether the path is a work tree at all and, if not, name the setting that points DiffCI at the checkout: the Action's repository-path (the checkout step's path:), the Azure task's repositoryPath, or --repo. Real shallow clones keep their deepen hints. Refs DiffCI#278 Signed-off-by: FredApps <[email protected]>
FredApps
marked this pull request as ready for review
November 18, 2026 00:55
adityankale190895
pushed a commit
that referenced
this pull request
Nov 18, 2026
#283) A path that is not a git checkout was reported as "worktree CHANGED" and pointed at fetch-depth. It now says the path is not a git checkout and names repository-path. Only git's own "not a git repository" counts: dubious ownership or a missing git binary keep the earlier reason. Fixes #278. Signed-off-by: FredApps <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Member
|
Merged to main as adc64c9 (squashed, authorship kept). One change on top: only git's own |
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 #278
When the observed path is not a git checkout,
observe()refuses with no non-interference evidence andworktreeUnchanged: false. Three places read that as "the working tree changed - report this":cli.ts)job-summary.ts)action/impact.mjs)With the Action this happens on any job that checks out with
path:and keeps the defaultrepository-path.Change
A new
worktreeChangeSuspected(evidence)inreport.tsreturns true only when a before/after pair differs or captured evidence goes missing. With no evidence at all there was nothing to change.impact.mjsgets the same check inline, because it ships without dependencies.The console line now says
worktree not a git checkout, nothing to comparein that case. The job summary and the PR comment no longer show the warning.worktreeUnchangedand narrowing are untouched. An unproven run still never narrows; there's an assertion for that in the new test.Refusal hint (add3cc5): a path that isn't a git checkout used to refuse with "add
fetch-depth: 0", which no history depth can fix.resolveCommitRangeFetchingHistorynow checksgit rev-parse --is-inside-work-treefirst. When the path isn't a work tree, it saysthis path is not a git checkout:and names the setting that points DiffCI at the checkout:repository-path, i.e. the checkout step'spath:repositoryPath--repoReal shallow clones keep their
fetch-depth: 0,GIT_DEPTHandfetchDepthhints; the existing shallow-history and context tests still pass.Tests (fail on
main, pass here):tests/action-impact.test.ts: a refused report with no evidence gets no warning in the comment. HEAD moved, or evidence lost, still gets the warning.packages/diffci-cli/tests/client/job-summary.test.ts: same for the job summary.packages/diffci-cli/tests/client/observe.test.ts: a realobserve()on a non-git temp directory returns REFUSED withworktreeUnchangedfalse, nothing suspected and no summary warning. It also asserts the reason says "not a git checkout" and doesn't mention fetch-depth. Also unit cases for the helper.packages/diffci-cli/tests/client/shallow-history.test.ts› "points a path that is not a git checkout at repository-path, not fetch-depth": real git on a non-checkout temp dir, covering a GitHub pull_request event, Azure and local.Local results
npm run typecheck,npm test(1168 pass),npm run buildandnpm run audit:boundaryall pass.packages/diffci-cli: typecheck and build pass.npm testgives 521 pass and 2 fail. Both failures also happen onmainand are already filed: CLI tests: cli-agent.test.ts expects the old verify usage line and fails on main #193 (cli-agent verify usage line) and CLI tests: the init --install test looks for npm-cli.js under npm's global prefix #196 (npm-cli.js lookup). This PR doesn't touch them.