From cfeee69614b905d09bbf06634d859603fd4671ab Mon Sep 17 00:00:00 2001 From: Daniel Szoke Date: Mon, 13 Oct 2025 10:38:17 +0200 Subject: [PATCH 1/2] chore(sourcemaps): Deprecate release bundle uploads --- CHANGELOG.md | 6 ++++++ src/api/mod.rs | 1 + src/utils/file_upload.rs | 8 ++++++++ 3 files changed, 15 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d69ef8fb3..a5c08b5cd7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ "You know what they say. Fool me once, strike one, but fool me twice... strike three." — Michael Scott +## Unreleased + +### Deprecations + +- Added a deprecation notice for release bundle uploads, a legacy method for uploading sourcemaps ([#2844](https://github.com/getsentry/sentry-cli/pull/2844)). Release bundle uploads will be removed in Sentry CLI 3.x in favor of artifact bundles, the newer sourcemap upload method [introduced in Sentry version 23.6.2](https://github.com/getsentry/sentry/commit/f90f764fda09575f3f94caf32d04589098384616). **Self-hosted users**: You must upgrade to Sentry 23.6.2 or later before upgrading to Sentry CLI 3.x. + ## 2.56.1 ### Deprecations diff --git a/src/api/mod.rs b/src/api/mod.rs index 4b2fc00dad..93c0e0f2b0 100644 --- a/src/api/mod.rs +++ b/src/api/mod.rs @@ -992,6 +992,7 @@ impl<'a> AuthenticatedApi<'a> { .convert_rnf(ApiErrorKind::ProjectNotFound) } + #[deprecated = "release bundle uploads are deprecated in favor of artifact bundle uploads"] pub fn assemble_release_artifacts( &self, org: &str, diff --git a/src/utils/file_upload.rs b/src/utils/file_upload.rs index 67d0f592d5..dd4035df89 100644 --- a/src/utils/file_upload.rs +++ b/src/utils/file_upload.rs @@ -556,6 +556,14 @@ fn poll_assemble( context.dist, )? } else { + log::warn!( + "[DEPRECATION NOTICE] Your Sentry server does not support artifact bundle \ + uploads. Falling back to deprecated release bundle upload. Support for this \ + deprecated upload method will be removed in Sentry CLI 3.0.0. Please upgrade your \ + Sentry server, or if you cannot upgrade, pin your Sentry CLI version to 2.x, so \ + you don't get upgraded to 3.x when it is released." + ); + #[expect(deprecated, reason = "fallback to legacy upload")] authenticated_api.assemble_release_artifacts( context.org, context.release()?, From 05a15b0d4f7cc8520b5e4c6f77528573717fca50 Mon Sep 17 00:00:00 2001 From: Daniel Szoke Date: Tue, 14 Oct 2025 11:48:50 +0200 Subject: [PATCH 2/2] Only warn when sever lacks artifact bundle support --- src/utils/file_upload.rs | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/src/utils/file_upload.rs b/src/utils/file_upload.rs index dd4035df89..402a8e608a 100644 --- a/src/utils/file_upload.rs +++ b/src/utils/file_upload.rs @@ -538,12 +538,31 @@ fn poll_assemble( let api = Api::current(); let authenticated_api = api.authenticated()?; - let artifact_bundle_projects = { - (options.supports(ChunkUploadCapability::ArtifactBundles) - || options.supports(ChunkUploadCapability::ArtifactBundlesV2)) + + let server_supports_artifact_bundles = options.supports(ChunkUploadCapability::ArtifactBundles) + || options.supports(ChunkUploadCapability::ArtifactBundlesV2); + + if !server_supports_artifact_bundles { + log::warn!( + "[DEPRECATION NOTICE] Your Sentry server does not support artifact bundle \ + uploads. Falling back to deprecated release bundle upload. Support for this \ + deprecated upload method will be removed in Sentry CLI 3.0.0. Please upgrade your \ + Sentry server, or if you cannot upgrade, pin your Sentry CLI version to 2.x, so \ + you don't get upgraded to 3.x when it is released." + ); + } + + // We fall back to legacy release upload if server lacks artifact bundle support, or if + // no projects are specified. context.projects has Some(projects) in all cases, besides + // the following: + // - For `files upload`, we can have None projects. We don't need a separate warning, + // because `files upload` is already deprecated. + // - For `debug-files bundle-jvm`, but although that codepath uses the `UploadContext`, + // it does not actually use it to perform an upload, so we never hit this codepath. + let artifact_bundle_projects = server_supports_artifact_bundles .then_some(context.projects) - .flatten() - }; + .flatten(); + let response = loop { // prefer standalone artifact bundle upload over legacy release based upload let response = if let Some(projects) = artifact_bundle_projects { @@ -556,13 +575,6 @@ fn poll_assemble( context.dist, )? } else { - log::warn!( - "[DEPRECATION NOTICE] Your Sentry server does not support artifact bundle \ - uploads. Falling back to deprecated release bundle upload. Support for this \ - deprecated upload method will be removed in Sentry CLI 3.0.0. Please upgrade your \ - Sentry server, or if you cannot upgrade, pin your Sentry CLI version to 2.x, so \ - you don't get upgraded to 3.x when it is released." - ); #[expect(deprecated, reason = "fallback to legacy upload")] authenticated_api.assemble_release_artifacts( context.org,