Skip to content

fix(action): improve ensure-json-report error messages - #1332

Draft
skoshx wants to merge 4 commits into
mainfrom
cursor/triage-1331-e774
Draft

fix(action): improve ensure-json-report error messages#1332
skoshx wants to merge 4 commits into
mainfrom
cursor/triage-1331-e774

Conversation

@skoshx

@skoshx skoshx commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Problem

When the GitHub Action receives a missing, malformed, or incompatible CLI report, ensure-json-report.mjs replaces it with a generic fallback. The fallback hides whether the CLI produced no file, empty output, invalid JSON, an unsupported schema, or an incomplete report.

Solution

  • Emit a specific, actionable fallback for each failure class.
  • Keep parser details and filesystem paths out of PR-facing error text.
  • Continue accepting report schema versions 1, 2, and 3.
  • Always write the existing schema-v3 fallback shape on failure.
  • Remove the npm-package Changeset: this changes only the independently versioned GitHub Action.

Validation

  • Added 10 focused tests covering every supported schema plus missing, empty, non-JSON, non-object, unsupported-schema, and missing-ok reports.
  • Full repository tests, lint, typecheck, formatting, and JSON-report smoke test pass locally.
  • React Doctor reports 100/100 on the changed scope.

Release note

This touches scripts/ensure-json-report.mjs, so it needs a patch GitHub Action release after merge. It does not require an npm package release.

Closes #1331

@github-actions

github-actions Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

📦 GitHub Action release recommended

This PR changes the React Doctor GitHub Action's release surface:

  • scripts/ensure-json-report.mjs

The composite action is versioned independently from the npm packages, so it
needs its own git tag once this merges. Based on the PR title, this looks like
a patch bump (fix / refactor / chore / docs): v2.2.8v2.2.9.

After merging, cut the tag from the merge commit on main (tags are GPG-signed
annotated tags, so run this locally where your signing key is configured):

git checkout main && git pull --ff-only
merge_commit=$(git rev-parse HEAD)
git tag -a v2.2.9 "$merge_commit" -m "react-doctor action v2.2.9"
git tag -fa v2 "$merge_commit" -m "react-doctor action v2 (floating major -> v2.2.9)"
git push origin v2.2.9
git push --force origin v2   # moves only the floating major pointer

This bump can also be performed automatically on merge — set the repo
variable AUTO_BUMP_ACTION_TAG=true. Recommendation by the Action Version Bump workflow.

@pkg-pr-new

pkg-pr-new Bot commented Jul 16, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/eslint-plugin-react-doctor@1332
npm i https://pkg.pr.new/oxlint-plugin-react-doctor@1332
npm i https://pkg.pr.new/react-doctor@1332

commit: 0d59eb9

@aidenybai
aidenybai force-pushed the cursor/triage-1331-e774 branch from a3f23c4 to 136a3be Compare July 20, 2026 16:21
cursoragent and others added 3 commits July 20, 2026 09:26
- Add specific error messages for different failure scenarios
- Distinguish between empty reports, invalid JSON, missing schema version, unsupported schema version, and missing ok field
- Guide users to update the action when schema version mismatch occurs
- Provide actionable error messages instead of generic 'exited before producing' message

Fixes #1331

Co-authored-by: Skosh <skoshx@users.noreply.github.com>
Co-authored-by: Skosh <skoshx@users.noreply.github.com>
Co-authored-by: Skosh <skoshx@users.noreply.github.com>
@aidenybai
aidenybai force-pushed the cursor/triage-1331-e774 branch from 136a3be to 47a6a74 Compare July 20, 2026 16:26
@github-actions

Copy link
Copy Markdown
Contributor

React Doctor found no new issues. 🎉

Reviewed by React Doctor for commit 0d59eb9.

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.

React Doctor Action failed

3 participants