Skip to content

feat: adding wrapper for @sentry/wizard and sentry-cli#202

Open
MathurAditya724 wants to merge 10 commits intomainfrom
feat/wizard
Open

feat: adding wrapper for @sentry/wizard and sentry-cli#202
MathurAditya724 wants to merge 10 commits intomainfrom
feat/wizard

Conversation

@MathurAditya724
Copy link
Member

@MathurAditya724 MathurAditya724 commented Feb 5, 2026

Summary

Adds sentry init (wraps @sentry/wizard) and a sentry-cli passthrough 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 wrapper

  • sentry init runs npx @sentry/wizard@latest with inherited stdio
  • Supports all wizard flags: --integration, --org, --project, --url, --debug, --uninstall, --quiet, --skip-connect, --saas, --signup, --disable-telemetry
  • Auto-populates org/project from CLI config when authenticated
  • Shares existing auth token with wizard via --preSelectedProject.* fields (skip browser login); opt out with --no-auth

sentry-cli passthrough runner

  • Resolves the Rust-based sentry-cli binary: global install > local node_modules/.bin > npx @sentry/cli@latest fallback
  • Platform-specific install instructions if not found
  • 30+ commands delegate via runSentryCli():
Group Commands
releases new, finalize, list, info, delete, archive, restore, set-commits, propose-version
sourcemaps upload, inject, resolve
debug-files upload, check, find, bundle-sources, bundle-jvm, print-sources
deploys list, new
monitors list, run
repos list
react-native gradle, xcode
build upload
(top-level) send-event, send-envelope

Test Plan

sentry init
sentry init -i nextjs
sentry releases list
sentry sourcemaps upload ./dist
sentry debug-files upload ./symbols

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

Semver Impact of This PR

🟡 Minor (new features)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

  • Adding wrapper for @sentry/wizard and sentry-cli by MathurAditya724 in #202

🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

Codecov Results 📊

✅ Patch coverage is 100.00%. Project has 1996 uncovered lines.
✅ Project coverage is 76.13%. Comparing base (base) to head (head).

Files with missing lines (40)
File Patch % Lines
human.ts 55.31% ⚠️ 391 Missing
resolve-target.ts 15.28% ⚠️ 366 Missing
oauth.ts 25.10% ⚠️ 194 Missing
api-client.ts 70.62% ⚠️ 176 Missing
upgrade.ts 45.49% ⚠️ 139 Missing
view.ts 47.70% ⚠️ 91 Missing
migration.ts 47.44% ⚠️ 82 Missing
browser.ts 4.11% ⚠️ 70 Missing
span-tree.ts 5.00% ⚠️ 57 Missing
telemetry.ts 77.51% ⚠️ 56 Missing
api.ts 89.80% ⚠️ 47 Missing
seer.ts 75.54% ⚠️ 45 Missing
schema.ts 89.56% ⚠️ 40 Missing
seer.ts 79.87% ⚠️ 30 Missing
preload.ts 53.23% ⚠️ 29 Missing
utils.ts 88.94% ⚠️ 25 Missing
detector.ts 90.10% ⚠️ 20 Missing
output.ts 15.00% ⚠️ 17 Missing
code-scanner.ts 95.00% ⚠️ 16 Missing
arg-parsing.ts 90.00% ⚠️ 12 Missing
dsn-cache.ts 94.62% ⚠️ 12 Missing
fix.ts 83.61% ⚠️ 10 Missing
qrcode.ts 33.33% ⚠️ 10 Missing
fs-utils.ts 57.14% ⚠️ 9 Missing
project-root.ts 97.73% ⚠️ 7 Missing
version-check.ts 91.76% ⚠️ 7 Missing
feedback.ts 84.21% ⚠️ 6 Missing
auth.ts 95.52% ⚠️ 6 Missing
upgrade.ts 93.83% ⚠️ 5 Missing
resolver.ts 94.57% ⚠️ 5 Missing
index.ts 95.96% ⚠️ 4 Missing
project-aliases.ts 97.40% ⚠️ 2 Missing
project-root-cache.ts 96.92% ⚠️ 2 Missing
json.ts 33.33% ⚠️ 2 Missing
alias.ts 99.42% ⚠️ 1 Missing
env-file.ts 99.19% ⚠️ 1 Missing
parser.ts 98.63% ⚠️ 1 Missing
colors.ts 97.96% ⚠️ 1 Missing
helpers.ts 94.74% ⚠️ 1 Missing
helpers.ts 94.74% ⚠️ 1 Missing
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

@MathurAditya724 MathurAditya724 changed the title feat: adding wrapper for @sentry/wizard feat: adding wrapper for @sentry/wizard and sentry-cli Feb 6, 2026
@MathurAditya724 MathurAditya724 marked this pull request as ready for review February 6, 2026 12:17
Comment on lines +102 to +106
proc.on("close", (code) => {
if (code === 0) {
resolve();
} else {
reject(new Error(`sentry-cli exited with code ${code}`));
Copy link

Choose a reason for hiding this comment

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

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.

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