sentry-cli 2.36.6__tar.gz → 2.37.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/Cargo.lock +1 -1
  2. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/Cargo.toml +1 -1
  3. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/PKG-INFO +1 -1
  4. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/sentry_cli.egg-info/PKG-INFO +1 -1
  5. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/debug_files/upload.rs +30 -40
  6. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/react_native/xcode.rs +178 -193
  7. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/config.rs +0 -11
  8. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/utils/xcode.rs +1 -198
  9. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/LICENSE +0 -0
  10. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/MANIFEST.in +0 -0
  11. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/README.md +0 -0
  12. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/build.rs +0 -0
  13. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/pyproject.toml +0 -0
  14. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/sentry_cli.egg-info/SOURCES.txt +0 -0
  15. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/sentry_cli.egg-info/dependency_links.txt +0 -0
  16. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/sentry_cli.egg-info/top_level.txt +0 -0
  17. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/setup.cfg +0 -0
  18. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/setup.py +0 -0
  19. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/api/connection_manager.rs +0 -0
  20. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/api/data_types/chunking/artifact.rs +0 -0
  21. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/api/data_types/chunking/compression.rs +0 -0
  22. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/api/data_types/chunking/dif.rs +0 -0
  23. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/api/data_types/chunking/file_state.rs +0 -0
  24. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/api/data_types/chunking/hash_algorithm.rs +0 -0
  25. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/api/data_types/chunking/mod.rs +0 -0
  26. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/api/data_types/chunking/upload/capability.rs +0 -0
  27. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/api/data_types/chunking/upload/mod.rs +0 -0
  28. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/api/data_types/chunking/upload/options.rs +0 -0
  29. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/api/data_types/deploy.rs +0 -0
  30. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/api/data_types/mod.rs +0 -0
  31. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/api/encoding.rs +0 -0
  32. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/api/envelopes_api.rs +0 -0
  33. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/api/errors/api_error.rs +0 -0
  34. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/api/errors/mod.rs +0 -0
  35. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/api/errors/sentry_error.rs +0 -0
  36. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/api/mod.rs +0 -0
  37. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/api/pagination.rs +0 -0
  38. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/bashsupport.sh +0 -0
  39. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/bash_hook.rs +0 -0
  40. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/debug_files/bundle_jvm.rs +0 -0
  41. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/debug_files/bundle_sources.rs +0 -0
  42. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/debug_files/check.rs +0 -0
  43. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/debug_files/find.rs +0 -0
  44. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/debug_files/mod.rs +0 -0
  45. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/debug_files/print_sources.rs +0 -0
  46. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/deploys/list.rs +0 -0
  47. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/deploys/mod.rs +0 -0
  48. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/deploys/new.rs +0 -0
  49. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/derive_parser.rs +0 -0
  50. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/events/list.rs +0 -0
  51. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/events/mod.rs +0 -0
  52. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/files/delete.rs +0 -0
  53. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/files/list.rs +0 -0
  54. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/files/mod.rs +0 -0
  55. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/files/upload.rs +0 -0
  56. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/info.rs +0 -0
  57. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/issues/list.rs +0 -0
  58. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/issues/mod.rs +0 -0
  59. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/issues/mute.rs +0 -0
  60. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/issues/resolve.rs +0 -0
  61. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/issues/unresolve.rs +0 -0
  62. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/login.rs +0 -0
  63. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/mod.rs +0 -0
  64. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/monitors/list.rs +0 -0
  65. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/monitors/mod.rs +0 -0
  66. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/monitors/run.rs +0 -0
  67. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/organizations/list.rs +0 -0
  68. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/organizations/mod.rs +0 -0
  69. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/projects/list.rs +0 -0
  70. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/projects/mod.rs +0 -0
  71. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/react_native/appcenter.rs +0 -0
  72. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/react_native/gradle.rs +0 -0
  73. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/react_native/mod.rs +0 -0
  74. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/releases/archive.rs +0 -0
  75. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/releases/delete.rs +0 -0
  76. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/releases/finalize.rs +0 -0
  77. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/releases/info.rs +0 -0
  78. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/releases/list.rs +0 -0
  79. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/releases/mod.rs +0 -0
  80. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/releases/new.rs +0 -0
  81. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/releases/propose_version.rs +0 -0
  82. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/releases/restore.rs +0 -0
  83. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/releases/set_commits.rs +0 -0
  84. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/repos/list.rs +0 -0
  85. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/repos/mod.rs +0 -0
  86. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/send_envelope.rs +0 -0
  87. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/send_event.rs +0 -0
  88. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/send_metric/common_args.rs +0 -0
  89. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/send_metric/distribution.rs +0 -0
  90. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/send_metric/gauge.rs +0 -0
  91. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/send_metric/increment.rs +0 -0
  92. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/send_metric/mod.rs +0 -0
  93. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/send_metric/set.rs +0 -0
  94. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/sourcemaps/explain.rs +0 -0
  95. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/sourcemaps/inject.rs +0 -0
  96. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/sourcemaps/mod.rs +0 -0
  97. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/sourcemaps/resolve.rs +0 -0
  98. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/sourcemaps/upload.rs +0 -0
  99. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/uninstall.rs +0 -0
  100. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/update.rs +0 -0
  101. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/upload_dif.rs +0 -0
  102. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/upload_dsym.rs +0 -0
  103. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/commands/upload_proguard.rs +0 -0
  104. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/constants.rs +0 -0
  105. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/main.rs +0 -0
  106. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/utils/android.rs +0 -0
  107. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/utils/appcenter.rs +0 -0
  108. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/utils/args.rs +0 -0
  109. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/utils/auth_token/auth_token_impl.rs +0 -0
  110. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/utils/auth_token/error.rs +0 -0
  111. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/utils/auth_token/mod.rs +0 -0
  112. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/utils/auth_token/org_auth_token.rs +0 -0
  113. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/utils/auth_token/redacting.rs +0 -0
  114. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/utils/auth_token/test.rs +0 -0
  115. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/utils/auth_token/user_auth_token.rs +0 -0
  116. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/utils/chunks.rs +0 -0
  117. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/utils/cordova.rs +0 -0
  118. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/utils/dif.rs +0 -0
  119. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/utils/dif_upload.rs +0 -0
  120. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/utils/event.rs +0 -0
  121. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/utils/file_search.rs +0 -0
  122. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/utils/file_upload.rs +0 -0
  123. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/utils/formatting.rs +0 -0
  124. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/utils/fs.rs +0 -0
  125. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/utils/http.rs +0 -0
  126. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/utils/logging.rs +0 -0
  127. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/utils/metrics.rs +0 -0
  128. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/utils/mod.rs +0 -0
  129. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/utils/progress.rs +0 -0
  130. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/utils/releases.rs +0 -0
  131. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/utils/retry.rs +0 -0
  132. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/utils/snapshots/sentry_cli__utils__vcs__generate_patch_default_twenty.snap +0 -0
  133. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/utils/snapshots/sentry_cli__utils__vcs__generate_patch_ignore_missing.snap +0 -0
  134. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/utils/snapshots/sentry_cli__utils__vcs__generate_patch_set_base.snap +0 -0
  135. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/utils/snapshots/sentry_cli__utils__vcs__generate_patch_set_previous_commit.snap +0 -0
  136. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/utils/snapshots/sentry_cli__utils__vcs__get_commits_from_git.snap +0 -0
  137. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/utils/sourcemaps/inject.rs +0 -0
  138. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/utils/sourcemaps.rs +0 -0
  139. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/utils/system.rs +0 -0
  140. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/utils/ui.rs +0 -0
  141. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/utils/update.rs +0 -0
  142. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/utils/value_parsers.rs +0 -0
  143. {sentry_cli-2.36.6 → sentry_cli-2.37.0}/src/utils/vcs.rs +0 -0
