You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
--scope changed degrades to a plain diff (mode: "diff", baselineDegraded: true) whenever the change set contains a deleted source file. The history is complete and the merge-base resolves, yet the GitHub Action comment says the checkout is shallow and asks for fetch-depth: 0, which is already set.
Locally: macOS, Node 22.22.0, git 2.52.0, full clone
Project: TanStack Start app inside a pnpm monorepo (the scanned directory is a subdirectory of the repo)
Repro
PR with four commits; the first one deletes a .tsx component file and edits a handful of other .tsx and locale .json files. <base> is the PR's base commit (merge-base with HEAD is <base> itself, verified with git merge-base).
base = first PR commit (deletion no longer in the diff)
baseline
–
base = PR base, deleted file staged back (git checkout <base> -- <file>)
baseline
–
base = PR base, every other change of the first commit reverted, deletion kept
diff
true
Reverting the locale JSON edits or the other .tsx edits changes nothing; only the deletion flips the result. Note that restoring the file as an untracked copy is not enough, git diff <base> still reports D for it, which is what the baseline planner reads.
What the action reports
⚠️ Warning: .github/workflows/<workflow>.yml is configured incorrectly.
React Doctor compares against `<base branch>` to report only the issues this pull request introduces.
This run couldn't complete that comparison (usually a shallow CI checkout with no merge base) …
Add `fetch-depth: 0` to the `actions/checkout` step …
In the same run the action's own base step fetched the base SHA and derived the changed files with git diff <base>...HEAD without falling back to the API, so the base is reachable. Earlier PRs on the same repo and workflow (no deletions) got mode: "baseline".
Expected
A deleted file should not prevent the baseline delta. The file's base diagnostics can simply count as fixed; there is nothing to compare at head.
runBaselineComparison returns null in several places without a reason surfacing anywhere (materializeBaselineFiles → null, !snapshot.isComplete, unanalyzed expected head files, base lint failure). parseBaselineDiffPlan puts D entries into baseFiles, so the deleted file is materialised and linted at base; one of the later checks then drops the whole delta. I could not tell which one from the outside, --verbose prints nothing about it. A debug line naming the failing check would make this diagnosable.
Summary
--scope changeddegrades to a plain diff (mode: "diff",baselineDegraded: true) whenever the change set contains a deleted source file. The history is complete and the merge-base resolves, yet the GitHub Action comment says the checkout is shallow and asks forfetch-depth: 0, which is already set.Environment
millionco/react-doctor@v2,directory: <subdir>,scope: changed,actions/checkout@v5withfetch-depth: 0Repro
PR with four commits; the first one deletes a
.tsxcomponent file and edits a handful of other.tsxand locale.jsonfiles.<base>is the PR's base commit (merge-base with HEAD is<base>itself, verified withgit merge-base).Isolating the trigger:
modebaselineDegradeddifftruedifftruebaselinegit checkout <base> -- <file>)baselinedifftrueReverting the locale JSON edits or the other
.tsxedits changes nothing; only the deletion flips the result. Note that restoring the file as an untracked copy is not enough,git diff <base>still reportsDfor it, which is what the baseline planner reads.What the action reports
In the same run the action's own
basestep fetched the base SHA and derived the changed files withgit diff <base>...HEADwithout falling back to the API, so the base is reachable. Earlier PRs on the same repo and workflow (no deletions) gotmode: "baseline".Expected
Notes from reading the source
runBaselineComparisonreturnsnullin several places without a reason surfacing anywhere (materializeBaselineFiles→null,!snapshot.isComplete, unanalyzed expected head files, base lint failure).parseBaselineDiffPlanputsDentries intobaseFiles, so the deleted file is materialised and linted at base; one of the later checks then drops the whole delta. I could not tell which one from the outside,--verboseprints nothing about it. A debug line naming the failing check would make this diagnosable.