Skip to content

Commit 19a3331

Browse files
Merge branch 'master' into chromy/2025-09-05-show-url
2 parents ab71fc0 + 0b093b3 commit 19a3331

File tree

4 files changed

+24
-6
lines changed

4 files changed

+24
-6
lines changed

src/commands/debug_files/upload.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ pub fn execute(matches: &ArgMatches) -> Result<()> {
270270

271271
upload.include_sources(matches.get_flag("include_sources"));
272272
upload.il2cpp_mapping(matches.get_flag("il2cpp_mapping"));
273+
upload.no_upload(matches.get_flag("no_upload"));
273274

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

291-
if matches.get_flag("no_upload") {
292-
println!("{} skipping upload.", style(">").dim());
293-
return Ok(());
294-
}
295-
296292
// Execute the upload
297293
let (uploaded, has_processing_errors) = upload.upload()?;
298294

src/utils/dif_upload/mod.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,6 +1254,11 @@ fn upload_difs_chunked(
12541254
Chunked::from(m, chunk_options.chunk_size as usize)
12551255
})?;
12561256

1257+
if options.no_upload {
1258+
println!("{} skipping upload.", style(">").dim());
1259+
return Ok(Default::default());
1260+
}
1261+
12571262
let options = options.into_chunk_options(chunk_options);
12581263
chunks::upload_chunked_objects(&chunked, options)
12591264
}
@@ -1359,6 +1364,10 @@ fn upload_difs_batched(options: &DifUpload) -> Result<Vec<DebugInfoFile>> {
13591364
println!("{} Nothing to upload", style(">").dim());
13601365
return Ok(Default::default());
13611366
}
1367+
if options.no_upload {
1368+
println!("{} skipping upload.", style(">").dim());
1369+
return Ok(Default::default());
1370+
}
13621371

13631372
// Upload missing DIFs in batches
13641373
let uploaded = upload_in_batches(&missing, options)?;
@@ -1448,6 +1457,7 @@ pub struct DifUpload<'a> {
14481457
wait: bool,
14491458
upload_il2cpp_mappings: bool,
14501459
il2cpp_mappings_allowed: bool,
1460+
no_upload: bool,
14511461
}
14521462

14531463
impl<'a> DifUpload<'a> {
@@ -1488,6 +1498,7 @@ impl<'a> DifUpload<'a> {
14881498
wait: false,
14891499
upload_il2cpp_mappings: false,
14901500
il2cpp_mappings_allowed: false,
1501+
no_upload: false,
14911502
}
14921503
}
14931504

@@ -1599,6 +1610,14 @@ impl<'a> DifUpload<'a> {
15991610
self
16001611
}
16011612

1613+
/// Set whether to skip uploading the detected debug files for troubleshooting purposes.
1614+
///
1615+
/// Defaults to `false`.
1616+
pub fn no_upload(&mut self, skip: bool) -> &mut Self {
1617+
self.no_upload = skip;
1618+
self
1619+
}
1620+
16021621
/// Performs the search for DIFs and uploads them.
16031622
///
16041623
/// ```
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
```
22
$ sentry-cli debug-files upload tests/integration/_fixtures/elf-Linux-ARMv7-ls --no-upload
33
? success
4+
> Found 1 debug information file
5+
> Prepared debug information file for upload
46
> skipping upload.
57

68
```

tests/integration/debug_files/upload.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,8 @@ fn command_debug_files_upload_no_upload() {
157157
)
158158
.with_response_file("debug_files/post-difs-assemble.json"),
159159
)
160-
.register_trycmd_test("debug_files/upload/debug_files-upload-no-upload.trycmd");
160+
.register_trycmd_test("debug_files/upload/debug_files-upload-no-upload.trycmd")
161+
.with_default_token();
161162
}
162163

163164
#[test]

0 commit comments

Comments
 (0)