Skip to content

Commit a994556

Browse files
Merge remote-tracking branch 'origin/master' into szokeasaurusrex/remove-backoff
2 parents dd95553 + e700c2a commit a994556

77 files changed

Lines changed: 1002 additions & 937 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Cargo.lock

Lines changed: 843 additions & 722 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ ignore = "0.4.20"
3939
# Do not update due to https://github.com/console-rs/indicatif/issues/317 and https://github.com/getsentry/sentry-cli/pull/1055
4040
indicatif = "0.14.0"
4141
itertools = "0.10.5"
42-
java-properties = "1.4.1"
42+
java-properties = "2.0.0"
4343
lazy_static = "1.4.0"
4444
libc = "0.2.139"
4545
log = { version = "0.4.17", features = ["std"] }

src/api/mod.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -339,12 +339,12 @@ impl Api {
339339
};
340340

341341
let ref_name = format!("sentry-cli-{}-{arch}{EXT}", capitalize_string(PLATFORM));
342-
info!("Looking for file named: {}", ref_name);
342+
info!("Looking for file named: {ref_name}");
343343

344344
if resp.status() == 200 {
345345
let info: RegistryRelease = resp.convert()?;
346346
for (filename, _download_url) in info.file_urls {
347-
info!("Found asset {}", filename);
347+
info!("Found asset {filename}");
348348
if filename == ref_name {
349349
return Ok(Some(SentryCliRelease {
350350
version: info.version,
@@ -1728,7 +1728,7 @@ impl ApiRequest {
17281728

17291729
match pipeline_env {
17301730
Some(env) => {
1731-
debug!("pipeline: {}", env);
1731+
debug!("pipeline: {env}");
17321732
headers
17331733
.append(&format!("User-Agent: sentry-cli/{VERSION} {env}"))
17341734
.ok();
@@ -1817,7 +1817,7 @@ impl ApiRequest {
18171817

18181818
/// enables or disables redirects. The default is off.
18191819
pub fn follow_location(mut self, val: bool) -> ApiResult<Self> {
1820-
debug!("follow redirects: {}", val);
1820+
debug!("follow redirects: {val}");
18211821
self.handle.follow_location(val)?;
18221822
Ok(self)
18231823
}
@@ -1918,7 +1918,7 @@ impl ApiResponse {
19181918
pub fn into_result(self) -> ApiResult<Self> {
19191919
if let Some(ref body) = self.body {
19201920
let body = String::from_utf8_lossy(body);
1921-
debug!("body: {}", body);
1921+
debug!("body: {body}");
19221922
}
19231923
if self.ok() {
19241924
return Ok(self);
@@ -2055,7 +2055,7 @@ fn log_headers(is_response: bool, data: &[u8]) {
20552055
};
20562056
format!("{}: {} {info}", &caps[1], &caps[2])
20572057
});
2058-
debug!("{} {}", if is_response { ">" } else { "<" }, replaced);
2058+
debug!("{} {replaced}", if is_response { ">" } else { "<" });
20592059
}
20602060
}
20612061
}

src/commands/build/upload.rs

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -161,14 +161,11 @@ pub fn execute(matches: &ArgMatches) -> Result<()> {
161161
repo_ref
162162
.and_then(|r| match git_repo_head_ref(r) {
163163
Ok(ref_name) => {
164-
debug!("Found current branch reference: {}", ref_name);
164+
debug!("Found current branch reference: {ref_name}");
165165
Some(ref_name)
166166
}
167167
Err(e) => {
168-
debug!(
169-
"No valid branch reference found (likely detached HEAD): {}",
170-
e
171-
);
168+
debug!("No valid branch reference found (likely detached HEAD): {e}");
172169
None
173170
}
174171
})
@@ -188,11 +185,11 @@ pub fn execute(matches: &ArgMatches) -> Result<()> {
188185
repo_ref
189186
.and_then(|r| match git_repo_base_ref(r, &cached_remote) {
190187
Ok(base_ref_name) => {
191-
debug!("Found base reference: {}", base_ref_name);
188+
debug!("Found base reference: {base_ref_name}");
192189
Some(base_ref_name)
193190
}
194191
Err(e) => {
195-
info!("Could not detect base branch reference: {}", e);
192+
info!("Could not detect base branch reference: {e}");
196193
None
197194
}
198195
})
@@ -208,15 +205,15 @@ pub fn execute(matches: &ArgMatches) -> Result<()> {
208205
repo_ref
209206
.and_then(|r| match git_repo_base_repo_name_preserve_case(r) {
210207
Ok(Some(base_repo_name)) => {
211-
debug!("Found base repository name: {}", base_repo_name);
208+
debug!("Found base repository name: {base_repo_name}");
212209
Some(base_repo_name)
213210
}
214211
Ok(None) => {
215212
debug!("No base repository found - not a fork");
216213
None
217214
}
218215
Err(e) => {
219-
warn!("Could not detect base repository name: {}", e);
216+
warn!("Could not detect base repository name: {e}");
220217
None
221218
}
222219
})
@@ -237,7 +234,7 @@ pub fn execute(matches: &ArgMatches) -> Result<()> {
237234
.map(Cow::Borrowed)
238235
.or_else(|| {
239236
vcs::find_base_sha()
240-
.inspect_err(|e| debug!("Error finding base SHA: {}", e))
237+
.inspect_err(|e| debug!("Error finding base SHA: {e}"))
241238
.ok()
242239
.flatten()
243240
.map(Cow::Owned)
@@ -326,7 +323,7 @@ pub fn execute(matches: &ArgMatches) -> Result<()> {
326323
uploaded_paths_and_urls.push((path.to_path_buf(), artifact_url));
327324
}
328325
Err(e) => {
329-
debug!("Failed to upload file at path {}: {}", path.display(), e);
326+
debug!("Failed to upload file at path {}: {e}", path.display());
330327
errored_paths_and_reasons.push((path.to_path_buf(), e));
331328
}
332329
}
@@ -446,7 +443,7 @@ fn normalize_file(path: &Path, bytes: &[u8]) -> Result<TempFile> {
446443
.to_str()
447444
.with_context(|| format!("Failed to get relative path for {}", path.display()))?;
448445

449-
debug!("Adding file to zip: {}", file_name);
446+
debug!("Adding file to zip: {file_name}");
450447

451448
// Need to set the last modified time to a fixed value to ensure consistent checksums
452449
// This is important as an optimization to avoid re-uploading the same chunks if they're already on the server
@@ -486,11 +483,8 @@ fn upload_file(
486483
update to the latest version of Sentry to use the build upload command.";
487484

488485
debug!(
489-
"Uploading file to organization: {}, project: {}, build_configuration: {}, vcs_info: {:?}",
490-
org,
491-
project,
486+
"Uploading file to organization: {org}, project: {project}, build_configuration: {}, vcs_info: {vcs_info:?}",
492487
build_configuration.unwrap_or("unknown"),
493-
vcs_info,
494488
);
495489

496490
let chunk_upload_options = api.get_chunk_upload_options(org)?.ok_or_else(|| {
@@ -569,7 +563,7 @@ fn upload_file(
569563
// true for ChunkedFileState::NotFound.
570564
if response.state == ChunkedFileState::Error {
571565
let message = response.detail.as_deref().unwrap_or("unknown error");
572-
bail!("Failed to process uploaded files: {}", message);
566+
bail!("Failed to process uploaded files: {message}");
573567
}
574568

575569
if let Some(artifact_url) = response.artifact_url {

src/commands/dart_symbol_map/upload.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@ pub(super) fn execute(args: DartSymbolMapUploadArgs) -> Result<()> {
7878
ids.dedup();
7979
match ids.len() {
8080
0 => bail!(
81-
"No debug identifier found in the provided debug file ({}). Ensure the file contains an embedded Debug ID.",
82-
debug_file_path
81+
"No debug identifier found in the provided debug file ({debug_file_path}). Ensure the file contains an embedded Debug ID."
8382
),
8483
1 => {
8584
let debug_id = ids.remove(0);
@@ -153,10 +152,7 @@ pub(super) fn execute(args: DartSymbolMapUploadArgs) -> Result<()> {
153152

154153
if (mapping_len as u64) > effective_max_file_size {
155154
bail!(
156-
"The dartsymbolmap '{}' exceeds the maximum allowed size ({} bytes > {} bytes).",
157-
mapping_path,
158-
mapping_len,
159-
effective_max_file_size
155+
"The dartsymbolmap '{mapping_path}' exceeds the maximum allowed size ({mapping_len} bytes > {effective_max_file_size} bytes)."
160156
);
161157
}
162158

@@ -172,8 +168,7 @@ pub(super) fn execute(args: DartSymbolMapUploadArgs) -> Result<()> {
172168
Ok(())
173169
}
174170
_ => bail!(
175-
"Multiple debug identifiers found in the provided debug file ({}): {}. Please provide a file that contains a single Debug ID.",
176-
debug_file_path,
171+
"Multiple debug identifiers found in the provided debug file ({debug_file_path}): {}. Please provide a file that contains a single Debug ID.",
177172
ids.into_iter().map(|id| id.to_string()).collect::<Vec<_>>().join(", ")
178173
),
179174
}

src/commands/debug_files/upload.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ pub fn execute(matches: &ArgMatches) -> Result<()> {
251251
upload.filter_format(DifFormat::BcSymbolMap);
252252
upload.filter_format(DifFormat::PList)
253253
}
254-
other => bail!("Unsupported type: {}", other),
254+
other => bail!("Unsupported type: {other}"),
255255
};
256256
}
257257

src/commands/files/upload.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ pub fn execute(matches: &ArgMatches) -> Result<()> {
239239

240240
if matches.get_flag("decompress") && is_gzip_compressed(&contents) {
241241
contents = decompress_gzip_content(&contents).unwrap_or_else(|_| {
242-
warn!("Could not decompress: {}", name);
242+
warn!("Could not decompress: {name}");
243243
contents
244244
});
245245
}

src/commands/mod.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -288,10 +288,7 @@ pub fn execute() -> Result<()> {
288288
);
289289
}
290290

291-
debug!(
292-
"sentry-cli version: {}, platform: \"{}\", architecture: \"{}\"",
293-
VERSION, PLATFORM, ARCH
294-
);
291+
debug!("sentry-cli version: {VERSION}, platform: \"{PLATFORM}\", architecture: \"{ARCH}\"");
295292

296293
info!(
297294
"sentry-cli was invoked with the following command line: {}",
@@ -358,7 +355,7 @@ fn setup() {
358355
set_logger(&Logger).unwrap();
359356

360357
if let Err(e) = load_dotenv_result {
361-
log::warn!("Failed to load .env file: {}", e);
358+
log::warn!("Failed to load .env file: {e}");
362359
}
363360
}
364361

src/commands/organizations/list.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub fn execute(_matches: &ArgMatches) -> Result<()> {
1717
let regions = authenticated_api.list_available_regions()?;
1818

1919
let mut organizations: Vec<Organization> = vec![];
20-
debug!("Available regions: {:?}", regions);
20+
debug!("Available regions: {regions:?}");
2121

2222
// Self-hosted instances won't have a region instance or prefix, so we
2323
// need to check before fanning out.

src/commands/releases/set_commits.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,18 +117,15 @@ pub fn execute(matches: &ArgMatches) -> Result<()> {
117117

118118
if commit_spec.rev.len() > MAX_COMMIT_SHA_LENGTH {
119119
bail!(
120-
"Invalid commit SHA '{}'. Commit SHAs must be {} characters or less.",
121-
commit_spec.rev,
122-
MAX_COMMIT_SHA_LENGTH
120+
"Invalid commit SHA '{}'. Commit SHAs must be {MAX_COMMIT_SHA_LENGTH} characters or less.",
121+
commit_spec.rev
123122
);
124123
}
125124

126125
if let Some(ref prev_rev) = commit_spec.prev_rev {
127126
if prev_rev.len() > MAX_COMMIT_SHA_LENGTH {
128127
bail!(
129-
"Invalid previous commit SHA '{}'. Commit SHAs must be {} characters or less.",
130-
prev_rev,
131-
MAX_COMMIT_SHA_LENGTH
128+
"Invalid previous commit SHA '{prev_rev}'. Commit SHAs must be {MAX_COMMIT_SHA_LENGTH} characters or less."
132129
);
133130
}
134131
}

0 commit comments

Comments
 (0)