Skip to content

ci(frontend): add react-doctor check for landing site#151

Merged
harshitsinghbhandari merged 3 commits into
mainfrom
session/aa-71
Jun 7, 2026
Merged

ci(frontend): add react-doctor check for landing site#151
harshitsinghbhandari merged 3 commits into
mainfrom
session/aa-71

Conversation

@harshitsinghbhandari

Copy link
Copy Markdown
Collaborator

Summary

Adds a CI job that runs react-doctor against the Next.js 15 + React 19 landing site at `frontend/src/landing/`.

Why it earns its place

  • Real React surface, no current lint. `frontend/src/landing/` has 29 `.tsx` components (Next.js 15 + React 19 + fumadocs). There is no ESLint config there, and the only frontend-related CI today is the `schema.ts` drift check in `go.yml`. React Doctor produces signal that nothing else in this repo catches: state-and-effects bugs, perf footguns, a11y, and security rules tailored for React/Next.js.
  • Actively maintained, MIT, no auth, fast. v0.4.0 published 2026-06-06, commits today, MIT-licensed, no API keys, runs in ~5s on this codebase via oxlint.
  • Non-disruptive baseline. Default `--blocking=error` surfaces findings without failing CI on warnings. Current state: 0 errors, 58 warnings (24 bugs, 11 perf, 5 a11y, 1 security, 17 maintainability). The check is green on day one; the warning backlog can be triaged separately, and we can tighten to `--blocking warning` later.
  • Telemetry off. `--no-telemetry` keeps CI runners from pinging react.doctor.

What triggers it

Pull requests that touch `frontend/src/landing/**` or the workflow file itself; also pushes to `main`. Backend-only PRs do not pay for this check.

Example output (current main)

```
React Doctor v0.4.0

All 58 issues

Security › 1 warning
Bugs › 24 warnings
Performance › 11 warnings
Accessibility › 5 warnings
Maintainability › 17 warnings
```

Files

  • `.github/workflows/react-doctor.yml` — new workflow, path-filtered.
  • `frontend/src/landing/package.json` — adds `react-doctor` devDep and `doctor` script.
  • `frontend/src/landing/package-lock.json` — refreshed via `npm install`.

Test plan

  • CI `React Doctor / doctor` job is green.
  • Existing `Go`, `CLI E2E`, and `gitleaks` jobs unaffected.
  • Locally: `cd frontend/src/landing && npm ci && npm run doctor` exits 0.

🤖 Generated with Claude Code

Adds a CI job that runs react-doctor (https://github.com/millionco/react-doctor)
against the Next.js 15 + React 19 landing site at frontend/src/landing/.
The landing has 29 .tsx components and no existing lint coverage; the only
prior frontend CI was a schema.ts drift check in go.yml.

- New workflow .github/workflows/react-doctor.yml, path-filtered to
  frontend/src/landing/** so backend-only PRs don't pay for it.
- doctor script + react-doctor devDep added to the landing package.
- Default --blocking=error: surfaces security, bugs, perf, a11y, and
  maintainability findings without failing CI on existing warnings
  (current baseline: 0 errors, 58 warnings, ~5s locally).
- Runs with --no-telemetry so CI runners don't ping react.doctor.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds a new GitHub Actions workflow that runs the react-doctor composite action against the Next.js 15 + React 19 landing site at frontend/src/landing/, path-filtered to fire only when landing-site files or the workflow itself change.

  • New workflow (.github/workflows/react-doctor.yml): triggers on push to main (path-filtered) and on pull_request; runs millionco/react-doctor@v2 with pull-requests: write and statuses: write to post inline annotations and a sticky PR comment.
  • Action pinning: the action is referenced via the mutable floating tag @v2 while holding write permissions; the upstream docs explicitly recommend SHA pinning in this case to guard against supply-chain risk.
  • Checkout version: actions/checkout@v4 is used, whereas the react-doctor v2 migration guide calls for @v5 with a deeper checkout for accurate diff-scoped scanning.

Confidence Score: 4/5

Safe to merge after pinning the action to a commit SHA — the workflow logic is correct and path-filtering works as intended.

The workflow grants pull-requests: write and statuses: write to a third-party composite action referenced only by the mutable floating tag @v2. If that tag is ever moved to a different commit, arbitrary code runs with write access to PR comments and commit statuses. Pinning to the current SHA resolves this; everything else in the workflow is straightforward.

.github/workflows/react-doctor.yml — specifically the millionco/react-doctor@v2 step which should be pinned to a full commit SHA.

Security Review

  • Supply chain risk via mutable action tag (.github/workflows/react-doctor.yml line 30): millionco/react-doctor@v2 is a floating tag. Because the job holds pull-requests: write and statuses: write, any future movement of that tag — malicious or accidental — could execute arbitrary code with write access to PRs and commit statuses. The upstream docs explicitly recommend SHA pinning in this scenario.

Important Files Changed

Filename Overview
.github/workflows/react-doctor.yml New CI workflow that runs the react-doctor composite action; uses a mutable floating tag (@v2) while holding pull-requests: write and statuses: write, which the upstream docs flag as requiring SHA pinning.

Reviews (3): Last reviewed commit: "ci(frontend): use react-doctor GitHub Ac..." | Re-trigger Greptile

Comment thread .github/workflows/react-doctor.yml
harshitsinghbhandari and others added 2 commits June 7, 2026 03:51
Mirrors the PR path filter on push to main so backend-only merges don't
re-run the landing check. Unlike go.yml/cli-e2e.yml (which trigger on
broad path sets), this workflow only cares about frontend/src/landing/.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…churn

Replaces the npm install + npm run doctor approach with the official
millionco/react-doctor@v2 composite action. The action manages its own
Node setup and react-doctor install on the runner, so the landing
package.json and lockfile stay untouched (no transitive-dep bloat from
react-doctor's 479-package tree).

The action also wires up sticky PR summary comments, inline review
comments, and commit statuses out of the box — requires pull-requests
and statuses write perms.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

No React Doctor issues found. 🎉

Reviewed by React Doctor for commit 9d33710.

@harshitsinghbhandari harshitsinghbhandari merged commit c7e3a03 into main Jun 7, 2026
2 checks passed
# and publishes a commit status. Default blocking=error means only
# error-severity findings fail the job; warnings are reported but don't
# block.
- uses: millionco/react-doctor@v2

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 security Unpinned mutable action tag with write permissions

millionco/react-doctor@v2 is a floating tag; if the upstream repo moves that tag to a new commit (accidentally or due to a supply-chain compromise), arbitrary code will run with pull-requests: write and statuses: write on every triggered workflow. The react-doctor docs explicitly call out this exact scenario: "For hardened CI — recommended whenever the workflow is granted pull-requests: write — pin to a full commit SHA instead and let Dependabot or Renovate keep it current." Pinning to the SHA of the current v2 head and adding a Dependabot/Renovate entry for the action removes the risk while keeping the version current.

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