feat: adding wrapper for @sentry/wizard and sentry-cli#202
feat: adding wrapper for @sentry/wizard and sentry-cli#202MathurAditya724 wants to merge 10 commits intomainfrom
Conversation
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨
🤖 This preview updates automatically when you update the PR. |
Codecov Results 📊✅ Patch coverage is 100.00%. Project has 1996 uncovered lines. Files with missing lines (40)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 76.13% 76.13% —%
==========================================
Files 65 65 —
Lines 8362 8362 —
Branches 0 0 —
==========================================
+ Hits 6366 6366 —
- Misses 1996 1996 —
- Partials 0 0 —Generated by Codecov Action |
| proc.on("close", (code) => { | ||
| if (code === 0) { | ||
| resolve(); | ||
| } else { | ||
| reject(new Error(`sentry-cli exited with code ${code}`)); |
There was a problem hiding this comment.
Bug: The process close event handler incorrectly reports an error when the process is terminated by a signal, as the exit code will be null.
Severity: MEDIUM
Suggested Fix
Update the proc.on("close", ...) handler to accept both code and signal arguments. If code is null, the promise should be rejected with an informative message that includes the signal value. This will provide accurate error reporting for common scenarios like user cancellation (Ctrl+C) or process termination in CI environments.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: src/lib/sentry-cli-runner.ts#L102-L106
Potential issue: The `close` event handler for a spawned child process is implemented to
only check the `code` argument. When a process is terminated by a signal (e.g., SIGINT
from Ctrl+C, or SIGTERM from a process manager), the `close` event is emitted with
`code` as `null` and a `signal` string. The current code does not handle this case,
causing it to reject with a misleading error message like `"sentry-cli exited with code
null"`. This behavior discards the actual reason for termination and is inconsistent
with existing patterns in the codebase that correctly handle a `null` exit code.
Did we get this right? 👍 / 👎 to inform future reviews.
Summary
Adds
sentry init(wraps@sentry/wizard) and asentry-clipassthrough layer so existing sentry-cli commands (releases, sourcemaps, debug-files, etc.) are available from the new CLI while native implementations are built.sentry init-- wizard wrappersentry initrunsnpx @sentry/wizard@latestwith inherited stdio--integration,--org,--project,--url,--debug,--uninstall,--quiet,--skip-connect,--saas,--signup,--disable-telemetry--preSelectedProject.*fields (skip browser login); opt out with--no-authsentry-clipassthrough runnersentry-clibinary: global install > localnode_modules/.bin>npx @sentry/cli@latestfallbackrunSentryCli():releasessourcemapsdebug-filesdeploysmonitorsreposreact-nativebuildTest Plan