From 7c3da7c24f4db94cf03ddb54254a179ee6c4bc0e Mon Sep 17 00:00:00 2001 From: Daniel Szoke <7881302+szokeasaurusrex@users.noreply.github.com> Date: Tue, 26 Nov 2024 07:11:30 -0500 Subject: [PATCH] ref(proguard): Define environment variable name in constant (#2265) Likely would be better to keep this string in a constant to ensure we don't copy the wrong thing to the places where we use it --- src/commands/upload_proguard.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/commands/upload_proguard.rs b/src/commands/upload_proguard.rs index 1f20c0916b..29a75cf9fe 100644 --- a/src/commands/upload_proguard.rs +++ b/src/commands/upload_proguard.rs @@ -23,6 +23,8 @@ use crate::utils::proguard_upload; use crate::utils::system::QuietExit; use crate::utils::ui::{copy_with_progress, make_byte_progress_bar}; +const CHUNK_UPLOAD_ENV_VAR: &str = "SENTRY_EXPERIMENTAL_PROGUARD_CHUNK_UPLOAD"; + #[derive(Debug)] pub struct MappingRef { pub path: PathBuf, @@ -206,11 +208,11 @@ pub fn execute(matches: &ArgMatches) -> Result<()> { let authenticated_api; let (org, project); - if env::var("SENTRY_EXPERIMENTAL_PROGUARD_CHUNK_UPLOAD") == Ok("1".into()) { + if env::var(CHUNK_UPLOAD_ENV_VAR) == Ok("1".into()) { log::warn!( "EXPERIMENTAL FEATURE: Uploading proguard mappings using chunked uploading. \ Some functionality may be unavailable when using chunked uploading. Please unset \ - the SENTRY_EXPERIMENTAL_PROGUARD_CHUNK_UPLOAD variable if you encounter any \ + the {CHUNK_UPLOAD_ENV_VAR} variable if you encounter any \ problems." ); @@ -224,7 +226,7 @@ pub fn execute(matches: &ArgMatches) -> Result<()> { options.ok_or_else(|| { anyhow::anyhow!( "server does not support chunked uploading. unset \ - SENTRY_EXPERIMENTAL_PROGUARD_CHUNK_UPLOAD to continue." + {CHUNK_UPLOAD_ENV_VAR} to continue." ) }) })?;