Skip to content

Commit 11c6e74

Browse files
authored
fix(core): Observe and handle Sentry CLI sourcemap upload failures (#763)
Bump `@sentry/cli` to 2.49.0 which adds a new `rejectOnError` live mode setting to the `execute` and `releases.uploadSourceMaps` APIs. This new mode now makes the CLI reject the promise it returns if the CLI binary process exits with a non-zero exit code. In the previous live mode, it never rejected but only piped the stdio output, meaning the plugins didn't even know that the CLI failed.
1 parent dccf8f1 commit 11c6e74

File tree

4 files changed

+60
-54
lines changed

4 files changed

+60
-54
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"ts-node": "^10.9.2"
3838
},
3939
"volta": {
40-
"node": "14.21.2",
40+
"node": "18.20.8",
4141
"yarn": "1.22.19"
4242
}
4343
}

packages/bundler-plugin-core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"dependencies": {
5555
"@babel/core": "^7.18.5",
5656
"@sentry/babel-plugin-component-annotate": "3.6.0",
57-
"@sentry/cli": "^2.46.0",
57+
"@sentry/cli": "^2.49.0",
5858
"dotenv": "^16.3.1",
5959
"find-up": "^5.0.0",
6060
"glob": "^9.3.2",

packages/bundler-plugin-core/src/build-plugin-manager.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,9 @@ export function createSentryBuildPluginManager(
455455
await cliInstance.releases.uploadSourceMaps(options.release.name, {
456456
include: normalizedInclude,
457457
dist: options.release.dist,
458+
// We want this promise to throw if the sourcemaps fail to upload so that we know about it.
459+
// see: https://github.com/getsentry/sentry-cli/pull/2605
460+
live: "rejectOnError",
458461
});
459462
}
460463

@@ -642,6 +645,9 @@ export function createSentryBuildPluginManager(
642645
dist: options.release.dist,
643646
},
644647
],
648+
// We want this promise to throw if the sourcemaps fail to upload so that we know about it.
649+
// see: https://github.com/getsentry/sentry-cli/pull/2605
650+
live: "rejectOnError",
645651
}
646652
);
647653
});

yarn.lock

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -2726,65 +2726,65 @@
27262726
"@sentry/utils" "7.50.0"
27272727
tslib "^1.9.3"
27282728

