Skip to content

Conversation

Lms24
Copy link
Member

@Lms24 Lms24 commented Jul 15, 2025

The Sentry CLI JS interface's execute method takes a live parameter as a second argument:

This PR adds a third value ('rejectOnError') to live, which still pipes stdio but also rejects if the CLI binary's exit code was non-zero. Arguably, this is what true should do but to avoid a breaking change for now, let's introduce this as a new value instead.

This PR also makes a second small change, which is to allow the Releases.uploadSourceMaps method to forward a live option to its .execute call. This is necessary because at the moment, uploadSourceMaps always calls .execute with live: true but in case of the bundler plugins, we want to use the new live: 'rejectOnError' mode.

Also added a couple of unit tests

closes #2062
ref getsentry/sentry-javascript-bundler-plugins#670

@Lms24 Lms24 requested a review from szokeasaurusrex as a code owner July 15, 2025 11:20
@Lms24 Lms24 changed the title feat(js): Add live: rejectOnError execution mode to execute method feat(js): Add live: 'rejectOnError' execution mode to execute method Jul 15, 2025
@Lms24 Lms24 requested a review from andreiborza July 15, 2025 11:26
@Lms24 Lms24 self-assigned this Jul 15, 2025
Copy link
Member

@szokeasaurusrex szokeasaurusrex left a comment

Choose a reason for hiding this comment

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

Looks good, see comments prior to merge

@szokeasaurusrex
Copy link
Member

Also perhaps would be good for someone more well-versed in JS to also take a glance at this before we merge

@Lms24 Lms24 requested a review from chargome July 15, 2025 12:35
@Lms24 Lms24 force-pushed the lms/feat-js-allow-live-mode-promise-rejection branch from 2b989fc to cc6f642 Compare July 15, 2025 15:31
Copy link
Member

@chargome chargome left a comment

Choose a reason for hiding this comment

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

LGTM

@Lms24 Lms24 merged commit 3fb1353 into master Jul 16, 2025
26 checks passed
@Lms24 Lms24 deleted the lms/feat-js-allow-live-mode-promise-rejection branch July 16, 2025 08:10
Lms24 added a commit that referenced this pull request Jul 18, 2025
…2627)

While working on #2605, I missed that we also need to add the new `live`
option to the manually created *public* type declaration of the
`SentryCLI().releases.uploadSourceMaps` method. This patch now adds the
`live` option to this method.
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.

Exit code ignored with SentryCli.execute([...], true) (live mode)

3 participants