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..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,6 +575,7 @@ fn poll_assemble( context.dist, )? } else { + #[expect(deprecated, reason = "fallback to legacy upload")] authenticated_api.assemble_release_artifacts( context.org, context.release()?,