-
-
Notifications
You must be signed in to change notification settings - Fork 236
chore(js): Remove live = 'rejectOnError' option
#2971
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: szokeasaurusrex/no-release-bundle-uploads
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -142,11 +142,10 @@ class Releases { | |
| * ext: ['js', 'map', 'jsbundle', 'bundle'], // override file extensions to scan for | ||
| * projects: ['node'], // provide a list of projects | ||
| * decompress: false // decompress gzip files before uploading | ||
| * live: true // whether to inherit stdio to display `sentry-cli` output directly. | ||
| * }); | ||
| * | ||
| * @param {string} release Unique name of the release. | ||
| * @param {SentryCliUploadSourceMapsOptions & {live?: boolean | 'rejectOnError'}} options Options to configure the source map upload. | ||
| * @param {SentryCliUploadSourceMapsOptions} options Options to configure the source map upload. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @szokeasaurusrex Here the
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, exactly, this removal is intentional. For sourcemaps upload, we always use |
||
| * @returns {Promise<string[]>} A promise that resolves when the upload has completed successfully. | ||
| * @memberof SentryReleases | ||
| */ | ||
|
|
@@ -193,10 +192,7 @@ class Releases { | |
|
|
||
| return uploadPaths.map((path) => | ||
| // `execute()` is async and thus we're returning a promise here | ||
| this.execute( | ||
| helper.prepareCommand([...args, path], SOURCEMAPS_SCHEMA, newOptions), | ||
| options.live != null ? options.live : true | ||
| ) | ||
| this.execute(helper.prepareCommand([...args, path], SOURCEMAPS_SCHEMA, newOptions), true) | ||
| ); | ||
| }); | ||
|
|
||
|
|
@@ -252,11 +248,10 @@ class Releases { | |
| /** | ||
| * See {helper.execute} docs. | ||
| * @param {string[]} args Command line arguments passed to `sentry-cli`. | ||
| * @param {boolean | 'rejectOnError'} live can be set to: | ||
| * - `true` to inherit stdio to display `sentry-cli` output directly. | ||
| * - `false` to not inherit stdio and return the output as a string. | ||
| * - `'rejectOnError'` to inherit stdio and reject the promise if the command | ||
| * @param {boolean} live can be set to: | ||
| * - `true` to inherit stdio and reject the promise if the command | ||
| * exits with a non-zero exit code. | ||
| * - `false` to not inherit stdio and return the output as a string. | ||
| * @returns {Promise<string>} A promise that resolves to the standard output. | ||
| */ | ||
| async execute(args, live) { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Missing else causes reject after successful resolve
The exit handler unconditionally calls
reject()after conditionally callingresolve()for zero exit codes. WhenexitCode === 0, bothresolve('success (live mode)')andreject(new Error(...))execute sequentially. While promises only settle once, this creates an unhandled rejection and indicates incorrect control flow logic. Anelseclause orreturnstatement is needed to prevent rejection after successful resolution.