Skip to content

Conversation

@jackw
Copy link
Collaborator

@jackw jackw commented Jan 16, 2026

What this PR does / why we need it:
Whilst scanning plugins locally it's handy to not have to deal with error exit codes.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

📦 Published PR as canary version: Canary Versions

✨ Test out this PR locally via:

npm install website@5.3.0-canary.2406.21076281185.0
npm install @grafana/react-detect@0.5.0-canary.2406.21076281185.0
# or 
yarn add website@5.3.0-canary.2406.21076281185.0
yarn add @grafana/react-detect@0.5.0-canary.2406.21076281185.0

@jackw jackw self-assigned this Jan 16, 2026
Copilot AI review requested due to automatic review settings January 16, 2026 18:12
@jackw jackw requested review from a team as code owners January 16, 2026 18:12
@jackw jackw added the minor Increment the minor version when merged label Jan 16, 2026
@jackw jackw requested a review from briangann January 16, 2026 18:12
@jackw jackw added the release Create a release when this pr is merged label Jan 16, 2026
@jackw jackw requested review from s4kh and xnyo January 16, 2026 18:12
@github-actions
Copy link
Contributor

github-actions bot commented Jan 16, 2026

Hello! 👋 This repository uses Auto for releasing packages using PR labels.

✨ This PR can be merged and will trigger a new minor release.
NOTE: When merging a PR with the release label please avoid merging another PR. For further information see here.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a --noExitCode flag to the react-detect tool to prevent it from exiting with code 1 when React 19 issues are detected. This is useful for local plugin scanning where non-zero exit codes are undesirable in certain workflows.

Changes:

  • Added noExitCode boolean argument to the CLI argument parser
  • Implemented early exit with code 0 when --noExitCode flag is set

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated 2 comments.

File Description
packages/react-detect/src/bin/run.ts Added noExitCode to the boolean arguments list and default configuration
packages/react-detect/src/commands/detect19.ts Added conditional early exit with code 0 when noExitCode flag is present

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +63 to 67
if (argv.noExitCode) {
process.exit(0);
}

process.exit(results.summary.totalIssues > 0 ? 1 : 0);
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

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

The noExitCode flag implementation doesn't affect the error path. When an exception is caught on line 68-74, the process still exits with code 1 regardless of the noExitCode flag. The flag should also apply to error cases to be consistent with its purpose of preventing exit code 1.

Copilot uses AI. Check for mistakes.
Comment on lines +63 to +65
if (argv.noExitCode) {
process.exit(0);
}
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

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

The flag name noExitCode is ambiguous - it suggests preventing all exit codes, when it actually only prevents exit code 1. Consider renaming to noErrorExitCode or ignoreErrors to better reflect its actual behavior.

Copilot uses AI. Check for mistakes.
@github-project-automation github-project-automation bot moved this from 📬 Triage to 🔬 In review in Plugins Platform / Grafana Community Jan 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

minor Increment the minor version when merged release Create a release when this pr is merged

Projects

Status: 🔬 In review

Development

Successfully merging this pull request may close these issues.

2 participants