Skip to content

Scan web/ directly in React Doctor - #291

Merged
arjunkomath merged 1 commit into
mainfrom
fix/react-doctor-scan-directory
Aug 10, 2026
Merged

Scan web/ directly in React Doctor#291
arjunkomath merged 1 commit into
mainfrom
fix/react-doctor-scan-directory

Conversation

@arjunkomath

Copy link
Copy Markdown
Member

Every React Doctor PR comment has been carrying a "⚠️ .github/workflows/react-doctor.yml is configured incorrectly — add fetch-depth: 0" warning. fetch-depth: 0 was already set (added in cebfeed); the warning is a false positive.

Cause

The action ran with the default directory: .. Reproduced locally against a full clone, same commits and same 4 changed files:

Invocation Result
react-doctor . --project '*' --scope changed mode: "diff", baselineDegraded: true
react-doctor ./web --project '*' --scope changed mode: "baseline", delta computed

There is no root package.json — the Next.js app is in web/. Project discovery from the root still finds it (framework: nextjs), which is why full-scope push runs report findings normally. But the baseline diff plan is computed at the repo root and re-resolved per project, and that remapping does not survive the root→web hop, so no delta is ever produced. baselineDegraded then trips and the renderer unconditionally attributes it to a shallow checkout.

Effect: PRs #286, #288 and #289 all reported every issue in the changed files rather than only the ones they introduced.

Fix

Set directory: web. The action’s normalize-changed-files.mjs strips the directory prefix from the PR’s changed-file list, so paths line up automatically. Push-to-main runs now full-scan web/ only, matching the paths: filter the workflow already uses.

Verification

This PR touches no files under web/, so React Doctor will report "skipped" here rather than exercising the baseline path — the next PR that changes web/ is the real confirmation.

🤖 Generated with Claude Code

Running the action from the repo root discovered the `web` project but
never resolved the root-level baseline diff plan against it, so every PR
reported `baselineDegraded` and listed pre-existing issues as new — along
with a bogus "add fetch-depth: 0" warning that was already set.

Co-Authored-By: Claude Opus 5 <[email protected]>
@arjunkomath
arjunkomath added this pull request to the merge queue Aug 10, 2026
Merged via the queue into main with commit 1ca7364 Aug 10, 2026
7 checks passed
@arjunkomath
arjunkomath deleted the fix/react-doctor-scan-directory branch August 10, 2026 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant