chore: add React Doctor advisory scanning - #23
Conversation
Integrate React Doctor for React security and performance scanning in advisory mode: SHA-pinned GitHub Actions workflow, local doctor script, and CONTRIBUTING docs. Closes #5 (Phase A).
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughSummary by CodeRabbit
WalkthroughAdds a local React Doctor command, documents its scope and usage, and adds a React Doctor workflow plus a checkout credential change in CI. ChangesReact Doctor rollout
Sequence Diagram(s)sequenceDiagram
participant PullRequest
participant GitHubActionsWorkflow as GitHub Actions workflow
participant RepositoryCheckout as actions/checkout
participant ReactDoctor as millionco/react-doctor@v2
PullRequest->>GitHubActionsWorkflow: trigger pull_request or push to main
GitHubActionsWorkflow->>RepositoryCheckout: check out the repository
GitHubActionsWorkflow->>ReactDoctor: run with project package,example, blocking none, scope full
ReactDoctor-->>GitHubActionsWorkflow: report findings and health score
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Comment |
|
React Doctor found 6 issues in 6 files · 6 warnings · score 87 / 100 (Great) · full project 6 warnings
Reviewed by React Doctor for commit |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
package.json (1)
15-15: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick winAvoid a moving
@latesttarget in the script.
bun run doctorwill fetch whatever React Doctor happens to be current on npm each time, so local scans can drift from CI and break without a repo change. Pin the version or install it as a devDependency if that drift is not intentional.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@package.json` at line 15, The doctor script currently points at a moving npx react-doctor@latest target, which can make local and CI behavior diverge. Update the package.json doctor entry to use a pinned React Doctor version or switch to a devDependency-backed invocation so the script resolves the same tool version consistently. Locate the change in the doctor script definition and keep the command stable rather than relying on `@latest`.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/react-doctor.yml:
- Around line 23-29: The Checkout step in the React Doctor workflow is still
persisting Git credentials, which leaves the GITHUB_TOKEN in .git/config for the
later third-party action to access. Update the actions/checkout configuration to
disable credential persistence by setting persist-credentials to false in the
Checkout step. Use the existing Checkout and React Doctor job steps as the
location reference.
---
Nitpick comments:
In `@package.json`:
- Line 15: The doctor script currently points at a moving npx
react-doctor@latest target, which can make local and CI behavior diverge. Update
the package.json doctor entry to use a pinned React Doctor version or switch to
a devDependency-backed invocation so the script resolves the same tool version
consistently. Locate the change in the doctor script definition and keep the
command stable rather than relying on `@latest`.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: e5539ec7-57be-4bc4-b559-6b71b6e0f2da
📒 Files selected for processing (3)
.github/workflows/react-doctor.ymlCONTRIBUTING.mdpackage.json
piotr-graczyk-dev
left a comment
There was a problem hiding this comment.
Approved in CodeRabbit Change Stack
Summary
.github/workflows/react-doctor.ymlin advisory mode (blocking: none,scope: full)package/andexample/bun run doctorscript (npx react-doctor@latest)CONTRIBUTING.mdCloses #5 (Phase A only — enforcement and branch protection deferred).
Baseline (local advisory scan)
Initial full scan before merge (React Doctor v0.5.8):
react-native-nitro-maps(package/)react-native-nitro-maps-example(example/)Share link: https://react.doctor/share?p=react-native-nitro-maps&s=88&w=5&f=5
CI will confirm these numbers on the first workflow run. Follow-up work (Phase B): remove
blocking/scopeoverrides and address or explicitly accept baseline findings.Test plan
bun run doctorruns successfully from monorepo rootpackage,examplewithfetch-depth: 0Made with Cursor