@@ -2422,7 +2422,7 @@ dependencies = [
2422
2422
 
2423
2423
  [[package]]
2424
2424
  name = "sentry-cli"
2425
- version = "2.36.6"
2425
+ version = "2.37.0"
2426
2426
  dependencies = [
2427
2427
  "anyhow",
2428
2428
  "anylog",
@@ -2,7 +2,7 @@
2
2
  authors = ["Armin Ronacher <armin.ronacher@active-4.com>"]
3
3
  build = "build.rs"
4
4
  name = "sentry-cli"
5
- version = "2.36.6"
5
+ version = "2.37.0"
6
6
  edition = "2021"
7
7
  rust-version = "1.65"
8
8
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sentry_cli
3
- Version: 2.36.6
3
+ Version: 2.37.0
4
4
  Summary: A command line utility to work with Sentry.
5
5
  Home-page: https://github.com/getsentry/sentry-cli
6
6
  Author: Sentry
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sentry_cli
3
- Version: 2.36.6
3
+ Version: 2.37.0
4
4
  Summary: A command line utility to work with Sentry.
5
5
  Home-page: https://github.com/getsentry/sentry-cli
6
6
  Author: Sentry
@@ -16,7 +16,7 @@ use crate::utils::args::ArgExt;
16
16
  use crate::utils::dif::{DifType, ObjectDifFeatures};
17
17
  use crate::utils::dif_upload::{DifFormat, DifUpload};
18
18
  use crate::utils::system::QuietExit;
19
- use crate::utils::xcode::{InfoPlist, MayDetach};
19
+ use crate::utils::xcode::InfoPlist;
20
20
 
21
21
  static DERIVED_DATA_FOLDER: &str = "Library/Developer/Xcode/DerivedData";
22
22
 
@@ -152,15 +152,12 @@ pub fn make_command(command: Command) -> Command {
152
152
  )
153
153
  .arg(
154
154
  Arg::new("force_foreground")
155
+ .hide(true)
155
156
  .long("force-foreground")
156
157
  .action(ArgAction::SetTrue)
157
158
  .help(
158
- "Wait for the process to finish.{n}\
159
- By default, the upload process will detach and continue in the \
160
- background when triggered from Xcode. When an error happens, \
161
- a dialog is shown. If this parameter is passed Xcode will wait \
162
- for the process to finish before the build finishes and output \
163
- will be shown in the Xcode build output.",
159
+ "DEPRECATED: Foreground uploads are now the default behavior.{n}\
160
+ This flag has no effect and will be removed in a future version.",
164
161
  ),
165
162
  )
166
163
  .arg(
@@ -306,45 +303,38 @@ pub fn execute(matches: &ArgMatches) -> Result<()> {
306
303
  return Ok(());
307
304
  }
308
305
 
309
- MayDetach::wrap("Debug symbol upload", |handle| {
310
- // Optionally detach if run from Xcode
311
- if !matches.get_flag("force_foreground") {
312
- handle.may_detach()?;
313
- }
314
-
315
- // Execute the upload
316
- let (uploaded, has_processing_errors) = upload.upload()?;
317
-
318
- // Did we miss explicitly requested symbols?
319
- if matches.get_flag("require_all") {
320
- let required_ids: BTreeSet<DebugId> = matches
321
- .get_many::<DebugId>("ids")
322
- .unwrap_or_default()
323
- .cloned()
324
- .collect();
306
+ // Execute the upload
307
+ let (uploaded, has_processing_errors) = upload.upload()?;
325
308
 
326
- let found_ids = uploaded.into_iter().map(|dif| dif.id()).collect();
327
- let missing_ids: Vec<_> = required_ids.difference(&found_ids).collect();
309
+ // Did we miss explicitly requested symbols?
310
+ if matches.get_flag("require_all") {
311
+ let required_ids: BTreeSet<DebugId> = matches
312
+ .get_many::<DebugId>("ids")
313
+ .unwrap_or_default()
314
+ .cloned()
315
+ .collect();
328
316
 
329
- if !missing_ids.is_empty() {
330
- eprintln!();
331
- eprintln!("{}", style("Error: Some symbols could not be found!").red());
332
- eprintln!("The following symbols are still missing:");
333
- for id in missing_ids {
334
- println!(" {id}");
335
- }
317
+ let found_ids = uploaded.into_iter().map(|dif| dif.id()).collect();
318
+ let missing_ids: Vec<_> = required_ids.difference(&found_ids).collect();
336
319
 
337
- return Err(QuietExit(1).into());
320
+ if !missing_ids.is_empty() {
321
+ eprintln!();
322
+ eprintln!("{}", style("Error: Some symbols could not be found!").red());
323
+ eprintln!("The following symbols are still missing:");
324
+ for id in missing_ids {
325
+ println!(" {id}");
338
326
  }
339
- }
340
327
 
341
- // report a non 0 status code if the server encountered issues.
342
- if has_processing_errors {
343
- eprintln!();
344
- eprintln!("{}", style("Error: some symbols did not process correctly"));
345
328
  return Err(QuietExit(1).into());
346
329
  }
330
+ }
331
+
332
+ // report a non 0 status code if the server encountered issues.
333
+ if has_processing_errors {
334
+ eprintln!();
335
+ eprintln!("{}", style("Error: some symbols did not process correctly"));
336
+ return Err(QuietExit(1).into());
337
+ }
347
338
 
348
- Ok(())
349
- })
339
+ Ok(())
350
340
  }
@@ -22,7 +22,7 @@ use crate::utils::file_upload::UploadContext;
22
22
  use crate::utils::fs::TempFile;
23
23
  use crate::utils::sourcemaps::SourceMapProcessor;
24
24
  use crate::utils::system::propagate_exit_status;
25
- use crate::utils::xcode::{InfoPlist, MayDetach};
25
+ use crate::utils::xcode::InfoPlist;
26
26
 
27
27
  #[derive(Serialize, Deserialize, Default, Debug)]
28
28
  struct SourceMapReport {
@@ -207,197 +207,197 @@ pub fn execute(matches: &ArgMatches) -> Result<()> {
207
207
  let hermesc = find_hermesc();
208
208
  info!("Using hermesc interpreter '{}'", &hermesc);
209
209
 
210
- MayDetach::wrap("React native symbol handling", |md| {
211
- let bundle_path;
212
- let sourcemap_path;
213
- let bundle_url;
214
- let sourcemap_url;
215
- let bundle_file;
216
- let sourcemap_file;
217
-
218
- // If we have a fetch URL we need to fetch them from there now. In that
219
- // case we do indeed fetch it right from the running packager and then
220
- // store it in temporary files for later consumption.
221
- if let Some(url) = fetch_url {
222
- if !matches.get_flag("force_foreground") {
223
- md.may_detach()?;
224
- }
225
- let api = Api::current();
226
- let url = url.trim_end_matches('/');
227
- bundle_file = TempFile::create()?;
228
- bundle_path = bundle_file.path().to_path_buf();
229
- bundle_url = "~/index.ios.bundle".to_string();
230
- sourcemap_file = TempFile::create()?;
231
- sourcemap_path = sourcemap_file.path().to_path_buf();
232
- sourcemap_url = "~/index.ios.map".to_string();
233
-
234
- // wait up to 10 seconds for the server to be up.
235
- if !api.wait_until_available(url, Duration::seconds(10))? {
236
- bail!("Error: react-native packager did not respond in time");
237
- }
238
-
239
- api.download(
240
- &format!("{url}/index.ios.bundle?platform=ios&dev=true"),
241
- &mut bundle_file.open()?,
242
- )?;
243
- api.download(
244
- &format!("{url}/index.ios.map?platform=ios&dev=true"),
245
- &mut sourcemap_file.open()?,
246
- )?;
247
-
248
- // This is the case where we need to hook into the release process to
249
- // collect sourcemaps when they are generated.
250
- //
251
- // this invokes via an indirection of sentry-cli our wrap_call() below.
252
- // What is happening behind the scenes is that we switch out NODE_BINARY
253
- // for ourselves which is what the react-native build script normally
254
- // invokes. Because we export __SENTRY_RN_WRAP_XCODE_CALL=1, the main
255
- // sentry-cli script will invoke our wrap_call() function below.
256
- //
257
- // That will then attempt to figure out that a react-native bundle is
258
- // happening to the build script, parse out the arguments, add additional
259
- // arguments if needed and then report the parsed arguments to a temporary
260
- // JSON file we load back below.
261
- //
262
- // We do the same for Hermes Compiler to retrieve the bundle file and
263
- // the same for the combine source maps for the final Hermes source map.
264
- //
265
- // With that we we then have all the information we need to invoke the
266
- // upload process.
267
- } else {
268
- let mut command = process::Command::new(&script);
269
- command
270
- .env("NODE_BINARY", env::current_exe()?.to_str().unwrap())
271
- .env("SENTRY_RN_REAL_NODE_BINARY", &node)
272
- .env(
273
- "SENTRY_RN_SOURCEMAP_REPORT",
274
- report_file.path().to_str().unwrap(),
275
- )
276
- .env("__SENTRY_RN_WRAP_XCODE_CALL", "1");
277
-
278
- if is_hermes_enabled(&hermesc) {
279
- command
280
- .env("HERMES_CLI_PATH", env::current_exe()?.to_str().unwrap())
281
- .env("SENTRY_RN_REAL_HERMES_CLI_PATH", &hermesc);
282
- }
283
-
284
- let rv = command.spawn()?.wait()?;
285
- propagate_exit_status(rv);
286
-
287
- if !matches.get_flag("force_foreground") {
288
- md.may_detach()?;
289
- }
290
- let mut f = fs::File::open(report_file.path())?;
291
- let report: SourceMapReport = serde_json::from_reader(&mut f).unwrap_or_else(|_| {
292
- let format_err = format!(
293
- "File {} doesn't contain a valid JSON data.",
294
- report_file.path().display()
295
- );
296
- panic!("{}", format_err);
297
- });
298
- let (Some(packager_bundle_path), Some(packager_sourcemap_path)) =
299
- (report.packager_bundle_path, report.packager_sourcemap_path)
300
- else {
301
- println!("Warning: build produced no packager sourcemaps.");
302
- return Ok(());
303
- };
304
-
305
- // If Hermes emitted source map we have to use it
306
- if let (Some(hermes_bundle_path), Some(hermes_sourcemap_path)) =
307
- (report.hermes_bundle_path, report.hermes_sourcemap_path)
308
- {
309
- bundle_path = hermes_bundle_path.clone();
310
- sourcemap_path = hermes_sourcemap_path.clone();
311
- println!("Using Hermes bundle and combined source map.");
312
-
313
- // If Hermes emitted only bundle or Hermes was disabled use packager bundle and source map
314
- } else {
315
- bundle_path = packager_bundle_path;
316
- sourcemap_path = packager_sourcemap_path;
317
- println!("Using React Native Packager bundle and source map.");
318
- }
319
- bundle_url = format!("~/{}", bundle_path.file_name().unwrap().to_string_lossy());
320
- sourcemap_url = format!(
321
- "~/{}",
322
- sourcemap_path.file_name().unwrap().to_string_lossy()
323
- );
210
+ let bundle_path;
211
+ let sourcemap_path;
212
+ let bundle_url;
213
+ let sourcemap_url;
214
+ let bundle_file;
215
+ let sourcemap_file;
216
+
217
+ // If we have a fetch URL we need to fetch them from there now. In that
218
+ // case we do indeed fetch it right from the running packager and then
219
+ // store it in temporary files for later consumption.
220
+ if let Some(url) = fetch_url {
221
+ let api = Api::current();
222
+ let url = url.trim_end_matches('/');
223
+ bundle_file = TempFile::create()?;
224
+ bundle_path = bundle_file.path().to_path_buf();
225
+ bundle_url = "~/index.ios.bundle".to_string();
226
+ sourcemap_file = TempFile::create()?;
227
+ sourcemap_path = sourcemap_file.path().to_path_buf();
228
+ sourcemap_url = "~/index.ios.map".to_string();
229
+
230
+ // wait up to 10 seconds for the server to be up.
231
+ if !api.wait_until_available(url, Duration::seconds(10))? {
232
+ bail!("Error: react-native packager did not respond in time");
324
233
  }
325
234
 
326
- // now that we have all the data, we can now process and upload the
327
- // sourcemaps.
328
- println!("Processing react-native sourcemaps for Sentry upload.");
329
- info!(" bundle path: {}", bundle_path.display());
330
- info!(" sourcemap path: {}", sourcemap_path.display());
331
-
332
- let mut processor = SourceMapProcessor::new();
333
- processor.add(&bundle_url, ReleaseFileSearch::collect_file(bundle_path)?)?;
334
- processor.add(
335
- &sourcemap_url,
336
- ReleaseFileSearch::collect_file(sourcemap_path)?,
235
+ api.download(
236
+ &format!("{url}/index.ios.bundle?platform=ios&dev=true"),
237
+ &mut bundle_file.open()?,
238
+ )?;
239
+ api.download(
240
+ &format!("{url}/index.ios.map?platform=ios&dev=true"),
241
+ &mut sourcemap_file.open()?,
337
242
  )?;
338
- processor.rewrite(&[base.parent().unwrap().to_str().unwrap()])?;
339
- processor.add_sourcemap_references()?;
340
- processor.add_debug_id_references()?;
341
243
 
342
- let api = Api::current();
343
- let chunk_upload_options = api.authenticated()?.get_chunk_upload_options(&org)?;
244
+ // This is the case where we need to hook into the release process to
245
+ // collect sourcemaps when they are generated.
246
+ //
247
+ // this invokes via an indirection of sentry-cli our wrap_call() below.
248
+ // What is happening behind the scenes is that we switch out NODE_BINARY
249
+ // for ourselves which is what the react-native build script normally
250
+ // invokes. Because we export __SENTRY_RN_WRAP_XCODE_CALL=1, the main
251
+ // sentry-cli script will invoke our wrap_call() function below.
252
+ //
253
+ // That will then attempt to figure out that a react-native bundle is
254
+ // happening to the build script, parse out the arguments, add additional
255
+ // arguments if needed and then report the parsed arguments to a temporary
256
+ // JSON file we load back below.
257
+ //
258
+ // We do the same for Hermes Compiler to retrieve the bundle file and
259
+ // the same for the combine source maps for the final Hermes source map.
260
+ //
261
+ // With that we we then have all the information we need to invoke the
262
+ // upload process.
263
+ } else {
264
+ let mut command = process::Command::new(&script);
265
+ command
266
+ .env("NODE_BINARY", env::current_exe()?.to_str().unwrap())
267
+ .env("SENTRY_RN_REAL_NODE_BINARY", &node)
268
+ .env(
269
+ "SENTRY_RN_SOURCEMAP_REPORT",
270
+ report_file.path().to_str().unwrap(),
271
+ )
272
+ .env("__SENTRY_RN_WRAP_XCODE_CALL", "1");
273
+
274
+ if is_hermes_enabled(&hermesc) {
275
+ command
276
+ .env("HERMES_CLI_PATH", env::current_exe()?.to_str().unwrap())
277
+ .env("SENTRY_RN_REAL_HERMES_CLI_PATH", &hermesc);
278
+ }
344
279
 
345
- let dist_from_env = env::var("SENTRY_DIST");
346
- let release_from_env = env::var("SENTRY_RELEASE");
280
+ let rv = command.spawn()?.wait()?;
281
+ propagate_exit_status(rv);
347
282
 
348
- let wait_for_secs = matches.get_one::<u64>("wait_for").copied();
349
- let wait = matches.get_flag("wait") || wait_for_secs.is_some();
350
- let max_wait = wait_for_secs.map_or(DEFAULT_MAX_WAIT, std::time::Duration::from_secs);
283
+ let mut f = fs::File::open(report_file.path())?;
284
+ let report: SourceMapReport = serde_json::from_reader(&mut f).unwrap_or_else(|_| {
285
+ let format_err = format!(
286
+ "File {} doesn't contain a valid JSON data.",
287
+ report_file.path().display()
288
+ );
289
+ panic!("{}", format_err);
290
+ });
291
+ let (Some(packager_bundle_path), Some(packager_sourcemap_path)) =
292
+ (report.packager_bundle_path, report.packager_sourcemap_path)
293
+ else {
294
+ println!("Warning: build produced no packager sourcemaps.");
295
+ return Ok(());
296
+ };
351
297
 
352
- if dist_from_env.is_err()
353
- && release_from_env.is_err()
354
- && matches.get_flag("no_auto_release")
298
+ // If Hermes emitted source map we have to use it
299
+ if let (Some(hermes_bundle_path), Some(hermes_sourcemap_path)) =
300
+ (report.hermes_bundle_path, report.hermes_sourcemap_path)
355
301
  {
356
- processor.upload(&UploadContext {
357
- org: &org,
358
- project: Some(&project),
359
- release: None,
360
- dist: None,
361
- note: None,
362
- wait,
363
- max_wait,
364
- dedupe: false,
365
- chunk_upload_options: chunk_upload_options.as_ref(),
366
- })?;
302
+ bundle_path = hermes_bundle_path.clone();
303
+ sourcemap_path = hermes_sourcemap_path.clone();
304
+ println!("Using Hermes bundle and combined source map.");
305
+
306
+ // If Hermes emitted only bundle or Hermes was disabled use packager bundle and source map
367
307
  } else {
368
- let (dist, release_name) = match (&dist_from_env, &release_from_env) {
369
- (Err(_), Err(_)) => {
370
- // Neither environment variable is present, attempt to parse Info.plist
371
- info!("Parsing Info.plist");
372
- match InfoPlist::discover_from_env() {
373
- Ok(Some(plist)) => {
374
- // Successfully discovered and parsed Info.plist
375
- let dist_string = plist.build().to_string();
376
- let release_string = format!(
377
- "{}@{}+{}",
378
- plist.bundle_id(),
379
- plist.version(),
380
- dist_string
381
- );
382
- info!("Parse result from Info.plist: {:?}", &plist);
383
- (Some(dist_string), Some(release_string))
384
- }
385
- _ => {
386
- bail!("Info.plist was not found or an parsing error occurred");
387
- }
308
+ bundle_path = packager_bundle_path;
309
+ sourcemap_path = packager_sourcemap_path;
310
+ println!("Using React Native Packager bundle and source map.");
311
+ }
312
+ bundle_url = format!("~/{}", bundle_path.file_name().unwrap().to_string_lossy());
313
+ sourcemap_url = format!(
314
+ "~/{}",
315
+ sourcemap_path.file_name().unwrap().to_string_lossy()
316
+ );
317
+ }
318
+
319
+ // now that we have all the data, we can now process and upload the
320
+ // sourcemaps.
321
+ println!("Processing react-native sourcemaps for Sentry upload.");
322
+ info!(" bundle path: {}", bundle_path.display());
323
+ info!(" sourcemap path: {}", sourcemap_path.display());
324
+
325
+ let mut processor = SourceMapProcessor::new();
326
+ processor.add(&bundle_url, ReleaseFileSearch::collect_file(bundle_path)?)?;
327
+ processor.add(
328
+ &sourcemap_url,
329
+ ReleaseFileSearch::collect_file(sourcemap_path)?,
330
+ )?;
331
+ processor.rewrite(&[base.parent().unwrap().to_str().unwrap()])?;
332
+ processor.add_sourcemap_references()?;
333
+ processor.add_debug_id_references()?;
334
+
335
+ let api = Api::current();
336
+ let chunk_upload_options = api.authenticated()?.get_chunk_upload_options(&org)?;
337
+
338
+ let dist_from_env = env::var("SENTRY_DIST");
339
+ let release_from_env = env::var("SENTRY_RELEASE");
340
+
341
+ let wait_for_secs = matches.get_one::<u64>("wait_for").copied();
342
+ let wait = matches.get_flag("wait") || wait_for_secs.is_some();
343
+ let max_wait = wait_for_secs.map_or(DEFAULT_MAX_WAIT, std::time::Duration::from_secs);
344
+
345
+ if dist_from_env.is_err() && release_from_env.is_err() && matches.get_flag("no_auto_release") {
346
+ processor.upload(&UploadContext {
347
+ org: &org,
348
+ project: Some(&project),
349
+ release: None,
350
+ dist: None,
351
+ note: None,
352
+ wait,
353
+ max_wait,
354
+ dedupe: false,
355
+ chunk_upload_options: chunk_upload_options.as_ref(),
356
+ })?;
357
+ } else {
358
+ let (dist, release_name) = match (&dist_from_env, &release_from_env) {
359
+ (Err(_), Err(_)) => {
360
+ // Neither environment variable is present, attempt to parse Info.plist
361
+ info!("Parsing Info.plist");
362
+ match InfoPlist::discover_from_env() {
363
+ Ok(Some(plist)) => {
364
+ // Successfully discovered and parsed Info.plist
365
+ let dist_string = plist.build().to_string();
366
+ let release_string =
367
+ format!("{}@{}+{}", plist.bundle_id(), plist.version(), dist_string);
368
+ info!("Parse result from Info.plist: {:?}", &plist);
369
+ (Some(dist_string), Some(release_string))
370
+ }
371
+ _ => {
372
+ bail!("Info.plist was not found or an parsing error occurred");
388
373
  }
389
374
  }
390
- // At least one environment variable is present, use the values from the environment
391
- _ => (dist_from_env.ok(), release_from_env.ok()),
392
- };
375
+ }
376
+ // At least one environment variable is present, use the values from the environment
377
+ _ => (dist_from_env.ok(), release_from_env.ok()),
378
+ };
393
379
 
394
- match matches.get_many::<String>("dist") {
395
- None => {
380
+ match matches.get_many::<String>("dist") {
381
+ None => {
382
+ processor.upload(&UploadContext {
383
+ org: &org,
384
+ project: Some(&project),
385
+ release: release_name.as_deref(),
386
+ dist: dist.as_deref(),
387
+ note: None,
388
+ wait,
389
+ max_wait,
390
+ dedupe: false,
391
+ chunk_upload_options: chunk_upload_options.as_ref(),
392
+ })?;
393
+ }
394
+ Some(dists) => {
395
+ for dist in dists {
396
396
  processor.upload(&UploadContext {
397
397
  org: &org,
398
398
  project: Some(&project),
399
399
  release: release_name.as_deref(),
400
- dist: dist.as_deref(),
400
+ dist: Some(dist),
401
401
  note: None,
402
402
  wait,
403
403
  max_wait,
@@ -405,26 +405,11 @@ pub fn execute(matches: &ArgMatches) -> Result<()> {
405
405
  chunk_upload_options: chunk_upload_options.as_ref(),
406
406
  })?;
407
407
  }
408
- Some(dists) => {
409
- for dist in dists {
410
- processor.upload(&UploadContext {
411
- org: &org,
412
- project: Some(&project),
413
- release: release_name.as_deref(),
414
- dist: Some(dist),
415
- note: None,
416
- wait,
417
- max_wait,
418
- dedupe: false,
419
- chunk_upload_options: chunk_upload_options.as_ref(),
420
- })?;
421
- }
422
- }
423
408
  }
424
409
  }
410
+ }
425
411
 
426
- Ok(())
427
- })
412
+ Ok(())
428
413
  }
429
414
 
430
415
  pub fn wrap_call() -> Result<()> {
@@ -439,17 +439,6 @@ impl Config {
439
439
  )
440
440
  }
441
441
 
442
- /// Returns true if notifications should be displayed.
443
- /// We only use this function in the macOS binary.
444
- #[cfg(target_os = "macos")]
445
- pub fn show_notifications(&self) -> Result<bool> {
446
- Ok(self
447
- .ini
448
- .get_from(Some("ui"), "show_notifications")
449
- .map(|x| x == "true")
450
- .unwrap_or(true))
451
- }
452
-
453
442
  /// Returns the maximum DIF upload size
454
443
  pub fn get_max_dif_archive_size(&self) -> u64 {
455
444
  let key = "max_upload_size";