diff --git a/src/api/data_types/chunking/dif.rs b/src/api/data_types/chunking/dif.rs index 43a6977460..f8ddc20b24 100644 --- a/src/api/data_types/chunking/dif.rs +++ b/src/api/data_types/chunking/dif.rs @@ -52,21 +52,6 @@ pub struct ChunkedDifResponse { #[serde(transparent)] pub struct AssembleDifsRequest<'a>(HashMap>); -impl AssembleDifsRequest<'_> { - /// Strips the debug_id from all requests in the request. We need - /// to strip the debug_ids whenever the server does not support chunked - /// uploading of PDBs, to maintain backwards compatibility. The - /// calling code is responsible for calling this function when needed. - /// - /// See: https://github.com/getsentry/sentry-cli/issues/980 - /// See: https://github.com/getsentry/sentry-cli/issues/1056 - pub fn strip_debug_ids(&mut self) { - for r in self.0.values_mut() { - r.debug_id = None; - } - } -} - impl<'a, T> FromIterator for AssembleDifsRequest<'a> where T: Into>, diff --git a/src/api/data_types/chunking/upload/capability.rs b/src/api/data_types/chunking/upload/capability.rs index 28ab96a249..c3c7a3f94a 100644 --- a/src/api/data_types/chunking/upload/capability.rs +++ b/src/api/data_types/chunking/upload/capability.rs @@ -2,9 +2,6 @@ use serde::{Deserialize, Deserializer}; #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub enum ChunkUploadCapability { - /// Chunked upload of debug files - DebugFiles, - /// Chunked upload of release files ReleaseFiles, @@ -15,21 +12,6 @@ pub enum ChunkUploadCapability { /// upload. ArtifactBundlesV2, - /// Upload of PDBs and debug id overrides - Pdbs, - - /// Upload of Portable PDBs - PortablePdbs, - - /// Uploads of source archives - Sources, - - /// Upload of BCSymbolMap and PList auxiliary DIFs - BcSymbolmap, - - /// Upload of il2cpp line mappings - Il2Cpp, - /// Upload of Dart symbol maps DartSymbolMap, @@ -49,15 +31,9 @@ impl<'de> Deserialize<'de> for ChunkUploadCapability { D: Deserializer<'de>, { Ok(match String::deserialize(deserializer)?.as_str() { - "debug_files" => ChunkUploadCapability::DebugFiles, "release_files" => ChunkUploadCapability::ReleaseFiles, "artifact_bundles" => ChunkUploadCapability::ArtifactBundles, "artifact_bundles_v2" => ChunkUploadCapability::ArtifactBundlesV2, - "pdbs" => ChunkUploadCapability::Pdbs, - "portablepdbs" => ChunkUploadCapability::PortablePdbs, - "sources" => ChunkUploadCapability::Sources, - "bcsymbolmaps" => ChunkUploadCapability::BcSymbolmap, - "il2cpp" => ChunkUploadCapability::Il2Cpp, "dartsymbolmap" => ChunkUploadCapability::DartSymbolMap, "preprod_artifacts" => ChunkUploadCapability::PreprodArtifacts, "proguard" => ChunkUploadCapability::Proguard, diff --git a/src/api/data_types/chunking/upload/options.rs b/src/api/data_types/chunking/upload/options.rs index 76a1767bca..1afec7e9a2 100644 --- a/src/api/data_types/chunking/upload/options.rs +++ b/src/api/data_types/chunking/upload/options.rs @@ -23,7 +23,7 @@ pub struct ChunkServerOptions { pub concurrency: u8, #[serde(default)] pub compression: Vec, - #[serde(default = "default_chunk_upload_accept")] + #[serde(default)] pub accept: Vec, } @@ -32,18 +32,4 @@ impl ChunkServerOptions { pub fn supports(&self, capability: ChunkUploadCapability) -> bool { self.accept.contains(&capability) } - - /// Determines whether we need to strip debug_ids from the requests. We need - /// to strip the debug_ids whenever the server does not support chunked - /// uploading of PDBs, to maintain backwards compatibility. - /// - /// See: https://github.com/getsentry/sentry-cli/issues/980 - /// See: https://github.com/getsentry/sentry-cli/issues/1056 - pub fn should_strip_debug_ids(&self) -> bool { - !self.supports(ChunkUploadCapability::DebugFiles) - } -} - -fn default_chunk_upload_accept() -> Vec { - vec![ChunkUploadCapability::DebugFiles] } diff --git a/src/utils/chunks/options.rs b/src/utils/chunks/options.rs index 767a8bf37d..5ed2fe89e5 100644 --- a/src/utils/chunks/options.rs +++ b/src/utils/chunks/options.rs @@ -31,10 +31,6 @@ impl<'a> ChunkOptions<'a> { self } - pub fn should_strip_debug_ids(&self) -> bool { - self.server_options.should_strip_debug_ids() - } - pub fn org(&self) -> &str { self.org } diff --git a/src/utils/chunks/upload.rs b/src/utils/chunks/upload.rs index a05c8425af..a472737dee 100644 --- a/src/utils/chunks/upload.rs +++ b/src/utils/chunks/upload.rs @@ -53,11 +53,7 @@ where T: AsRef<[u8]> + Assemblable, { let api = Api::current(); - let mut request: AssembleDifsRequest<'_> = objects.iter().collect(); - - if options.should_strip_debug_ids() { - request.strip_debug_ids(); - } + let request: AssembleDifsRequest<'_> = objects.iter().collect(); let response = api.authenticated()? @@ -188,10 +184,7 @@ where let assemble_start = Instant::now(); - let mut request: AssembleDifsRequest<'_> = chunked_objects.iter().copied().collect(); - if options.should_strip_debug_ids() { - request.strip_debug_ids(); - } + let request: AssembleDifsRequest<'_> = chunked_objects.iter().copied().collect(); let response = loop { let response = diff --git a/src/utils/dif_upload/mod.rs b/src/utils/dif_upload/mod.rs index 6271a17ce0..b3fef2312e 100644 --- a/src/utils/dif_upload/mod.rs +++ b/src/utils/dif_upload/mod.rs @@ -34,7 +34,7 @@ use zip::result::ZipError; use zip::ZipArchive; use self::error::ValidationError; -use crate::api::{Api, ChunkServerOptions, ChunkUploadCapability}; +use crate::api::{Api, ChunkServerOptions}; use crate::config::Config; use crate::constants::{DEFAULT_MAX_DIF_SIZE, DEFAULT_MAX_WAIT}; use crate::utils::chunks; @@ -1267,14 +1267,9 @@ pub struct DifUpload<'a> { zips_allowed: bool, max_file_size: u64, max_wait: Duration, - pdbs_allowed: bool, - portablepdbs_allowed: bool, - sources_allowed: bool, include_sources: bool, - bcsymbolmaps_allowed: bool, wait: bool, upload_il2cpp_mappings: bool, - il2cpp_mappings_allowed: bool, no_upload: bool, } @@ -1308,14 +1303,9 @@ impl<'a> DifUpload<'a> { zips_allowed: true, max_file_size: DEFAULT_MAX_DIF_SIZE, max_wait: DEFAULT_MAX_WAIT, - pdbs_allowed: false, - portablepdbs_allowed: false, - sources_allowed: false, include_sources: false, - bcsymbolmaps_allowed: false, wait: false, upload_il2cpp_mappings: false, - il2cpp_mappings_allowed: false, no_upload: false, } } @@ -1465,69 +1455,9 @@ impl<'a> DifUpload<'a> { .min(Duration::from_secs(chunk_options.max_wait)); } - self.pdbs_allowed = chunk_options.supports(ChunkUploadCapability::Pdbs); - self.portablepdbs_allowed = chunk_options.supports(ChunkUploadCapability::PortablePdbs); - self.sources_allowed = chunk_options.supports(ChunkUploadCapability::Sources); - self.bcsymbolmaps_allowed = chunk_options.supports(ChunkUploadCapability::BcSymbolmap); - self.il2cpp_mappings_allowed = chunk_options.supports(ChunkUploadCapability::Il2Cpp); - - if !chunk_options.supports(ChunkUploadCapability::DebugFiles) { - anyhow::bail!( - "Your Sentry server does not support chunked uploads for debug files. Please upgrade \ - your Sentry server, or if you cannot upgrade your server, downgrade your Sentry \ - CLI version to 2.x." - ); - } - - self.validate_capabilities(); upload_difs_chunked(self, chunk_options) } - /// Validate that the server supports all requested capabilities. - fn validate_capabilities(&mut self) { - // Checks whether source bundles are *explicitly* requested on the command line. - if (self - .formats - .contains(&DifFormat::Object(FileFormat::SourceBundle)) - || self.include_sources) - && !self.sources_allowed - { - warn!("Source uploads are not supported by the configured Sentry server"); - self.include_sources = false; - } - - // Checks whether PDBs or PEs were *explicitly* requested on the command line. - if (self.formats.contains(&DifFormat::Object(FileFormat::Pdb)) - || self.formats.contains(&DifFormat::Object(FileFormat::Pe))) - && !self.pdbs_allowed - { - warn!("PDBs and PEs are not supported by the configured Sentry server"); - // This is validated additionally in .valid_format() - } - - // Checks whether Portable PDBs were *explicitly* requested on the command line. - if self - .formats - .contains(&DifFormat::Object(FileFormat::PortablePdb)) - && !self.portablepdbs_allowed - { - warn!("Portable PDBs are not supported by the configured Sentry server"); - // This is validated additionally in .valid_format() - } - - // Checks whether BCSymbolMaps and PLists are **explicitly** requested on the command line. - if (self.formats.contains(&DifFormat::BcSymbolMap) - || self.formats.contains(&DifFormat::PList)) - && !self.bcsymbolmaps_allowed - { - warn!("BCSymbolMaps are not supported by the configured Sentry server"); - } - - if self.upload_il2cpp_mappings && !self.il2cpp_mappings_allowed { - warn!("il2cpp line mappings are not supported by the configured Sentry server"); - } - } - /// Determines if this `DebugId` matches the search criteria. fn valid_id(&self, id: DebugId) -> bool { self.ids.is_empty() || self.ids.contains(&id) @@ -1542,11 +1472,6 @@ impl<'a> DifUpload<'a> { fn valid_format(&self, format: DifFormat) -> bool { match format { DifFormat::Object(FileFormat::Unknown) => false, - DifFormat::Object(FileFormat::Pdb) if !self.pdbs_allowed => false, - DifFormat::Object(FileFormat::Pe) if !self.pdbs_allowed => false, - DifFormat::Object(FileFormat::SourceBundle) if !self.sources_allowed => false, - DifFormat::Object(FileFormat::PortablePdb) if !self.portablepdbs_allowed => false, - DifFormat::BcSymbolMap | DifFormat::PList if !self.bcsymbolmaps_allowed => false, format => self.formats.is_empty() || self.formats.contains(&format), } }