2729-
"@sentry/cli-darwin@2.46.0":
2730-
version "2.46.0"
2731-
resolved "https://registry.npmjs.org/@sentry/cli-darwin/-/cli-darwin-2.46.0.tgz#e07ff66f03e8cb6e1988b7673ae5dbd6ff957b1d"
2732-
integrity sha512-5Ll+e5KAdIk9OYiZO8aifMBRNWmNyPjSqdjaHlBC1Qfh7pE3b1zyzoHlsUazG0bv0sNrSGea8e7kF5wIO1hvyg==
2733-
2734-
"@sentry/cli-linux-arm64@2.46.0":
2735-
version "2.46.0"
2736-
resolved "https://registry.npmjs.org/@sentry/cli-linux-arm64/-/cli-linux-arm64-2.46.0.tgz#d5b27e5813e7b3add65c9e3dbdd75a8bea4ef324"
2737-
integrity sha512-OEJN8yAjI9y5B4telyqzu27Hi3+S4T8VxZCqJz1+z2Mp0Q/MZ622AahVPpcrVq/5bxrnlZR16+lKh8L1QwNFPg==
2738-
2739-
"@sentry/cli-linux-arm@2.46.0":
2740-
version "2.46.0"
2741-
resolved "https://registry.npmjs.org/@sentry/cli-linux-arm/-/cli-linux-arm-2.46.0.tgz#d2a0f21cd208ef8e844bc5e565b337640d125441"
2742-
integrity sha512-WRrLNq/TEX/TNJkGqq6Ad0tGyapd5dwlxtsPbVBrIdryuL1mA7VCBoaHBr3kcwJLsgBHFH0lmkMee2ubNZZdkg==
2743-
2744-
"@sentry/cli-linux-i686@2.46.0":
2745-
version "2.46.0"
2746-
resolved "https://registry.npmjs.org/@sentry/cli-linux-i686/-/cli-linux-i686-2.46.0.tgz#73368ebe30236c8647caec420f717a7f45410f29"
2747-
integrity sha512-xko3/BVa4LX8EmRxVOCipV+PwfcK5Xs8lP6lgF+7NeuAHMNL4DqF6iV9rrN8gkGUHCUI9RXSve37uuZnFy55+Q==
2748-
2749-
"@sentry/cli-linux-x64@2.46.0":
2750-
version "2.46.0"
2751-
resolved "https://registry.npmjs.org/@sentry/cli-linux-x64/-/cli-linux-x64-2.46.0.tgz#49da3dfd873e0e72abef968e1c213b9397e5d70e"
2752-
integrity sha512-hJ1g5UEboYcOuRia96LxjJ0jhnmk8EWLDvlGnXLnYHkwy3ree/L7sNgdp/QsY8Z4j2PGO5f22Va+UDhSjhzlfQ==
2753-
2754-
"@sentry/cli-win32-arm64@2.46.0":
2755-
version "2.46.0"
2756-
resolved "https://registry.npmjs.org/@sentry/cli-win32-arm64/-/cli-win32-arm64-2.46.0.tgz#4e26b254d5283eb114ac916ac504283a30b2ecdb"
2757-
integrity sha512-mN7cpPoCv2VExFRGHt+IoK11yx4pM4ADZQGEso5BAUZ5duViXB2WrAXCLd8DrwMnP0OE978a7N8OtzsFqjkbNA==
2758-
2759-
"@sentry/cli-win32-i686@2.46.0":
2760-
version "2.46.0"
2761-
resolved "https://registry.npmjs.org/@sentry/cli-win32-i686/-/cli-win32-i686-2.46.0.tgz#72f7c0a611f17b7e5b34e2b47309d165195a8276"
2762-
integrity sha512-6F73AUE3lm71BISUO19OmlnkFD5WVe4/wA1YivtLZTc1RU3eUYJLYxhDfaH3P77+ycDppQ2yCgemLRaA4A8mNQ==
2763-
2764-
"@sentry/cli-win32-x64@2.46.0":
2765-
version "2.46.0"
2766-
resolved "https://registry.npmjs.org/@sentry/cli-win32-x64/-/cli-win32-x64-2.46.0.tgz#8cfd438ec365b0ee925d9724a24b533b4cb75587"
2767-
integrity sha512-yuGVcfepnNL84LGA0GjHzdMIcOzMe0bjPhq/rwPsPN+zu11N+nPR2wV2Bum4U0eQdqYH3iAlMdL5/BEQfuLJww==
2768-
2769-
"@sentry/cli@^2.46.0":
2770-
version "2.46.0"
2771-
resolved "https://registry.npmjs.org/@sentry/cli/-/cli-2.46.0.tgz#790864874ea04f804053aa85dc94501b2cc321bb"
2772-
integrity sha512-nqoPl7UCr446QFkylrsRrUXF51x8Z9dGquyf4jaQU+OzbOJMqclnYEvU6iwbwvaw3tu/2DnoZE/Og+Nq1h63sA==
2729+
"@sentry/cli-darwin@2.49.0":
2730+
version "2.49.0"
2731+
resolved "https://registry.npmjs.org/@sentry/cli-darwin/-/cli-darwin-2.49.0.tgz#290657e5840b360cb8ca25c8a78f8c0f15c66b03"
2732+
integrity sha512-bgowyDeFuXbjkGq1ZKqcWhmzgfBe7oKIXYWJOOps4+32QfG+YsrdNnottHS01td3bzrJq0QnHj8H12fA81DqrA==
2733+
2734+
"@sentry/cli-linux-arm64@2.49.0":
2735+
version "2.49.0"
2736+
resolved "https://registry.npmjs.org/@sentry/cli-linux-arm64/-/cli-linux-arm64-2.49.0.tgz#a732004d7131f7e7b44f6a64abdccc36efb35d52"
2737+
integrity sha512-dqxsDUd76aDm03fUwUOs5BR7RHLpSb2EH/B1hlWm0mFvo9uY907XxW9wDFx/qDpCdmpC0aF+lF/lOBOrG9B5Fg==
2738+
2739+
"@sentry/cli-linux-arm@2.49.0":
2740+
version "2.49.0"
2741+
resolved "https://registry.npmjs.org/@sentry/cli-linux-arm/-/cli-linux-arm-2.49.0.tgz#73719561510df3369e05e9a4898b4e43b8753e4c"
2742+
integrity sha512-RBDIjIGmNsFw+a6vAt6m3D7ROKsMEB9i3u+UuIRxk0/DyHTcfVWxnK/ScPXGILM6PxQ2XOBfOKad0mmiDHBzZA==
2743+
2744+
"@sentry/cli-linux-i686@2.49.0":
2745+
version "2.49.0"
2746+
resolved "https://registry.npmjs.org/@sentry/cli-linux-i686/-/cli-linux-i686-2.49.0.tgz#8d1bb1378251a3aa995cc4b56bd352fa12a84b66"
2747+
integrity sha512-gDAd5/vJbEhd4Waud0Cd8ZRqLEagDlOvWwNH3KB694EiHJUwzRSiTA1YUVMYGI8Z9UyEA1sKxARwm2Trv99BxA==
2748+
2749+
"@sentry/cli-linux-x64@2.49.0":
2750+
version "2.49.0"
2751+
resolved "https://registry.npmjs.org/@sentry/cli-linux-x64/-/cli-linux-x64-2.49.0.tgz#7bf58fb7005c89fdde4e1262d5ed35e23065aceb"
2752+
integrity sha512-mbohGvPNhHjUciYNXzkt9TYUebTmxeAp9v9JfLSb/Soz6fubKwEHhpRJuz1zASxVWIR4PuqkePchqN5zhcLC0A==
2753+
2754+
"@sentry/cli-win32-arm64@2.49.0":
2755+
version "2.49.0"
2756+
resolved "https://registry.npmjs.org/@sentry/cli-win32-arm64/-/cli-win32-arm64-2.49.0.tgz#2bf6dd911acbe3ddb02eec0afb4301bb8fb25b53"
2757+
integrity sha512-3zwvsp61EPpSuGpGdXY4JelVJmNEjoj4vn5m6EFoOtk7OUI5/VFqqR4wchjy9Hjm3Eh6MB5K+KTKXs4W2p18ng==
2758+
2759+
"@sentry/cli-win32-i686@2.49.0":
2760+
version "2.49.0"
2761+
resolved "https://registry.npmjs.org/@sentry/cli-win32-i686/-/cli-win32-i686-2.49.0.tgz#32e31472ae6c5f69e538a4061d651937fcb8f14a"
2762+
integrity sha512-2oWaNl6z0BaOCAjM1Jxequfgjod3XO6wothxow4kA8e9+43JLhgarSdpwJPgQjcVyxjygwQ3/jKPdUFh0qNOmg==
2763+
2764+
"@sentry/cli-win32-x64@2.49.0":
2765+
version "2.49.0"
2766+
resolved "https://registry.npmjs.org/@sentry/cli-win32-x64/-/cli-win32-x64-2.49.0.tgz#86aab38cb41f885914d7c99ceaab7b6ce52c72c6"
2767+
integrity sha512-dR4ulyrA6ZT7x7cg4Rwm0tcHf4TZz5QO6t1W1jX6uJ9n/U0bOSqSFZHNf/RryiUzQE1g8LBthOYyKGMkET6T8w==
2768+
2769+
"@sentry/cli@^2.49.0":
2770+
version "2.49.0"
2771+
resolved "https://registry.npmjs.org/@sentry/cli/-/cli-2.49.0.tgz#a8332ae38e9f92a0da3d939bdbce119e63450e99"
2772+
integrity sha512-99IKax3yjOaPlWJh3rAJC/R6hdmZZJ2B3ACVP8CpOYE+JzGGLyir1fvTzrdFKFLPLOq2lGC3RqWuKqU7PJUTZQ==
27732773
dependencies:
27742774
https-proxy-agent "^5.0.0"
27752775
node-fetch "^2.6.7"
27762776
progress "^2.0.3"
27772777
proxy-from-env "^1.1.0"
27782778
which "^2.0.2"
27792779
optionalDependencies:
2780-
"@sentry/cli-darwin" "2.46.0"
2781-
"@sentry/cli-linux-arm" "2.46.0"
2782-
"@sentry/cli-linux-arm64" "2.46.0"
2783-
"@sentry/cli-linux-i686" "2.46.0"
2784-
"@sentry/cli-linux-x64" "2.46.0"
2785-
"@sentry/cli-win32-arm64" "2.46.0"
2786-
"@sentry/cli-win32-i686" "2.46.0"
2787-
"@sentry/cli-win32-x64" "2.46.0"
2780+
"@sentry/cli-darwin" "2.49.0"
2781+
"@sentry/cli-linux-arm" "2.49.0"
2782+
"@sentry/cli-linux-arm64" "2.49.0"
2783+
"@sentry/cli-linux-i686" "2.49.0"
2784+
"@sentry/cli-linux-x64" "2.49.0"
2785+
"@sentry/cli-win32-arm64" "2.49.0"
2786+
"@sentry/cli-win32-i686" "2.49.0"
2787+
"@sentry/cli-win32-x64" "2.49.0"
27882788

27892789
27902790
version "7.50.0"

0 commit comments

Comments
 (0)