From 2840c127d0e3d9696ce651a46443ba60a028c39c Mon Sep 17 00:00:00 2001 From: Daniel Szoke <7881302+szokeasaurusrex@users.noreply.github.com> Date: Tue, 21 Jan 2025 16:18:04 +0100 Subject: [PATCH 01/32] feat: Deprecate `useArtifactBundle` JS option (#2348) Also, update the documentation to more clearly state what the option even does. Ref #2347 --- js/index.d.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/js/index.d.ts b/js/index.d.ts index dd58f5dda7..0daa7e640f 100644 --- a/js/index.d.ts +++ b/js/index.d.ts @@ -133,7 +133,11 @@ declare module '@sentry/cli' { */ dist?: string; /** - * Use new Artifact Bundles upload, that enables use of Debug ID for Source Maps discovery. + * Force use of new Artifact Bundles upload, that enables use of Debug ID for Source Maps discovery, + * even when the Sentry server does not declare support for it. + * + * @deprecated This option is deprecated and will be removed in the next major version. Sentry CLI + * should always respect what the server says it supports. */ useArtifactBundle?: boolean; } From 83c0ab25a6da5172eb3b67261ca17a527929efc7 Mon Sep 17 00:00:00 2001 From: Daniel Szoke <7881302+szokeasaurusrex@users.noreply.github.com> Date: Tue, 21 Jan 2025 16:18:15 +0100 Subject: [PATCH 02/32] feat: Deprecate `--use-artifact-bundle` option (#2349) Fixes #2347 --- src/commands/sourcemaps/upload.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/commands/sourcemaps/upload.rs b/src/commands/sourcemaps/upload.rs index 0aba0ad5d4..b58b2f2c8b 100644 --- a/src/commands/sourcemaps/upload.rs +++ b/src/commands/sourcemaps/upload.rs @@ -224,14 +224,14 @@ pub fn make_command(command: Command) -> Command { uploaded.", ), ) - // NOTE: Hidden until we decide to expose it publicly .arg( Arg::new("use_artifact_bundle") .long("use-artifact-bundle") .action(ArgAction::SetTrue) .help( - "Use new Artifact Bundles upload, that enables the use of Debug IDs \ - for Source Maps discovery.", + "[DEPRECATED] Force artifact bundles to be used for upload, even when not \ + supported by the server. This option has always only been intended for \ + internal use, and it is now officially deprecated.", ) .hide(true), ) @@ -429,6 +429,9 @@ pub fn execute(matches: &ArgMatches) -> Result<()> { if matches.get_flag("use_artifact_bundle") || env::var("SENTRY_FORCE_ARTIFACT_BUNDLES").ok().as_deref() == Some("1") { + log::warn!("The --use-artifact-bundle option and the SENTRY_FORCE_ARTIFACT_BUNDLES environment variable \ + are both deprecated, and both will be removed in the next major version."); + if let Some(ref mut options) = chunk_upload_options { if !options.supports(ChunkUploadCapability::ArtifactBundles) { options.accept.push(ChunkUploadCapability::ArtifactBundles); From 8318213defd1da8c07fc4b41e47e265da9190cb4 Mon Sep 17 00:00:00 2001 From: Daniel Szoke <7881302+szokeasaurusrex@users.noreply.github.com> Date: Thu, 23 Jan 2025 11:32:46 +0100 Subject: [PATCH 03/32] docs: Correct typo in doc string (#2354) --- src/utils/system.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/system.rs b/src/utils/system.rs index d76e5b501e..586d94ab66 100644 --- a/src/utils/system.rs +++ b/src/utils/system.rs @@ -11,7 +11,7 @@ use regex::{Captures, Regex}; use crate::config::Config; -/// Propagate an exit status outwarts. +/// Propagate an exit status outwards. /// We only use this function in the macOS binary. #[cfg(target_os = "macos")] pub fn propagate_exit_status(status: process::ExitStatus) { From 4278c534f16d93ef1fb13338fbf387ffbd632df4 Mon Sep 17 00:00:00 2001 From: Daniel Szoke <7881302+szokeasaurusrex@users.noreply.github.com> Date: Thu, 23 Jan 2025 14:04:39 +0100 Subject: [PATCH 04/32] feat: Improve custom panic hook (#2355) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change improves Sentry CLI's panic hook to make panic messages more user-friendly. The panic message generated by the hook emphasizes that panics are internal errors in the Sentry CLI, and the message directs users to our bug report issue form. The message also always includes a stack backtrace, regardless of whether `RUST_BACKTRACE` is set. The new panic message looks like the following: ``` 🔥 Internal Error in Sentry CLI 🔥 Uh-oh! 😬 Sentry CLI has just crashed due to an internal error. Please open a bug report issue at https://github.com/getsentry/sentry-cli/issues/new?template=BUG_REPORT.yml. 🐞 🔬 Technical Details 🔬 thread 'main' panicked at src/commands/sourcemaps/upload.rs:422:5: test error Stack Backtrace: 0: std::backtrace_rs::backtrace::libunwind::trace at /rustc/9fc6b43126469e3858e2fe86cafb4f0fd5068869/library/std/src/../../backtrace/src/backtrace/libunwind.rs:116:5 1: std::backtrace_rs::backtrace::trace_unsynchronized at /rustc/9fc6b43126469e3858e2fe86cafb4f0fd5068869/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5 [... truncated ...] ``` This change also removes the dependency on the `backtrace` crate, and renames the function which sets the panic hook from `init_backtrace` to `set_panic_hook`. --- Cargo.lock | 1 - Cargo.toml | 1 - src/commands/mod.rs | 4 +- src/utils/system.rs | 101 ++++++++++++++++++++++++++++++-------------- 4 files changed, 72 insertions(+), 35 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 284ef7d110..f083b3086a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2567,7 +2567,6 @@ dependencies = [ "anylog", "assert_cmd", "backoff", - "backtrace", "brotli2", "bytecount", "chrono", diff --git a/Cargo.toml b/Cargo.toml index 38e2277c23..cd8c33a7a5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,6 @@ rust-version = "1.80" anylog = "0.6.3" anyhow = { version = "1.0.69", features = ["backtrace"] } backoff = "0.4.0" -backtrace = "0.3.67" brotli2 = "0.3.2" bytecount = "0.6.3" chrono = { version = "0.4.31", features = ["serde"] } diff --git a/src/commands/mod.rs b/src/commands/mod.rs index ee7ef5a9d0..0c7f6c999d 100644 --- a/src/commands/mod.rs +++ b/src/commands/mod.rs @@ -15,7 +15,7 @@ use crate::constants::{ARCH, PLATFORM, VERSION}; use crate::utils::auth_token::{redact_token_from_string, AuthToken}; use crate::utils::logging::set_quiet_mode; use crate::utils::logging::Logger; -use crate::utils::system::{init_backtrace, load_dotenv, print_error, QuietExit}; +use crate::utils::system::{load_dotenv, print_error, set_panic_hook, QuietExit}; use crate::utils::update::run_sentrycli_update_nagger; use crate::utils::value_parsers::auth_token_parser; @@ -331,7 +331,7 @@ pub fn execute() -> Result<()> { } fn setup() { - init_backtrace(); + set_panic_hook(); // Store the result of loading the dotenv file. We must load the dotenv file // before setting the log level, as the log level can be set in the dotenv diff --git a/src/utils/system.rs b/src/utils/system.rs index 586d94ab66..7ee8d77d21 100644 --- a/src/utils/system.rs +++ b/src/utils/system.rs @@ -1,7 +1,10 @@ +use std::any::Any; +use std::backtrace::Backtrace; use std::borrow::Cow; -use std::env; +use std::panic::{self, Location, PanicHookInfo}; #[cfg(target_os = "macos")] use std::process; +use std::{env, thread}; use anyhow::{Error, Result}; use console::style; @@ -91,36 +94,11 @@ pub fn print_error(err: &Error) { } } -/// Initializes the backtrace support -pub fn init_backtrace() { - std::panic::set_hook(Box::new(|info| { - let backtrace = backtrace::Backtrace::new(); - - let thread = std::thread::current(); - let thread = thread.name().unwrap_or("unnamed"); - - let msg = match info.payload().downcast_ref::<&'static str>() { - Some(s) => *s, - None => match info.payload().downcast_ref::() { - Some(s) => &**s, - None => "Box", - }, - }; - - match info.location() { - Some(location) => { - eprintln!( - "thread '{}' panicked at '{}': {}:{}\n\n{:?}", - thread, - msg, - location.file(), - location.line(), - backtrace - ); - } - None => eprintln!("thread '{thread}' panicked at '{msg}'{backtrace:?}"), - } - })); +/// Sets the panic hook to use our custom panic hook. +/// +/// See [panic_hook] for more details on how the custom panic hook behaves. +pub fn set_panic_hook() { + panic::set_hook(Box::new(panic_hook)); } /// Indicates that sentry-cli should quit without printing anything. @@ -154,3 +132,64 @@ pub fn load_dotenv() -> DotenvResult<()> { |_| Ok(()), ) } + +/// Custom panic hook for Sentry CLI +/// +/// This custom panic hook captures a more user-friendly panic message, which indicates +/// that the panic is an internal error in the Sentry CLI, and which directs users to +/// open a bug report issue when encountering a panic. +/// +/// The panic captures and prints a backtrace, regardless of whether the RUST_BACKTRACE +/// environment variable is set. +fn panic_hook(info: &PanicHookInfo) { + const PANIC_MESSAGE: &str = "Uh-oh! 😬 Sentry CLI has just crashed due to an internal error. \ + Please open a bug report issue at https://github.com/getsentry/sentry-cli/issues/new?template=BUG_REPORT.yml. 🐞"; + + eprintln!( + "{}\n\n{}\n\n{}", + console::style("🔥 Internal Error in Sentry CLI 🔥") + .bold() + .red(), + PANIC_MESSAGE, + display_technical_details(info, &Backtrace::force_capture()) + ); +} + +/// Generates the "technical details" section of the panic message +fn display_technical_details(info: &PanicHookInfo, backtrace: &Backtrace) -> String { + format!( + "🔬 Technical Details 🔬\n\n{} panicked at {}:\n{}\n\nStack Backtrace:\n{}", + display_thread_details(), + display_panic_location(info.location()), + display_panic_payload(info.payload()), + backtrace + ) +} + +/// Formats the current thread name for display in the panic message +fn display_thread_details() -> String { + match thread::current().name() { + Some(name) => format!("thread '{}'", name), + None => "unknown thread".into(), + } +} + +/// Formats the panic location for display in the panic message +fn display_panic_location(location: Option<&Location>) -> String { + if let Some(location) = location { + location.to_string() + } else { + "unknown location".into() + } +} + +/// Formats the panic payload for display in the panic message +fn display_panic_payload(payload: &dyn Any) -> &str { + if let Some(&payload) = payload.downcast_ref() { + payload + } else if let Some(payload) = payload.downcast_ref::() { + payload.as_str() + } else { + "" + } +} From 3cd4bd72b14cccd69d320c824682f7f8e502d62a Mon Sep 17 00:00:00 2001 From: Daniel Szoke <7881302+szokeasaurusrex@users.noreply.github.com> Date: Fri, 24 Jan 2025 10:28:50 +0100 Subject: [PATCH 05/32] ref: Simplify `--log-level` parsing (#2356) We don't need custom logic to parse the log level, `clap` can do this. --- src/commands/mod.rs | 24 +++++-------------- .../send_envelope/send_envelope-help.trycmd | 4 +--- .../_cases/send_event/send_event-help.trycmd | 4 +--- .../send_metric-distribution-help.trycmd | 4 +--- .../send_metric/send_metric-gauge-help.trycmd | 4 +--- .../send_metric/send_metric-help.trycmd | 4 +--- .../send_metric-increment-help.trycmd | 4 +--- .../send_metric/send_metric-set-help.trycmd | 4 +--- .../sourcemaps/sourcemaps-inject-help.trycmd | 4 +--- 9 files changed, 14 insertions(+), 42 deletions(-) diff --git a/src/commands/mod.rs b/src/commands/mod.rs index 0c7f6c999d..5cec3c0387 100644 --- a/src/commands/mod.rs +++ b/src/commands/mod.rs @@ -1,6 +1,6 @@ //! This module implements the root command of the CLI tool. -use anyhow::{bail, Result}; +use anyhow::Result; use clap::{value_parser, Arg, ArgAction, ArgMatches, Command}; use clap_complete::{generate, Generator, Shell}; use log::{debug, info, set_logger, set_max_level, LevelFilter}; @@ -130,18 +130,6 @@ fn configure_args(config: &mut Config, matches: &ArgMatches) -> Result<()> { Ok(()) } -pub fn get_log_level(matches: &ArgMatches) -> Result> { - match matches.get_one::("log_level") { - Some(log_level) => match log_level.parse() { - Ok(log_level) => Ok(Some(log_level)), - Err(_) => { - bail!("Unknown log level: {}", log_level); - } - }, - None => Ok(None), - } -} - fn app() -> Command { Command::new("sentry-cli") .version(VERSION) @@ -181,10 +169,10 @@ fn app() -> Command { Arg::new("log_level") .value_name("LOG_LEVEL") .long("log-level") - .value_parser(["trace", "debug", "info", "warn", "error"]) + .value_parser(value_parser!(LevelFilter)) .ignore_case(true) .global(true) - .help("Set the log output verbosity."), + .help("Set the log output verbosity. [possible values: trace, debug, info, warn, error]"), ) .arg( Arg::new("quiet") @@ -254,15 +242,15 @@ pub fn execute() -> Result<()> { let mut cmd = app(); cmd = add_commands(cmd); let matches = cmd.get_matches(); - let log_level = get_log_level(&matches)?; - if let Some(log_level) = log_level { + let log_level = matches.get_one::("log_level"); + if let Some(&log_level) = log_level { set_max_level(log_level); } let mut config = Config::from_cli_config()?; configure_args(&mut config, &matches)?; set_quiet_mode(matches.get_flag("quiet")); - if let Some(log_level) = log_level { + if let Some(&log_level) = log_level { config.set_log_level(log_level); } diff --git a/tests/integration/_cases/send_envelope/send_envelope-help.trycmd b/tests/integration/_cases/send_envelope/send_envelope-help.trycmd index 2038b000ed..e4d49730e4 100644 --- a/tests/integration/_cases/send_envelope/send_envelope-help.trycmd +++ b/tests/integration/_cases/send_envelope/send_envelope-help.trycmd @@ -25,9 +25,7 @@ Options: Use the given Sentry auth token. --log-level - Set the log output verbosity. - - [possible values: trace, debug, info, warn, error] + Set the log output verbosity. [possible values: trace, debug, info, warn, error] --quiet Do not print any output while preserving correct exit code. This flag is currently diff --git a/tests/integration/_cases/send_event/send_event-help.trycmd b/tests/integration/_cases/send_event/send_event-help.trycmd index a08576e7f8..4ab72aaebf 100644 --- a/tests/integration/_cases/send_event/send_event-help.trycmd +++ b/tests/integration/_cases/send_event/send_event-help.trycmd @@ -38,9 +38,7 @@ Options: Set the distribution. --log-level - Set the log output verbosity. - - [possible values: trace, debug, info, warn, error] + Set the log output verbosity. [possible values: trace, debug, info, warn, error] -E, --env Send with a specific environment. diff --git a/tests/integration/_cases/send_metric/send_metric-distribution-help.trycmd b/tests/integration/_cases/send_metric/send_metric-distribution-help.trycmd index 0b0ad6046f..8828238923 100644 --- a/tests/integration/_cases/send_metric/send_metric-distribution-help.trycmd +++ b/tests/integration/_cases/send_metric/send_metric-distribution-help.trycmd @@ -31,9 +31,7 @@ Options: Metric value, any finite 64 bit float. --log-level - Set the log output verbosity. - - [possible values: trace, debug, info, warn, error] + Set the log output verbosity. [possible values: trace, debug, info, warn, error] --quiet Do not print any output while preserving correct exit code. This flag is currently diff --git a/tests/integration/_cases/send_metric/send_metric-gauge-help.trycmd b/tests/integration/_cases/send_metric/send_metric-gauge-help.trycmd index 6652256130..099900ff50 100644 --- a/tests/integration/_cases/send_metric/send_metric-gauge-help.trycmd +++ b/tests/integration/_cases/send_metric/send_metric-gauge-help.trycmd @@ -31,9 +31,7 @@ Options: Metric value, any finite 64 bit float. --log-level - Set the log output verbosity. -[..] - [possible values: trace, debug, info, warn, error] + Set the log output verbosity. [possible values: trace, debug, info, warn, error] --quiet Do not print any output while preserving correct exit code. This flag is currently diff --git a/tests/integration/_cases/send_metric/send_metric-help.trycmd b/tests/integration/_cases/send_metric/send_metric-help.trycmd index 8fcc986e02..c52f7660e7 100644 --- a/tests/integration/_cases/send_metric/send_metric-help.trycmd +++ b/tests/integration/_cases/send_metric/send_metric-help.trycmd @@ -29,9 +29,7 @@ Options: Use the given Sentry auth token. --log-level - Set the log output verbosity. - - [possible values: trace, debug, info, warn, error] + Set the log output verbosity. [possible values: trace, debug, info, warn, error] --quiet Do not print any output while preserving correct exit code. This flag is currently diff --git a/tests/integration/_cases/send_metric/send_metric-increment-help.trycmd b/tests/integration/_cases/send_metric/send_metric-increment-help.trycmd index 2b3fa50fbf..89fdb94b6c 100644 --- a/tests/integration/_cases/send_metric/send_metric-increment-help.trycmd +++ b/tests/integration/_cases/send_metric/send_metric-increment-help.trycmd @@ -33,9 +33,7 @@ Options: [default: 1] --log-level - Set the log output verbosity. -[..] - [possible values: trace, debug, info, warn, error] + Set the log output verbosity. [possible values: trace, debug, info, warn, error] --quiet Do not print any output while preserving correct exit code. This flag is currently diff --git a/tests/integration/_cases/send_metric/send_metric-set-help.trycmd b/tests/integration/_cases/send_metric/send_metric-set-help.trycmd index b2671ce256..a2b8da42c0 100644 --- a/tests/integration/_cases/send_metric/send_metric-set-help.trycmd +++ b/tests/integration/_cases/send_metric/send_metric-set-help.trycmd @@ -32,9 +32,7 @@ Options: count will not increase. --log-level - Set the log output verbosity. -[..] - [possible values: trace, debug, info, warn, error] + Set the log output verbosity. [possible values: trace, debug, info, warn, error] --quiet Do not print any output while preserving correct exit code. This flag is currently diff --git a/tests/integration/_cases/sourcemaps/sourcemaps-inject-help.trycmd b/tests/integration/_cases/sourcemaps/sourcemaps-inject-help.trycmd index 72dbe59672..01fbdfc387 100644 --- a/tests/integration/_cases/sourcemaps/sourcemaps-inject-help.trycmd +++ b/tests/integration/_cases/sourcemaps/sourcemaps-inject-help.trycmd @@ -46,9 +46,7 @@ Options: Don't modify files on disk. --log-level - Set the log output verbosity. - - [possible values: trace, debug, info, warn, error] + Set the log output verbosity. [possible values: trace, debug, info, warn, error] --quiet Do not print any output while preserving correct exit code. This flag is currently From 2fcc7f4ede3a7a5503b624edfd2810ca5dedcfdb Mon Sep 17 00:00:00 2001 From: Daniel Szoke <7881302+szokeasaurusrex@users.noreply.github.com> Date: Fri, 24 Jan 2025 11:20:24 +0100 Subject: [PATCH 06/32] ci: Change lint action to `-D warnings` (#2359) Currently, the lint action specifies `-D clippy::all`. This means that if we enable any additional lints in the code, e.g. by adding `#![warn(clippy::pedantic)]` to the `main` module, these lints will not fail CI. By specifying `-D warnings` instead, any lints we enable as warnings in code will fail CI. --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c00c45680b..2dea6bf6f0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,7 +28,7 @@ jobs: run: cargo fmt --all -- --check - name: Run Clippy - run: cargo clippy --workspace --tests -- -D clippy::all + run: cargo clippy --workspace --tests -- -D warnings test: strategy: From 4a272988ea7ea2bd4f8d8e6d5f6cd098c3aade78 Mon Sep 17 00:00:00 2001 From: Daniel Szoke <7881302+szokeasaurusrex@users.noreply.github.com> Date: Fri, 24 Jan 2025 11:21:23 +0100 Subject: [PATCH 07/32] ref: Enable `clippy::unnecessary_wraps` lint (#2358) However, since fixing each existing violation would require changes to how each function is called, we hold off on fixing the violations in this PR. Instead, we `expect` the current violations individually. Future PRs will fix the existing violations. Ref #2357 --- src/api/mod.rs | 3 +++ src/commands/mod.rs | 3 +++ src/commands/sourcemaps/resolve.rs | 1 + src/config.rs | 2 ++ src/main.rs | 2 ++ src/utils/sourcemaps.rs | 3 +++ src/utils/update.rs | 1 + src/utils/value_parsers.rs | 1 + 8 files changed, 16 insertions(+) diff --git a/src/api/mod.rs b/src/api/mod.rs index ab1cd5ad10..dc3f66baa9 100644 --- a/src/api/mod.rs +++ b/src/api/mod.rs @@ -1718,6 +1718,7 @@ impl ApiRequest { Ok(self) } + #[expect(clippy::unnecessary_wraps)] pub fn with_body(mut self, body: Vec) -> ApiResult { self.body = Some(body); Ok(self) @@ -1739,11 +1740,13 @@ impl ApiRequest { } /// enables a progress bar. + #[expect(clippy::unnecessary_wraps)] pub fn progress_bar_mode(mut self, mode: ProgressBarMode) -> ApiResult { self.progress_bar_mode = mode; Ok(self) } + #[expect(clippy::unnecessary_wraps)] pub fn with_retry( mut self, max_retries: u32, diff --git a/src/commands/mod.rs b/src/commands/mod.rs index 5cec3c0387..73d21c0e93 100644 --- a/src/commands/mod.rs +++ b/src/commands/mod.rs @@ -103,6 +103,9 @@ fn preexecute_hooks() -> Result { Ok(false) } + // This function needs to return Result to remain compatible with the + // macOS implementation. + #[expect(clippy::unnecessary_wraps)] #[cfg(not(target_os = "macos"))] fn sentry_react_native_xcode_wrap() -> Result { Ok(false) diff --git a/src/commands/sourcemaps/resolve.rs b/src/commands/sourcemaps/resolve.rs index 71e5d727c2..df71ee1edf 100644 --- a/src/commands/sourcemaps/resolve.rs +++ b/src/commands/sourcemaps/resolve.rs @@ -33,6 +33,7 @@ pub fn make_command(command: Command) -> Command { } /// Returns the zero indexed position from matches +#[expect(clippy::unnecessary_wraps)] fn lookup_pos(matches: &ArgMatches) -> Option<(u32, u32)> { Some(( matches.get_one::("line").map_or(0, |x| x - 1), diff --git a/src/config.rs b/src/config.rs index 1a8be2c11c..ea6f004b0c 100644 --- a/src/config.rs +++ b/src/config.rs @@ -58,6 +58,7 @@ impl Config { } /// Creates Config based on provided config file. + #[expect(clippy::unnecessary_wraps)] pub fn from_file(filename: PathBuf, ini: Ini) -> Result { let auth = get_default_auth(&ini); let token_embedded_data = match auth { @@ -167,6 +168,7 @@ impl Config { } /// Updates the auth info + #[expect(clippy::unnecessary_wraps)] pub fn set_auth(&mut self, auth: Auth) -> Result<()> { self.cached_auth = Some(auth); diff --git a/src/main.rs b/src/main.rs index 8487641df8..0ac5e46067 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,5 @@ +#![warn(clippy::unnecessary_wraps)] + mod api; mod commands; mod config; diff --git a/src/utils/sourcemaps.rs b/src/utils/sourcemaps.rs index 1700057aba..912545f8ae 100644 --- a/src/utils/sourcemaps.rs +++ b/src/utils/sourcemaps.rs @@ -254,6 +254,7 @@ impl SourceMapProcessor { } /// Adds a new file for processing. + #[expect(clippy::unnecessary_wraps)] pub fn add(&mut self, url: &str, file: ReleaseFileMatch) -> Result<()> { self.pending_sources.insert((url.to_string(), file)); Ok(()) @@ -691,6 +692,7 @@ impl SourceMapProcessor { } /// Adds sourcemap references to all minified files + #[expect(clippy::unnecessary_wraps)] pub fn add_sourcemap_references(&mut self) -> Result<()> { self.flush_pending_sources(); self.collect_sourcemap_references(); @@ -710,6 +712,7 @@ impl SourceMapProcessor { /// Adds debug id to the source file headers from the linked source map. /// This is used for files we can't read debug ids from (e.g. Hermes bytecode bundles). + #[expect(clippy::unnecessary_wraps)] pub fn add_debug_id_references(&mut self) -> Result<()> { self.flush_pending_sources(); diff --git a/src/utils/update.rs b/src/utils/update.rs index ebaed5fc5e..73c6cf573a 100644 --- a/src/utils/update.rs +++ b/src/utils/update.rs @@ -176,6 +176,7 @@ impl SentryCliUpdateInfo { } } +#[expect(clippy::unnecessary_wraps)] pub fn get_latest_sentrycli_release() -> Result { let api = Api::current(); Ok(SentryCliUpdateInfo { diff --git a/src/utils/value_parsers.rs b/src/utils/value_parsers.rs index 11cd5e4965..c0a382c7af 100644 --- a/src/utils/value_parsers.rs +++ b/src/utils/value_parsers.rs @@ -10,6 +10,7 @@ pub fn kv_parser(s: &str) -> Result<(String, String)> { } /// Parse an AuthToken, and warn if the format is unrecognized +#[expect(clippy::unnecessary_wraps)] pub fn auth_token_parser(s: &str) -> Result { let token = AuthToken::from(s); if !token.format_recognized() { From 0c1b62f3c28cbb95bf63317b09db473c83249acb Mon Sep 17 00:00:00 2001 From: Daniel Szoke Date: Fri, 24 Jan 2025 10:53:04 +0100 Subject: [PATCH 08/32] ref(config): Remove unneeded `Result` from `Config::from_file` This function does not need to return a `Result`, as it can never fail. Ref #2357 --- src/config.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/config.rs b/src/config.rs index ea6f004b0c..be17016c21 100644 --- a/src/config.rs +++ b/src/config.rs @@ -54,12 +54,11 @@ impl Config { /// Loads the CLI config from the default location and returns it. pub fn from_cli_config() -> Result { let (filename, ini) = load_cli_config()?; - Config::from_file(filename, ini) + Ok(Config::from_file(filename, ini)) } /// Creates Config based on provided config file. - #[expect(clippy::unnecessary_wraps)] - pub fn from_file(filename: PathBuf, ini: Ini) -> Result { + pub fn from_file(filename: PathBuf, ini: Ini) -> Self { let auth = get_default_auth(&ini); let token_embedded_data = match auth { Some(Auth::Token(ref token)) => token.payload().cloned(), @@ -79,7 +78,7 @@ impl Config { token_url.into() }; - Ok(Config { + Config { filename, process_bound: false, cached_auth: auth, @@ -89,7 +88,7 @@ impl Config { cached_vcs_remote: get_default_vcs_remote(&ini), ini, cached_token_data: token_embedded_data, - }) + } } /// Makes this config the process bound one that can be @@ -117,7 +116,7 @@ impl Config { /// Return the global config reference. pub fn global() -> Result { let (global_filename, global_config) = load_global_config_file()?; - Config::from_file(global_filename, global_config) + Ok(Config::from_file(global_filename, global_config)) } /// Makes a copy of the config in a closure and boxes it. From 7282ff83c7b42a7a1a8057f88dda22ff608fcaae Mon Sep 17 00:00:00 2001 From: Daniel Szoke Date: Fri, 24 Jan 2025 10:57:05 +0100 Subject: [PATCH 09/32] ref(config): Fix `unnecessary_wraps` lint for `set_auth` Fixing the lint for `set_auth` makes `configure_auth` violate the lint, so we also fix that new violation here. Ref #2357 --- src/commands/login.rs | 4 ++-- src/commands/mod.rs | 10 ++++------ src/config.rs | 5 +---- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/commands/login.rs b/src/commands/login.rs index 6cd9258118..4273be3857 100644 --- a/src/commands/login.rs +++ b/src/commands/login.rs @@ -21,7 +21,7 @@ pub fn make_command(command: Command) -> Command { fn update_config(config: &Config, token: AuthToken) -> Result<()> { let mut new_cfg = config.clone(); - new_cfg.set_auth(Auth::Token(token))?; + new_cfg.set_auth(Auth::Token(token)); new_cfg.save()?; Ok(()) } @@ -69,7 +69,7 @@ pub fn execute(matches: &ArgMatches) -> Result<()> { }; let test_cfg = config.make_copy(|cfg| { - cfg.set_auth(Auth::Token(token.clone()))?; + cfg.set_auth(Auth::Token(token.clone())); Ok(()) })?; diff --git a/src/commands/mod.rs b/src/commands/mod.rs index 73d21c0e93..32c3fd7bb5 100644 --- a/src/commands/mod.rs +++ b/src/commands/mod.rs @@ -112,13 +112,13 @@ fn preexecute_hooks() -> Result { } } -fn configure_args(config: &mut Config, matches: &ArgMatches) -> Result<()> { +fn configure_args(config: &mut Config, matches: &ArgMatches) { if let Some(api_key) = matches.get_one::("api_key") { - config.set_auth(Auth::Key(api_key.to_owned()))?; + config.set_auth(Auth::Key(api_key.to_owned())); } if let Some(auth_token) = matches.get_one::("auth_token") { - config.set_auth(Auth::Token(auth_token.to_owned()))?; + config.set_auth(Auth::Token(auth_token.to_owned())); } if let Some(url) = matches.get_one::("url") { @@ -129,8 +129,6 @@ fn configure_args(config: &mut Config, matches: &ArgMatches) -> Result<()> { let headers = headers.map(|h| h.to_owned()).collect(); config.set_headers(headers); } - - Ok(()) } fn app() -> Command { @@ -250,7 +248,7 @@ pub fn execute() -> Result<()> { set_max_level(log_level); } let mut config = Config::from_cli_config()?; - configure_args(&mut config, &matches)?; + configure_args(&mut config, &matches); set_quiet_mode(matches.get_flag("quiet")); if let Some(&log_level) = log_level { diff --git a/src/config.rs b/src/config.rs index be17016c21..8775b7426c 100644 --- a/src/config.rs +++ b/src/config.rs @@ -167,8 +167,7 @@ impl Config { } /// Updates the auth info - #[expect(clippy::unnecessary_wraps)] - pub fn set_auth(&mut self, auth: Auth) -> Result<()> { + pub fn set_auth(&mut self, auth: Auth) { self.cached_auth = Some(auth); self.ini.delete_from(Some("auth"), "api_key"); @@ -193,8 +192,6 @@ impl Config { } None => {} } - - Ok(()) } /// Returns the base url (without trailing slashes) From 47f7981ec2b7fccacde32bf3d6165a17cf9257ee Mon Sep 17 00:00:00 2001 From: Daniel Szoke <7881302+szokeasaurusrex@users.noreply.github.com> Date: Fri, 24 Jan 2025 11:34:23 +0100 Subject: [PATCH 10/32] ref(api): Make `progress_bar_mode` return `Self` (#2364) No result needed here Ref #2357 --- src/api/mod.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/api/mod.rs b/src/api/mod.rs index dc3f66baa9..e55450f3fd 100644 --- a/src/api/mod.rs +++ b/src/api/mod.rs @@ -285,7 +285,7 @@ impl Api { pub fn download_with_progress(&self, url: &str, dst: &mut File) -> ApiResult { self.request(Method::Get, url, None)? .follow_location(true)? - .progress_bar_mode(ProgressBarMode::Response)? + .progress_bar_mode(ProgressBarMode::Response) .send_into(dst) } @@ -403,7 +403,7 @@ impl Api { http::HTTP_STATUS_504_GATEWAY_TIMEOUT, ], )? - .progress_bar_mode(progress_bar_mode)?; + .progress_bar_mode(progress_bar_mode); // The request is performed to an absolute URL. Thus, `Self::request()` will // not add the authorization header, by default. Since the URL is guaranteed @@ -1416,7 +1416,7 @@ impl RegionSpecificApi<'_> { })?, &[http::HTTP_STATUS_507_INSUFFICIENT_STORAGE], )? - .progress_bar_mode(ProgressBarMode::Request)? + .progress_bar_mode(ProgressBarMode::Request) .send()? .convert() } @@ -1482,7 +1482,7 @@ impl RegionSpecificApi<'_> { http::HTTP_STATUS_504_GATEWAY_TIMEOUT, ], )? - .progress_bar_mode(progress_bar_mode)? + .progress_bar_mode(progress_bar_mode) .send()?; if resp.status() == 409 { Ok(None) @@ -1740,10 +1740,9 @@ impl ApiRequest { } /// enables a progress bar. - #[expect(clippy::unnecessary_wraps)] - pub fn progress_bar_mode(mut self, mode: ProgressBarMode) -> ApiResult { + pub fn progress_bar_mode(mut self, mode: ProgressBarMode) -> Self { self.progress_bar_mode = mode; - Ok(self) + self } #[expect(clippy::unnecessary_wraps)] From f91042a82afed252a0c763fde9483377029a3908 Mon Sep 17 00:00:00 2001 From: Daniel Szoke <7881302+szokeasaurusrex@users.noreply.github.com> Date: Fri, 24 Jan 2025 11:44:23 +0100 Subject: [PATCH 11/32] ref(api): Make `with_retry` return `Self` (#2365) Ref #2357 --- src/api/mod.rs | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/src/api/mod.rs b/src/api/mod.rs index e55450f3fd..8f16fd29ec 100644 --- a/src/api/mod.rs +++ b/src/api/mod.rs @@ -402,7 +402,7 @@ impl Api { http::HTTP_STATUS_503_SERVICE_UNAVAILABLE, http::HTTP_STATUS_504_GATEWAY_TIMEOUT, ], - )? + ) .progress_bar_mode(progress_bar_mode); // The request is performed to an absolute URL. Thus, `Self::request()` will @@ -974,7 +974,7 @@ impl<'a> AuthenticatedApi<'a> { http::HTTP_STATUS_503_SERVICE_UNAVAILABLE, http::HTTP_STATUS_504_GATEWAY_TIMEOUT, ], - )? + ) .send()? .convert_rnf(ApiErrorKind::ProjectNotFound) } @@ -1007,7 +1007,7 @@ impl<'a> AuthenticatedApi<'a> { http::HTTP_STATUS_503_SERVICE_UNAVAILABLE, http::HTTP_STATUS_504_GATEWAY_TIMEOUT, ], - )? + ) .send()? .convert_rnf(ApiErrorKind::ReleaseNotFound) } @@ -1038,7 +1038,7 @@ impl<'a> AuthenticatedApi<'a> { http::HTTP_STATUS_503_SERVICE_UNAVAILABLE, http::HTTP_STATUS_504_GATEWAY_TIMEOUT, ], - )? + ) .send()? .convert_rnf(ApiErrorKind::ReleaseNotFound) } @@ -1415,7 +1415,7 @@ impl RegionSpecificApi<'_> { ) })?, &[http::HTTP_STATUS_507_INSUFFICIENT_STORAGE], - )? + ) .progress_bar_mode(ProgressBarMode::Request) .send()? .convert() @@ -1481,7 +1481,7 @@ impl RegionSpecificApi<'_> { http::HTTP_STATUS_503_SERVICE_UNAVAILABLE, http::HTTP_STATUS_504_GATEWAY_TIMEOUT, ], - )? + ) .progress_bar_mode(progress_bar_mode) .send()?; if resp.status() == 409 { @@ -1745,15 +1745,11 @@ impl ApiRequest { self } - #[expect(clippy::unnecessary_wraps)] - pub fn with_retry( - mut self, - max_retries: u32, - retry_on_statuses: &'static [u32], - ) -> ApiResult { + pub fn with_retry(mut self, max_retries: u32, retry_on_statuses: &'static [u32]) -> Self { self.max_retries = max_retries; self.retry_on_statuses = retry_on_statuses; - Ok(self) + + self } /// Get a copy of the header list From 39b62cb7166b4ebdcd1c687373d6b34886e775b9 Mon Sep 17 00:00:00 2001 From: Daniel Szoke <7881302+szokeasaurusrex@users.noreply.github.com> Date: Fri, 24 Jan 2025 12:31:06 +0100 Subject: [PATCH 12/32] ref: Make `Api::with_body` return `Self` (#2363) No need for a `Result` here. Ref #2357 --- src/api/envelopes_api.rs | 2 +- src/api/mod.rs | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/api/envelopes_api.rs b/src/api/envelopes_api.rs index 38c128a958..80d2ad94b5 100644 --- a/src/api/envelopes_api.rs +++ b/src/api/envelopes_api.rs @@ -33,7 +33,7 @@ impl EnvelopesApi { self.api .request(Method::Post, url.as_str(), None)? .with_header("X-Sentry-Auth", &auth.to_string())? - .with_body(body)? + .with_body(body) .send()? .into_result() } diff --git a/src/api/mod.rs b/src/api/mod.rs index 8f16fd29ec..5222b12f98 100644 --- a/src/api/mod.rs +++ b/src/api/mod.rs @@ -1718,10 +1718,9 @@ impl ApiRequest { Ok(self) } - #[expect(clippy::unnecessary_wraps)] - pub fn with_body(mut self, body: Vec) -> ApiResult { + pub fn with_body(mut self, body: Vec) -> Self { self.body = Some(body); - Ok(self) + self } /// attaches some form data to the request. From fedf20e9ddaa982fb9a5e73ba08d3fccfb185424 Mon Sep 17 00:00:00 2001 From: Daniel Szoke <7881302+szokeasaurusrex@users.noreply.github.com> Date: Fri, 24 Jan 2025 12:31:25 +0100 Subject: [PATCH 13/32] ref(sourcemaps): Make `lookup_pos` not return `Option` (#2366) We always return the `Some` variant, so no `Option` needed here. Ref #2357 --- src/commands/sourcemaps/resolve.rs | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/commands/sourcemaps/resolve.rs b/src/commands/sourcemaps/resolve.rs index df71ee1edf..ac1006b3eb 100644 --- a/src/commands/sourcemaps/resolve.rs +++ b/src/commands/sourcemaps/resolve.rs @@ -33,12 +33,11 @@ pub fn make_command(command: Command) -> Command { } /// Returns the zero indexed position from matches -#[expect(clippy::unnecessary_wraps)] -fn lookup_pos(matches: &ArgMatches) -> Option<(u32, u32)> { - Some(( +fn lookup_pos(matches: &ArgMatches) -> (u32, u32) { + ( matches.get_one::("line").map_or(0, |x| x - 1), matches.get_one::("column").map_or(0, |x| x - 1), - )) + ) } fn count_whitespace_prefix(test: &str) -> i32 { @@ -154,17 +153,18 @@ pub fn execute(matches: &ArgMatches) -> Result<()> { println!(); // perform a lookup - if let Some((line, column)) = lookup_pos(matches) { - println!( - "Searching for token nearest to line {}, column {} in the minified file:\n", - line + 1, - column + 1 - ); - if let Some(token) = sm.lookup_token(line, column) { - print_token(&token); - } else { - println!(" - no token found!"); - } + let (line, column) = lookup_pos(matches); + + println!( + "Searching for token nearest to line {}, column {} in the minified file:\n", + line + 1, + column + 1 + ); + + if let Some(token) = sm.lookup_token(line, column) { + print_token(&token); + } else { + println!(" - no token found!"); } Ok(()) From 06fdfd66f4743a2057a1e88905e27c06310fa783 Mon Sep 17 00:00:00 2001 From: Daniel Szoke <7881302+szokeasaurusrex@users.noreply.github.com> Date: Fri, 24 Jan 2025 12:31:48 +0100 Subject: [PATCH 14/32] ref(sourcemaps): Fix `unnecessary_wraps` lint for `SourceMapsProcessor::add` (#2367) Ref #2357 --- src/commands/react_native/appcenter.rs | 2 +- src/commands/react_native/gradle.rs | 4 ++-- src/commands/react_native/xcode.rs | 4 ++-- src/commands/sourcemaps/inject.rs | 2 +- src/commands/sourcemaps/upload.rs | 6 +++--- src/utils/sourcemaps.rs | 4 +--- 6 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/commands/react_native/appcenter.rs b/src/commands/react_native/appcenter.rs index 266eccb498..39ebefafc2 100644 --- a/src/commands/react_native/appcenter.rs +++ b/src/commands/react_native/appcenter.rs @@ -171,7 +171,7 @@ pub fn execute(matches: &ArgMatches) -> Result<()> { ext == OsStr::new("bundle"); then { let url = format!("~/{filename}"); - processor.add(&url, ReleaseFileSearch::collect_file(entry.path())?)?; + processor.add(&url, ReleaseFileSearch::collect_file(entry.path())?); } } } diff --git a/src/commands/react_native/gradle.rs b/src/commands/react_native/gradle.rs index dc1580b362..f9e5755401 100644 --- a/src/commands/react_native/gradle.rs +++ b/src/commands/react_native/gradle.rs @@ -95,11 +95,11 @@ pub fn execute(matches: &ArgMatches) -> Result<()> { processor.add( &bundle_url, ReleaseFileSearch::collect_file(bundle_path.clone())?, - )?; + ); processor.add( &sourcemap_url, ReleaseFileSearch::collect_file(sourcemap_path)?, - )?; + ); if let Ok(ram_bundle) = RamBundle::parse_unbundle_from_path(&bundle_path) { debug!("File RAM bundle found, extracting its contents..."); diff --git a/src/commands/react_native/xcode.rs b/src/commands/react_native/xcode.rs index 9c7e6fd9a8..cfde39995b 100644 --- a/src/commands/react_native/xcode.rs +++ b/src/commands/react_native/xcode.rs @@ -323,11 +323,11 @@ pub fn execute(matches: &ArgMatches) -> Result<()> { info!(" sourcemap path: {}", sourcemap_path.display()); let mut processor = SourceMapProcessor::new(); - processor.add(&bundle_url, ReleaseFileSearch::collect_file(bundle_path)?)?; + processor.add(&bundle_url, ReleaseFileSearch::collect_file(bundle_path)?); processor.add( &sourcemap_url, ReleaseFileSearch::collect_file(sourcemap_path)?, - )?; + ); processor.rewrite(&[base.parent().unwrap().to_str().unwrap()])?; processor.add_sourcemap_references()?; processor.add_debug_id_references()?; diff --git a/src/commands/sourcemaps/inject.rs b/src/commands/sourcemaps/inject.rs index 355844c117..3bdb8fd5f5 100644 --- a/src/commands/sourcemaps/inject.rs +++ b/src/commands/sourcemaps/inject.rs @@ -103,7 +103,7 @@ pub fn execute(matches: &ArgMatches) -> Result<()> { .collect_files()?; for source in sources { let url = path_as_url(&source.path); - processor.add(&url, source)?; + processor.add(&url, source); } } diff --git a/src/commands/sourcemaps/upload.rs b/src/commands/sourcemaps/upload.rs index b58b2f2c8b..b7d642c1ea 100644 --- a/src/commands/sourcemaps/upload.rs +++ b/src/commands/sourcemaps/upload.rs @@ -302,11 +302,11 @@ fn process_sources_from_bundle( processor.add( &bundle_url, ReleaseFileSearch::collect_file(bundle_path.clone())?, - )?; + ); processor.add( &sourcemap_url, ReleaseFileSearch::collect_file(sourcemap_path)?, - )?; + ); if let Ok(ram_bundle) = sourcemap::ram_bundle::RamBundle::parse_unbundle_from_path(&bundle_path) { @@ -394,7 +394,7 @@ fn process_sources_from_paths( for source in sources { let local_path = source.path.strip_prefix(base_path).unwrap(); let url = format!("{}/{}{}", url_prefix, path_as_url(local_path), url_suffix); - processor.add(&url, source)?; + processor.add(&url, source); } } diff --git a/src/utils/sourcemaps.rs b/src/utils/sourcemaps.rs index 912545f8ae..1602ac098d 100644 --- a/src/utils/sourcemaps.rs +++ b/src/utils/sourcemaps.rs @@ -254,10 +254,8 @@ impl SourceMapProcessor { } /// Adds a new file for processing. - #[expect(clippy::unnecessary_wraps)] - pub fn add(&mut self, url: &str, file: ReleaseFileMatch) -> Result<()> { + pub fn add(&mut self, url: &str, file: ReleaseFileMatch) { self.pending_sources.insert((url.to_string(), file)); - Ok(()) } fn flush_pending_sources(&mut self) { From 2f13f81a10eb9cccba1a95871330657b4e2a261c Mon Sep 17 00:00:00 2001 From: Daniel Szoke <7881302+szokeasaurusrex@users.noreply.github.com> Date: Fri, 24 Jan 2025 12:32:02 +0100 Subject: [PATCH 15/32] ref(sourcemaps): Fix `unnecessary_wraps` for `add_sourcemap_references` (#2368) Ref #2357 --- src/commands/react_native/appcenter.rs | 2 +- src/commands/react_native/gradle.rs | 2 +- src/commands/react_native/xcode.rs | 2 +- src/commands/sourcemaps/upload.rs | 4 ++-- src/utils/sourcemaps.rs | 4 +--- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/commands/react_native/appcenter.rs b/src/commands/react_native/appcenter.rs index 39ebefafc2..ec80ec8a1e 100644 --- a/src/commands/react_native/appcenter.rs +++ b/src/commands/react_native/appcenter.rs @@ -178,7 +178,7 @@ pub fn execute(matches: &ArgMatches) -> Result<()> { } processor.rewrite(&[here_str])?; - processor.add_sourcemap_references()?; + processor.add_sourcemap_references(); let chunk_upload_options = api.authenticated()?.get_chunk_upload_options(&org)?; diff --git a/src/commands/react_native/gradle.rs b/src/commands/react_native/gradle.rs index f9e5755401..12f28438ce 100644 --- a/src/commands/react_native/gradle.rs +++ b/src/commands/react_native/gradle.rs @@ -109,7 +109,7 @@ pub fn execute(matches: &ArgMatches) -> Result<()> { } processor.rewrite(&[base.to_str().unwrap()])?; - processor.add_sourcemap_references()?; + processor.add_sourcemap_references(); processor.add_debug_id_references()?; let version = matches.get_one::("release"); diff --git a/src/commands/react_native/xcode.rs b/src/commands/react_native/xcode.rs index cfde39995b..13bd4d5f53 100644 --- a/src/commands/react_native/xcode.rs +++ b/src/commands/react_native/xcode.rs @@ -329,7 +329,7 @@ pub fn execute(matches: &ArgMatches) -> Result<()> { ReleaseFileSearch::collect_file(sourcemap_path)?, ); processor.rewrite(&[base.parent().unwrap().to_str().unwrap()])?; - processor.add_sourcemap_references()?; + processor.add_sourcemap_references(); processor.add_debug_id_references()?; let api = Api::current(); diff --git a/src/commands/sourcemaps/upload.rs b/src/commands/sourcemaps/upload.rs index b7d642c1ea..18d403320c 100644 --- a/src/commands/sourcemaps/upload.rs +++ b/src/commands/sourcemaps/upload.rs @@ -327,7 +327,7 @@ fn process_sources_from_bundle( debug!("Prefixes: {:?}", prefixes); processor.rewrite(&prefixes)?; - processor.add_sourcemap_references()?; + processor.add_sourcemap_references(); processor.add_debug_id_references()?; Ok(()) @@ -404,7 +404,7 @@ fn process_sources_from_paths( } if !matches.get_flag("no_sourcemap_reference") { - processor.add_sourcemap_references()?; + processor.add_sourcemap_references(); } if matches.get_flag("debug_id_reference") { diff --git a/src/utils/sourcemaps.rs b/src/utils/sourcemaps.rs index 1602ac098d..a751f50ca1 100644 --- a/src/utils/sourcemaps.rs +++ b/src/utils/sourcemaps.rs @@ -690,8 +690,7 @@ impl SourceMapProcessor { } /// Adds sourcemap references to all minified files - #[expect(clippy::unnecessary_wraps)] - pub fn add_sourcemap_references(&mut self) -> Result<()> { + pub fn add_sourcemap_references(&mut self) { self.flush_pending_sources(); self.collect_sourcemap_references(); @@ -705,7 +704,6 @@ impl SourceMapProcessor { source.set_sourcemap_reference(sourcemap.url.to_string()); } } - Ok(()) } /// Adds debug id to the source file headers from the linked source map. From 0d69e74a575b143d1cc29bdd71617939cd2fcc85 Mon Sep 17 00:00:00 2001 From: Daniel Szoke <7881302+szokeasaurusrex@users.noreply.github.com> Date: Fri, 24 Jan 2025 13:39:56 +0100 Subject: [PATCH 16/32] ref(sourcemaps): Fix `unnecessary_wraps` for `add_debug_id_references` (#2369) Ref #2357 --- src/commands/react_native/gradle.rs | 2 +- src/commands/react_native/xcode.rs | 2 +- src/commands/sourcemaps/upload.rs | 4 ++-- src/utils/sourcemaps.rs | 4 +--- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/commands/react_native/gradle.rs b/src/commands/react_native/gradle.rs index 12f28438ce..77946ba1ef 100644 --- a/src/commands/react_native/gradle.rs +++ b/src/commands/react_native/gradle.rs @@ -110,7 +110,7 @@ pub fn execute(matches: &ArgMatches) -> Result<()> { processor.rewrite(&[base.to_str().unwrap()])?; processor.add_sourcemap_references(); - processor.add_debug_id_references()?; + processor.add_debug_id_references(); let version = matches.get_one::("release"); let chunk_upload_options = api.authenticated()?.get_chunk_upload_options(&org)?; diff --git a/src/commands/react_native/xcode.rs b/src/commands/react_native/xcode.rs index 13bd4d5f53..ee6f45b19f 100644 --- a/src/commands/react_native/xcode.rs +++ b/src/commands/react_native/xcode.rs @@ -330,7 +330,7 @@ pub fn execute(matches: &ArgMatches) -> Result<()> { ); processor.rewrite(&[base.parent().unwrap().to_str().unwrap()])?; processor.add_sourcemap_references(); - processor.add_debug_id_references()?; + processor.add_debug_id_references(); let api = Api::current(); let chunk_upload_options = api.authenticated()?.get_chunk_upload_options(&org)?; diff --git a/src/commands/sourcemaps/upload.rs b/src/commands/sourcemaps/upload.rs index 18d403320c..c4b3c691a2 100644 --- a/src/commands/sourcemaps/upload.rs +++ b/src/commands/sourcemaps/upload.rs @@ -328,7 +328,7 @@ fn process_sources_from_bundle( processor.rewrite(&prefixes)?; processor.add_sourcemap_references(); - processor.add_debug_id_references()?; + processor.add_debug_id_references(); Ok(()) } @@ -408,7 +408,7 @@ fn process_sources_from_paths( } if matches.get_flag("debug_id_reference") { - processor.add_debug_id_references()?; + processor.add_debug_id_references(); } if matches.get_flag("validate") { diff --git a/src/utils/sourcemaps.rs b/src/utils/sourcemaps.rs index a751f50ca1..ebce8a728d 100644 --- a/src/utils/sourcemaps.rs +++ b/src/utils/sourcemaps.rs @@ -708,8 +708,7 @@ impl SourceMapProcessor { /// Adds debug id to the source file headers from the linked source map. /// This is used for files we can't read debug ids from (e.g. Hermes bytecode bundles). - #[expect(clippy::unnecessary_wraps)] - pub fn add_debug_id_references(&mut self) -> Result<()> { + pub fn add_debug_id_references(&mut self) { self.flush_pending_sources(); for source in self.sources.values_mut() { @@ -763,7 +762,6 @@ impl SourceMapProcessor { ); } } - Ok(()) } /// Flags the collected sources whether they have already been uploaded before From 1adb385bca0cb7bf419fa6cf2eb17dd38919b438 Mon Sep 17 00:00:00 2001 From: Daniel Szoke <7881302+szokeasaurusrex@users.noreply.github.com> Date: Fri, 24 Jan 2025 13:55:21 +0100 Subject: [PATCH 17/32] fix(update): Properly handle errors when getting latest CLI version (#2370) The current code suppresses any API errors that occur when trying to get the latest CLI version. This is probably ideal behavior in the update nagger, but likely not in the `sentry-cli update` command. This change also fixes a `clippy::unnecessary_wraps` lint. Ref #2357 --- src/commands/update.rs | 5 +++-- src/utils/update.rs | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/commands/update.rs b/src/commands/update.rs index 697c7d452e..ceebcc1b46 100644 --- a/src/commands/update.rs +++ b/src/commands/update.rs @@ -1,6 +1,6 @@ use std::env; -use anyhow::{bail, Result}; +use anyhow::{bail, Context, Result}; use clap::{Arg, ArgAction, ArgMatches, Command}; use crate::utils::update::{assert_updatable, can_update_sentrycli, get_latest_sentrycli_release}; @@ -29,7 +29,8 @@ pub fn execute(matches: &ArgMatches) -> Result<()> { assert_updatable()?; let exe = env::current_exe()?; - let update = get_latest_sentrycli_release()?; + let update = get_latest_sentrycli_release() + .with_context(|| "Error getting latest Sentry CLI version.")?; if !update.have_version_info() { bail!("Could not get the latest release version."); } diff --git a/src/utils/update.rs b/src/utils/update.rs index 73c6cf573a..1d1b70136f 100644 --- a/src/utils/update.rs +++ b/src/utils/update.rs @@ -115,6 +115,7 @@ impl LastUpdateCheck { } } +#[derive(Default)] pub struct SentryCliUpdateInfo { latest_release: Option, } @@ -176,11 +177,10 @@ impl SentryCliUpdateInfo { } } -#[expect(clippy::unnecessary_wraps)] pub fn get_latest_sentrycli_release() -> Result { let api = Api::current(); Ok(SentryCliUpdateInfo { - latest_release: api.get_latest_sentrycli_release().unwrap_or_default(), + latest_release: api.get_latest_sentrycli_release()?, }) } @@ -224,7 +224,8 @@ fn update_nagger_impl() -> Result<()> { if check.should_run_check() { info!("Running update nagger update check"); - let ui = get_latest_sentrycli_release()?; + // Error getting latest version in update nagger should not crash the CLI + let ui = get_latest_sentrycli_release().unwrap_or_default(); if ui.have_version_info() { check.update_for_info(&ui); let mut f = fs::File::create(&path)?; From 3df8194455f2a719298f21de8054ae691a416b7e Mon Sep 17 00:00:00 2001 From: Daniel Szoke <7881302+szokeasaurusrex@users.noreply.github.com> Date: Fri, 24 Jan 2025 16:00:32 +0100 Subject: [PATCH 18/32] docs: Explain why lint is disabled (#2371) We need `#[expect(clippy::unnecessary_wraps)]` on this function, add a comment to explain why. --- src/utils/value_parsers.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/utils/value_parsers.rs b/src/utils/value_parsers.rs index c0a382c7af..5b06833839 100644 --- a/src/utils/value_parsers.rs +++ b/src/utils/value_parsers.rs @@ -10,6 +10,8 @@ pub fn kv_parser(s: &str) -> Result<(String, String)> { } /// Parse an AuthToken, and warn if the format is unrecognized +// Clap requires parsers to return a Result, hence why this function returns +// a Result, violating the clippy::unnecessary_wraps lint. #[expect(clippy::unnecessary_wraps)] pub fn auth_token_parser(s: &str) -> Result { let token = AuthToken::from(s); From 73548faa84d822f52744b21ba867d47abe4dce48 Mon Sep 17 00:00:00 2001 From: Daniel Szoke <7881302+szokeasaurusrex@users.noreply.github.com> Date: Mon, 10 Feb 2025 15:03:53 +0100 Subject: [PATCH 19/32] build: Update `url` crate (#2379) --- Cargo.lock | 279 +++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 248 insertions(+), 31 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f083b3086a..91975eac2d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1343,14 +1343,143 @@ dependencies = [ "cc", ] +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.68", +] + [[package]] name = "idna" -version = "0.5.0" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "icu_normalizer", + "icu_properties", ] [[package]] @@ -1577,6 +1706,12 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +[[package]] +name = "litemap" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" + [[package]] name = "lock_api" version = "0.4.12" @@ -3019,6 +3154,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.68", +] + [[package]] name = "tap" version = "1.0.1" @@ -3116,20 +3262,15 @@ dependencies = [ ] [[package]] -name = "tinyvec" -version = "1.6.1" +name = "tinystr" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c55115c6fbe2d2bef26eb09ad74bde02d8255476fc0c7b515ef09fbb35742d82" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" dependencies = [ - "tinyvec_macros", + "displaydoc", + "zerovec", ] -[[package]] -name = "tinyvec_macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" - [[package]] name = "tokio" version = "1.41.1" @@ -3249,12 +3390,6 @@ dependencies = [ "libc", ] -[[package]] -name = "unicode-bidi" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" - [[package]] name = "unicode-id-start" version = "1.1.2" @@ -3267,15 +3402,6 @@ version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" -[[package]] -name = "unicode-normalization" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" -dependencies = [ - "tinyvec", -] - [[package]] name = "unicode-width" version = "0.1.13" @@ -3284,9 +3410,9 @@ checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" [[package]] name = "url" -version = "2.5.2" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ "form_urlencoded", "idna", @@ -3304,6 +3430,18 @@ dependencies = [ "winapi 0.2.8", ] +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "utf8parse" version = "0.2.2" @@ -3721,6 +3859,18 @@ dependencies = [ "memchr", ] +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + [[package]] name = "wyz" version = "0.5.1" @@ -3730,6 +3880,30 @@ dependencies = [ "tap", ] +[[package]] +name = "yoke" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.68", + "synstructure", +] + [[package]] name = "zerocopy" version = "0.7.35" @@ -3750,12 +3924,55 @@ dependencies = [ "syn 2.0.68", ] +[[package]] +name = "zerofrom" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.68", + "synstructure", +] + [[package]] name = "zeroize" version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.68", +] + [[package]] name = "zip" version = "0.6.6" From 734fa8cddc8308133d6f807cec01a9e5e668aba8 Mon Sep 17 00:00:00 2001 From: Daniel Szoke <7881302+szokeasaurusrex@users.noreply.github.com> Date: Mon, 10 Feb 2025 16:21:48 +0100 Subject: [PATCH 20/32] meta: Update LICENSE (#2380) Include copyright range --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 6c2ce5d1f1..ec18757b35 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2016 Sentry (https://sentry.io/) and individual contributors. +Copyright (c) 2016-2025 Sentry (https://sentry.io/) and individual contributors. All rights reserved. Redistribution and use in source and binary forms, with or without From 5714aff3ab959b363e71bbd57ddd45ebc5b31109 Mon Sep 17 00:00:00 2001 From: Daniel Szoke <7881302+szokeasaurusrex@users.noreply.github.com> Date: Wed, 12 Feb 2025 15:18:22 +0100 Subject: [PATCH 21/32] feat: Only warn for token org mismatch (#2382) If the manually-configured org differs from the token-embedded org, issue a warning, and use the token-embedded org. Previously, we would error in this case. Closes #2381 --- src/config.rs | 13 ++++++------- .../_cases/org_tokens/org-mismatch.trycmd | 6 ++---- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/config.rs b/src/config.rs index 8775b7426c..f568d49a2e 100644 --- a/src/config.rs +++ b/src/config.rs @@ -346,15 +346,14 @@ impl Config { (None, Some(cli_org)) => Ok(cli_org), (Some(token_org), None) => Ok(token_org.to_string()), (Some(token_org), Some(cli_org)) => { - if cli_org.is_empty() { - return Ok(token_org.to_owned()); - } if cli_org != *token_org { - return Err(format_err!( - "Two different org values supplied: `{token_org}` (from token), `{cli_org}`." - )); + log::warn!( + "Using organization `{token_org}` (embedded in token) rather \ + than manually-configured organization `{cli_org}`. To use \ + `{cli_org}`, please provide an auth token for this organization." + ); } - Ok(cli_org) + Ok(token_org.into()) } } } diff --git a/tests/integration/_cases/org_tokens/org-mismatch.trycmd b/tests/integration/_cases/org_tokens/org-mismatch.trycmd index 1d431c9b8a..d68bb6a9e0 100644 --- a/tests/integration/_cases/org_tokens/org-mismatch.trycmd +++ b/tests/integration/_cases/org_tokens/org-mismatch.trycmd @@ -1,9 +1,7 @@ ``` $ sentry-cli --auth-token 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 sourcemaps upload --org otherorg test_path ? failed -error: Two different org values supplied: `sentry` (from token), `otherorg`. - -Add --log-level=[info|debug] or export SENTRY_LOG_LEVEL=[info|debug] to see more output. -Please attach the full debug log to all bug reports. +[..]WARN[..]Using organization `sentry` (embedded in token) rather than manually-configured organization `otherorg`. To use `otherorg`, please provide an auth token for this organization. +... ``` From 884d64cab8ff5c24063002bfc0e25e6490918fb5 Mon Sep 17 00:00:00 2001 From: Daniel Szoke <7881302+szokeasaurusrex@users.noreply.github.com> Date: Thu, 13 Feb 2025 16:42:11 +0100 Subject: [PATCH 22/32] ci: Pin Actions runners' OS versions (#2353) Several of our GitHub Actions runners are running on `ubuntu-latest`, `windows-latest`, and `macos-latest`, making the actions vulnerable to breakage when these images are updated. Therefore, we should pin to specific versions of these images. Pinning to `ubuntu-24.04`, `windows-2022`, and `macos-14` because these are currently equivalent to `ubuntu-latest`, `windows-latest`, and `macos-latest`, respectively. --- .github/workflows/build.yml | 16 ++++++++-------- .github/workflows/ci.yml | 6 +++--- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/release.yml | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e45c3971c2..30a23d9a23 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,7 +25,7 @@ jobs: container: aarch64-musl name: Linux ${{ matrix.arch }} - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v2 @@ -56,7 +56,7 @@ jobs: target: aarch64-apple-darwin name: macOS ${{ matrix.arch }} - runs-on: macos-latest + runs-on: macos-14 steps: - uses: actions/checkout@v2 @@ -86,7 +86,7 @@ jobs: macos_universal: needs: macos name: macOS universal - runs-on: macos-latest + runs-on: macos-14 steps: - uses: actions/download-artifact@v4 @@ -144,7 +144,7 @@ jobs: node: name: NPM Package - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 needs: [linux, macos, macos_universal, windows] steps: @@ -176,7 +176,7 @@ jobs: python-base: name: python (base) - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v3 - uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # pin@v1 @@ -197,7 +197,7 @@ jobs: python: name: python - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 needs: [linux, macos, macos_universal, windows, python-base] steps: - uses: actions/checkout@v3 @@ -223,7 +223,7 @@ jobs: npm-distributions: name: 'Build NPM distributions' - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 needs: [linux, macos, macos_universal, windows] steps: - uses: actions/checkout@v3 @@ -265,7 +265,7 @@ jobs: merge: name: Create Release Artifact - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 needs: [linux, macos, macos_universal, windows, npm-distributions, node, python] steps: - uses: actions/upload-artifact/merge@v4 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2dea6bf6f0..88ec3e2258 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ env: jobs: lint: name: Lint - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 @@ -34,7 +34,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + os: [ubuntu-24.04, macos-14, windows-2022] name: Test (${{ matrix.os }}) runs-on: ${{ matrix.os }} @@ -65,7 +65,7 @@ jobs: node-version: [10.x, 12.x, 14.x, 16.x, 18.x, 20.x] name: Test Node ${{ matrix.node-version }} - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 2051100fa6..a97be20a38 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -21,7 +21,7 @@ on: jobs: analyze: name: Analyze - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 strategy: fail-fast: false diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 062a82bda7..328e761916 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,7 +13,7 @@ on: required: false jobs: release: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 name: 'Release a new version' steps: - name: Get auth token From b767290a1870ebdc959a739dafa895330c447cbe Mon Sep 17 00:00:00 2001 From: Daniel Szoke <7881302+szokeasaurusrex@users.noreply.github.com> Date: Fri, 14 Feb 2025 11:27:14 +0100 Subject: [PATCH 23/32] build: Build Docker image in CI and publish to GHCR (#2383) This will cause `sentry-cli:` to be created and pushed to GHCR in the release build action, which runs on push to branches matching `release/*`. We can add a step to the actual release process which tags these GHCR images with the version number and also publish them to Docker Hub Ref #1338 --- .github/workflows/build.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 30a23d9a23..04f11ffba7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -263,6 +263,34 @@ jobs: path: npm-binary-distributions/*/*.tgz if-no-files-found: 'error' + docker: + name: Docker Image + runs-on: ubuntu-24.04 + permissions: + contents: read + packages: write + steps: + - uses: actions/checkout@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: | + ghcr.io/${{ github.repository }}:${{ github.ref_name }} + platforms: linux/amd64,linux/aarch64 + merge: name: Create Release Artifact runs-on: ubuntu-24.04 From 309aec890c41cad8a7575d58f22117aa8468b022 Mon Sep 17 00:00:00 2001 From: Daniel Szoke <7881302+szokeasaurusrex@users.noreply.github.com> Date: Fri, 14 Feb 2025 11:35:46 +0100 Subject: [PATCH 24/32] build: Use hash instead of branch in GHCR tag (#2384) --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 04f11ffba7..3454a79ab9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -288,7 +288,7 @@ jobs: context: . push: true tags: | - ghcr.io/${{ github.repository }}:${{ github.ref_name }} + ghcr.io/${{ github.repository }}:${{ github.sha }} platforms: linux/amd64,linux/aarch64 merge: From 7b4555477315f929c91677c4e9bf64c7bc8f0ed5 Mon Sep 17 00:00:00 2001 From: Daniel Szoke Date: Mon, 17 Feb 2025 17:32:17 +0100 Subject: [PATCH 25/32] build(docker): Build Docker image on host architecture Instead of using cross-compilation with `rust-musl-cross`, build Sentry CLI Docker container using the official Rust Alpine Docker image. This image will by default build for `musl` Linux (as before) using the architecture of the host system, rather than cross compiling --- Dockerfile | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index cb43966c4f..827a4bf738 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,25 +1,22 @@ -ARG BUILD_ARCH=x86_64 -ARG BUILD_LIBC=musl -FROM messense/rust-musl-cross:$BUILD_ARCH-$BUILD_LIBC AS sentry-build +FROM rust:1.84-alpine AS sentry-build + +# Install build dependencies +RUN apk add musl-dev perl openssl-dev make -ARG BUILD_ARCH -ARG BUILD_LIBC -ENV BUILD_TARGET=$BUILD_ARCH-unknown-linux-$BUILD_LIBC WORKDIR /work # Build only dependencies to speed up subsequent builds COPY Cargo.toml Cargo.lock build.rs ./ RUN mkdir -p src \ && echo "fn main() {}" > src/main.rs \ - && cargo build --release --target=$BUILD_TARGET --locked + && cargo build --release --locked # Add all sources and rebuild the actual sentry-cli COPY src src/ - -RUN touch src/main.rs && cargo build --target=$BUILD_TARGET --release --features managed +RUN touch src/main.rs && cargo build --release --features managed # Copy the compiled binary to a target-independent location so it can be picked up later -RUN cp target/$BUILD_TARGET/release/sentry-cli /usr/local/bin/sentry-cli +RUN cp target/release/sentry-cli /usr/local/bin/sentry-cli FROM alpine:3.14 WORKDIR /work From a1c9d7285cb88c895ad5d0e8911336e5f0f03216 Mon Sep 17 00:00:00 2001 From: Daniel Szoke Date: Mon, 17 Feb 2025 17:35:46 +0100 Subject: [PATCH 26/32] ci(docker): Build each architecture natively When building the multiarch Docker image, build two separate Docker images for `amd64` and `arm64` natively by using a GitHub Actions runner with the respective architecture (note: `ubuntu-24.04-arm` is currently under public preview, so this could break in the future, but we likely get the best performance by building on the native architecture). Then, we make the multiarch image by combining the two platform-specific images. Ref #1338 --- .github/workflows/build.yml | 38 +++++++++++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3454a79ab9..6c8b515cf4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -263,9 +263,16 @@ jobs: path: npm-binary-distributions/*/*.tgz if-no-files-found: 'error' - docker: - name: Docker Image - runs-on: ubuntu-24.04 + platform-specific-docker: + name: Build Docker Image (${{ matrix.platform }}) + strategy: + matrix: + include: + - platform: amd64 + runner: ubuntu-24.04 + - platform: arm64 + runner: ubuntu-24.04-arm + runs-on: ${{ matrix.runner }} permissions: contents: read packages: write @@ -287,9 +294,28 @@ jobs: with: context: . push: true - tags: | - ghcr.io/${{ github.repository }}:${{ github.sha }} - platforms: linux/amd64,linux/aarch64 + platforms: linux/${{ matrix.platform }} + tags: ghcr.io/${{ github.repository }}:${{ github.sha }}-${{ matrix.platform }} + + multiarch-docker: + name: Create Multi-Architecture Docker Image + needs: platform-specific-docker + runs-on: ubuntu-24.04 + permissions: + packages: write + steps: + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Create multi-architecture image + run: | + docker buildx imagetools create --push -t ghcr.io/${{ github.repository }}:${{ github.sha }} \ + ghcr.io/${{ github.repository }}:${{ github.sha }}-amd64 \ + ghcr.io/${{ github.repository }}:${{ github.sha }}-arm64 merge: name: Create Release Artifact From cf8fbada6e53a3630f7183f62d0136ddf60c80c0 Mon Sep 17 00:00:00 2001 From: Daniel Szoke <7881302+szokeasaurusrex@users.noreply.github.com> Date: Tue, 18 Feb 2025 11:31:45 +0100 Subject: [PATCH 27/32] ci(docker): Remove invalid argument (#2388) There is no `--push` argument for `docker buildx imagetools create`. The command should automatically push the new image. --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6c8b515cf4..867917a2fd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -313,7 +313,7 @@ jobs: - name: Create multi-architecture image run: | - docker buildx imagetools create --push -t ghcr.io/${{ github.repository }}:${{ github.sha }} \ + docker buildx imagetools create -t ghcr.io/${{ github.repository }}:${{ github.sha }} \ ghcr.io/${{ github.repository }}:${{ github.sha }}-amd64 \ ghcr.io/${{ github.repository }}:${{ github.sha }}-arm64 From a9faacd63a3a08f50dca537b81538a8cfd7a40cf Mon Sep 17 00:00:00 2001 From: Daniel Szoke <7881302+szokeasaurusrex@users.noreply.github.com> Date: Tue, 18 Feb 2025 12:03:48 +0100 Subject: [PATCH 28/32] ci(docker): Enable caching of Docker builds (#2389) Also, use v6 of build push action --- .github/workflows/build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 867917a2fd..c46300b10c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -290,12 +290,14 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: context: . push: true platforms: linux/${{ matrix.platform }} tags: ghcr.io/${{ github.repository }}:${{ github.sha }}-${{ matrix.platform }} + cache-from: type=gha + cache-to: type=gha,mode=max multiarch-docker: name: Create Multi-Architecture Docker Image From f783fd812e7b28559cba6960b02b37c80210adc8 Mon Sep 17 00:00:00 2001 From: Daniel Szoke <7881302+szokeasaurusrex@users.noreply.github.com> Date: Tue, 18 Feb 2025 13:27:32 +0100 Subject: [PATCH 29/32] ci(docker): Add Craft targets for `docker` (#2390) Add four new Craft targets to enable releases to Docker Hub and GHCR. These targets simply copy the multiarch Docker image built during the Release Build action to GHCR and Docker Hub. For both GHCR and Docker Hub, we create an image tagged with the version number and with "latest." Ref #1338 --- .craft.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.craft.yml b/.craft.yml index f15f64b93e..3560b6445b 100644 --- a/.craft.yml +++ b/.craft.yml @@ -94,6 +94,24 @@ targets: - name: pypi - name: sentry-pypi internalPypiRepo: getsentry/pypi + - name: docker + id: GHCR (release) + source: ghcr.io/getsentry/sentry-cli + target: ghcr.io/getsentry/sentry-cli + - name: docker + id: GHCR (latest) + source: ghcr.io/getsentry/sentry-cli + target: ghcr.io/getsentry/sentry-cli + targetFormat: '{{{target}}}:latest' + - name: docker + id: Docker Hub (release) + source: ghcr.io/getsentry/sentry-cli + target: getsentry/sentry-cli + - name: docker + id: Docker Hub (latest) + source: ghcr.io/getsentry/sentry-cli + target: getsentry/sentry-cli + targetFormat: '{{{target}}}:latest' requireNames: - /^sentry-cli-Darwin-x86_64$/ - /^sentry-cli-Darwin-arm64$/ From b57ff8b362120d80df072b8f4628773e049284ea Mon Sep 17 00:00:00 2001 From: Daniel Szoke <7881302+szokeasaurusrex@users.noreply.github.com> Date: Tue, 18 Feb 2025 15:43:22 +0100 Subject: [PATCH 30/32] ci(docker): Don't publish to GHCR via Craft (#2392) It appears that Craft does not support pushing to GHCR, only to Docker Hub: https://github.com/getsentry/publish/actions/runs/13391431698/job/37399828094 --- .craft.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.craft.yml b/.craft.yml index 3560b6445b..ce4b639441 100644 --- a/.craft.yml +++ b/.craft.yml @@ -94,15 +94,6 @@ targets: - name: pypi - name: sentry-pypi internalPypiRepo: getsentry/pypi - - name: docker - id: GHCR (release) - source: ghcr.io/getsentry/sentry-cli - target: ghcr.io/getsentry/sentry-cli - - name: docker - id: GHCR (latest) - source: ghcr.io/getsentry/sentry-cli - target: ghcr.io/getsentry/sentry-cli - targetFormat: '{{{target}}}:latest' - name: docker id: Docker Hub (release) source: ghcr.io/getsentry/sentry-cli From b18fe8ed42b4ba834d26067f9db0c9726b017b74 Mon Sep 17 00:00:00 2001 From: getsentry-bot Date: Tue, 18 Feb 2025 14:44:29 +0000 Subject: [PATCH 31/32] release: 2.42.1 --- CHANGELOG.md | 31 +++++++++++++++++++ Cargo.lock | 2 +- Cargo.toml | 2 +- npm-binary-distributions/darwin/package.json | 2 +- .../linux-arm/package.json | 2 +- .../linux-arm64/package.json | 2 +- .../linux-i686/package.json | 2 +- .../linux-x64/package.json | 2 +- .../win32-i686/package.json | 2 +- .../win32-x64/package.json | 2 +- package.json | 16 +++++----- 11 files changed, 48 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4401870598..01fd0f2d86 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,37 @@ "You know what they say. Fool me once, strike one, but fool me twice... strike three." — Michael Scott +## 2.42.1 + +### Various fixes & improvements + +- ci(docker): Don't publish to GHCR via Craft (#2392) by @szokeasaurusrex +- ci(docker): Add Craft targets for `docker` (#2390) by @szokeasaurusrex +- ci(docker): Enable caching of Docker builds (#2389) by @szokeasaurusrex +- ci(docker): Remove invalid argument (#2388) by @szokeasaurusrex +- ci(docker): Build each architecture natively (#2387) by @szokeasaurusrex +- build(docker): Build Docker image on host architecture (#2386) by @szokeasaurusrex +- build: Use hash instead of branch in GHCR tag (#2384) by @szokeasaurusrex +- build: Build Docker image in CI and publish to GHCR (#2383) by @szokeasaurusrex +- ci: Pin Actions runners' OS versions (#2353) by @szokeasaurusrex +- feat: Only warn for token org mismatch (#2382) by @szokeasaurusrex +- meta: Update LICENSE (#2380) by @szokeasaurusrex +- build: Update `url` crate (#2379) by @szokeasaurusrex +- docs: Explain why lint is disabled (#2371) by @szokeasaurusrex +- fix(update): Properly handle errors when getting latest CLI version (#2370) by @szokeasaurusrex +- ref(sourcemaps): Fix `unnecessary_wraps` for `add_debug_id_references` (#2369) by @szokeasaurusrex +- ref(sourcemaps): Fix `unnecessary_wraps` for `add_sourcemap_references` (#2368) by @szokeasaurusrex +- ref(sourcemaps): Fix `unnecessary_wraps` lint for `SourceMapsProcessor::add` (#2367) by @szokeasaurusrex +- ref(sourcemaps): Make `lookup_pos` not return `Option` (#2366) by @szokeasaurusrex +- ref: Make `Api::with_body` return `Self` (#2363) by @szokeasaurusrex +- ref(api): Make `with_retry` return `Self` (#2365) by @szokeasaurusrex +- ref(api): Make `progress_bar_mode` return `Self` (#2364) by @szokeasaurusrex +- ref(config): Fix `unnecessary_wraps` lint for `set_auth` (#2362) by @szokeasaurusrex +- ref(config): Remove unneeded `Result` from `Config::from_file` (#2361) by @szokeasaurusrex +- ref: Enable `clippy::unnecessary_wraps` lint (#2358) by @szokeasaurusrex + +_Plus 6 more_ + ## 2.41.1 ### Various fixes & improvements diff --git a/Cargo.lock b/Cargo.lock index 91975eac2d..9d85b129ce 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2696,7 +2696,7 @@ dependencies = [ [[package]] name = "sentry-cli" -version = "2.41.1" +version = "2.42.1" dependencies = [ "anyhow", "anylog", diff --git a/Cargo.toml b/Cargo.toml index cd8c33a7a5..37402388a1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ authors = ["Armin Ronacher "] build = "build.rs" name = "sentry-cli" -version = "2.41.1" +version = "2.42.1" edition = "2021" rust-version = "1.80" diff --git a/npm-binary-distributions/darwin/package.json b/npm-binary-distributions/darwin/package.json index 6cd67734cf..b58017a5d6 100644 --- a/npm-binary-distributions/darwin/package.json +++ b/npm-binary-distributions/darwin/package.json @@ -1,6 +1,6 @@ { "name": "@sentry/cli-darwin", - "version": "2.41.1", + "version": "2.42.1", "description": "The darwin distribution of the Sentry CLI binary.", "repository": "https://github.com/getsentry/sentry-cli", "license": "BSD-3-Clause", diff --git a/npm-binary-distributions/linux-arm/package.json b/npm-binary-distributions/linux-arm/package.json index 8386e2e93d..37a2b58708 100644 --- a/npm-binary-distributions/linux-arm/package.json +++ b/npm-binary-distributions/linux-arm/package.json @@ -1,6 +1,6 @@ { "name": "@sentry/cli-linux-arm", - "version": "2.41.1", + "version": "2.42.1", "description": "The linux arm distribution of the Sentry CLI binary.", "repository": "https://github.com/getsentry/sentry-cli", "license": "BSD-3-Clause", diff --git a/npm-binary-distributions/linux-arm64/package.json b/npm-binary-distributions/linux-arm64/package.json index 8f9611f1c7..b9f06bf4ec 100644 --- a/npm-binary-distributions/linux-arm64/package.json +++ b/npm-binary-distributions/linux-arm64/package.json @@ -1,6 +1,6 @@ { "name": "@sentry/cli-linux-arm64", - "version": "2.41.1", + "version": "2.42.1", "description": "The linux arm64 distribution of the Sentry CLI binary.", "repository": "https://github.com/getsentry/sentry-cli", "license": "BSD-3-Clause", diff --git a/npm-binary-distributions/linux-i686/package.json b/npm-binary-distributions/linux-i686/package.json index a6c89f658c..792a321102 100644 --- a/npm-binary-distributions/linux-i686/package.json +++ b/npm-binary-distributions/linux-i686/package.json @@ -1,6 +1,6 @@ { "name": "@sentry/cli-linux-i686", - "version": "2.41.1", + "version": "2.42.1", "description": "The linux x86 and ia32 distribution of the Sentry CLI binary.", "repository": "https://github.com/getsentry/sentry-cli", "license": "BSD-3-Clause", diff --git a/npm-binary-distributions/linux-x64/package.json b/npm-binary-distributions/linux-x64/package.json index 3909fc72c3..6f5fe0ba07 100644 --- a/npm-binary-distributions/linux-x64/package.json +++ b/npm-binary-distributions/linux-x64/package.json @@ -1,6 +1,6 @@ { "name": "@sentry/cli-linux-x64", - "version": "2.41.1", + "version": "2.42.1", "description": "The linux x64 distribution of the Sentry CLI binary.", "repository": "https://github.com/getsentry/sentry-cli", "license": "BSD-3-Clause", diff --git a/npm-binary-distributions/win32-i686/package.json b/npm-binary-distributions/win32-i686/package.json index 87234a8f93..781e0292cc 100644 --- a/npm-binary-distributions/win32-i686/package.json +++ b/npm-binary-distributions/win32-i686/package.json @@ -1,6 +1,6 @@ { "name": "@sentry/cli-win32-i686", - "version": "2.41.1", + "version": "2.42.1", "description": "The windows x86 and ia32 distribution of the Sentry CLI binary.", "repository": "https://github.com/getsentry/sentry-cli", "license": "BSD-3-Clause", diff --git a/npm-binary-distributions/win32-x64/package.json b/npm-binary-distributions/win32-x64/package.json index 3465d8f69a..0c64d45ba4 100644 --- a/npm-binary-distributions/win32-x64/package.json +++ b/npm-binary-distributions/win32-x64/package.json @@ -1,6 +1,6 @@ { "name": "@sentry/cli-win32-x64", - "version": "2.41.1", + "version": "2.42.1", "description": "The windows x64 distribution of the Sentry CLI binary.", "repository": "https://github.com/getsentry/sentry-cli", "license": "BSD-3-Clause", diff --git a/package.json b/package.json index 48a5038fea..840e757dbd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@sentry/cli", - "version": "2.41.1", + "version": "2.42.1", "description": "A command line utility to work with Sentry. https://docs.sentry.io/hosted/learn/cli/", "repository": "git://github.com/getsentry/sentry-cli.git", "homepage": "https://docs.sentry.io/hosted/learn/cli/", @@ -30,13 +30,13 @@ "prettier": "2.8.8" }, "optionalDependencies": { - "@sentry/cli-darwin": "2.41.1", - "@sentry/cli-linux-arm": "2.41.1", - "@sentry/cli-linux-arm64": "2.41.1", - "@sentry/cli-linux-i686": "2.41.1", - "@sentry/cli-linux-x64": "2.41.1", - "@sentry/cli-win32-i686": "2.41.1", - "@sentry/cli-win32-x64": "2.41.1" + "@sentry/cli-darwin": "2.42.1", + "@sentry/cli-linux-arm": "2.42.1", + "@sentry/cli-linux-arm64": "2.42.1", + "@sentry/cli-linux-i686": "2.42.1", + "@sentry/cli-linux-x64": "2.42.1", + "@sentry/cli-win32-i686": "2.42.1", + "@sentry/cli-win32-x64": "2.42.1" }, "scripts": { "postinstall": "node ./scripts/install.js", From d2b99bfb940930f5c8f06988b871fbe1fdfe9fb6 Mon Sep 17 00:00:00 2001 From: Daniel Szoke <7881302+szokeasaurusrex@users.noreply.github.com> Date: Mon, 17 Feb 2025 18:05:09 +0100 Subject: [PATCH 32/32] meta: Update CHANGELOG.md --- CHANGELOG.md | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 01fd0f2d86..2a1717c1d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,9 +4,28 @@ ## 2.42.1 +This release is a re-release of 2.42.0. There are no code changes to the CLI. We are performing this re-release because 2.42.0 failed to publish to Docker Hub. + ### Various fixes & improvements - ci(docker): Don't publish to GHCR via Craft (#2392) by @szokeasaurusrex + +## 2.42.0 + +With this release, we now build and publish multi-architecture (arm64 and aarch64) Docker images for Sentry CLI. + +### Various fixes & improvements + +- feat: Only warn for token org mismatch (#2382) by @szokeasaurusrex +- feat: Improve custom panic hook (#2355) by @szokeasaurusrex + - We now have better error messages when there is an internal error in Sentry CLI. +- feat: Deprecate `--use-artifact-bundle` option (#2349) by @szokeasaurusrex +- feat: Deprecate `useArtifactBundle` JS option (#2348) by @szokeasaurusrex +- fix(update): Properly handle errors when getting latest CLI version (#2370) by @szokeasaurusrex + +
+

Non-user-facing changes

+ - ci(docker): Add Craft targets for `docker` (#2390) by @szokeasaurusrex - ci(docker): Enable caching of Docker builds (#2389) by @szokeasaurusrex - ci(docker): Remove invalid argument (#2388) by @szokeasaurusrex @@ -15,11 +34,9 @@ - build: Use hash instead of branch in GHCR tag (#2384) by @szokeasaurusrex - build: Build Docker image in CI and publish to GHCR (#2383) by @szokeasaurusrex - ci: Pin Actions runners' OS versions (#2353) by @szokeasaurusrex -- feat: Only warn for token org mismatch (#2382) by @szokeasaurusrex - meta: Update LICENSE (#2380) by @szokeasaurusrex - build: Update `url` crate (#2379) by @szokeasaurusrex - docs: Explain why lint is disabled (#2371) by @szokeasaurusrex -- fix(update): Properly handle errors when getting latest CLI version (#2370) by @szokeasaurusrex - ref(sourcemaps): Fix `unnecessary_wraps` for `add_debug_id_references` (#2369) by @szokeasaurusrex - ref(sourcemaps): Fix `unnecessary_wraps` for `add_sourcemap_references` (#2368) by @szokeasaurusrex - ref(sourcemaps): Fix `unnecessary_wraps` lint for `SourceMapsProcessor::add` (#2367) by @szokeasaurusrex @@ -30,15 +47,18 @@ - ref(config): Fix `unnecessary_wraps` lint for `set_auth` (#2362) by @szokeasaurusrex - ref(config): Remove unneeded `Result` from `Config::from_file` (#2361) by @szokeasaurusrex - ref: Enable `clippy::unnecessary_wraps` lint (#2358) by @szokeasaurusrex +- ci: Change lint action to `-D warnings` (#2359) by @szokeasaurusrex +- ref: Simplify `--log-level` parsing (#2356) by @szokeasaurusrex +- docs: Correct typo in doc string (#2354) by @szokeasaurusrex -_Plus 6 more_ +
## 2.41.1 ### Various fixes & improvements - build: Replace `dotenv` with `dotenvy` (#2351) by @szokeasaurusrex - - This fixes a problem where multiline env variables were not supported in `.env` files + - This fixes a problem where multiline env variables were not supported in `.env` files ## 2.41.0