Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(commands): Add missing env vars for release name detection #2051

Merged
merged 1 commit into from
May 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion src/utils/releases.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,14 @@ pub fn infer_gradle_release_name(path: Option<PathBuf>) -> Result<Option<String>

/// Detects the release name for the current working directory.
pub fn detect_release_name() -> Result<String> {
// cordova release detection first.
// try SENTRY_RELEASE environment variable
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the comment is almost the same as the code below it, just leave out the comment

if let Ok(release) = env::var("SENTRY_RELEASE") {
if !release.is_empty() {
return Ok(release);
}
}

// try cordova release detection
if let Some(release) = get_cordova_release_name(None)? {
return Ok(release);
}
Expand Down Expand Up @@ -142,6 +149,13 @@ pub fn detect_release_name() -> Result<String> {
return Ok(release);
}

// try Google App Engine: https://cloud.google.com/appengine/docs/standard/python3/runtime#environment_variables
if let Ok(release) = env::var("GAE_DEPLOYMENT_ID") {
if !release.is_empty() {
return Ok(release);
}
}

match vcs::find_head() {
Ok(head) => Ok(head),
Err(e) => Err(anyhow!(
Expand Down
Loading