Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions src/commands/debug_files/upload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ pub fn execute(matches: &ArgMatches) -> Result<()> {

upload.include_sources(matches.get_flag("include_sources"));
upload.il2cpp_mapping(matches.get_flag("il2cpp_mapping"));
upload.no_upload(matches.get_flag("no_upload"));

// Configure BCSymbolMap resolution, if possible
if let Some(symbol_map) = matches.get_one::<String>("symbol_maps") {
Expand All @@ -288,11 +289,6 @@ pub fn execute(matches: &ArgMatches) -> Result<()> {
}
}

if matches.get_flag("no_upload") {
println!("{} skipping upload.", style(">").dim());
return Ok(());
}

// Execute the upload
let (uploaded, has_processing_errors) = upload.upload()?;

Expand Down
19 changes: 19 additions & 0 deletions src/utils/dif_upload/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1254,6 +1254,11 @@ fn upload_difs_chunked(
Chunked::from(m, chunk_options.chunk_size as usize)
})?;

if options.no_upload {
println!("{} skipping upload.", style(">").dim());
return Ok(Default::default());
}

let options = options.into_chunk_options(chunk_options);
chunks::upload_chunked_objects(&chunked, options)
}
Expand Down Expand Up @@ -1359,6 +1364,10 @@ fn upload_difs_batched(options: &DifUpload) -> Result<Vec<DebugInfoFile>> {
println!("{} Nothing to upload", style(">").dim());
return Ok(Default::default());
}
if options.no_upload {
println!("{} skipping upload.", style(">").dim());
return Ok(Default::default());
}

// Upload missing DIFs in batches
let uploaded = upload_in_batches(&missing, options)?;
Expand Down Expand Up @@ -1448,6 +1457,7 @@ pub struct DifUpload<'a> {
wait: bool,
upload_il2cpp_mappings: bool,
il2cpp_mappings_allowed: bool,
no_upload: bool,
}

impl<'a> DifUpload<'a> {
Expand Down Expand Up @@ -1488,6 +1498,7 @@ impl<'a> DifUpload<'a> {
wait: false,
upload_il2cpp_mappings: false,
il2cpp_mappings_allowed: false,
no_upload: false,
}
}

Expand Down Expand Up @@ -1599,6 +1610,14 @@ impl<'a> DifUpload<'a> {
self
}

/// Set whether to skip uploading the detected debug files for troubleshooting purposes.
///
/// Defaults to `false`.
pub fn no_upload(&mut self, skip: bool) -> &mut Self {
self.no_upload = skip;
self
}

/// Performs the search for DIFs and uploads them.
///
/// ```
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
```
$ sentry-cli debug-files upload tests/integration/_fixtures/elf-Linux-ARMv7-ls --no-upload
? success
> Found 1 debug information file
> Prepared debug information file for upload
> skipping upload.

```
3 changes: 2 additions & 1 deletion tests/integration/debug_files/upload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ fn command_debug_files_upload_no_upload() {
)
.with_response_file("debug_files/post-difs-assemble.json"),
)
.register_trycmd_test("debug_files/upload/debug_files-upload-no-upload.trycmd");
.register_trycmd_test("debug_files/upload/debug_files-upload-no-upload.trycmd")
.with_default_token();
}

#[test]
Expand Down