sentry-cli icon indicating copy to clipboard operation
sentry-cli copied to clipboard

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

Open elramen opened this issue 1 year ago • 2 comments

Check env vars SENTRY_RELEASE and GAE_DEPLOYMENT_ID when detecting release name, as done by SDKs.

Fixes GH-2050

elramen avatar Apr 30 '24 15:04 elramen

I am not sure whether this is very useful from the CLI context, especially because we are only using the detect_release function from some less-commonly used commands in the CLI:

  • releases propose-version: Kinda strange to return a user-configured environment variable as our suggestion here; user could just provide the releases new command (which does not read detect_release)
  • bash-hook: Used to monitor bash scripts for errors; I believe this command is "soft-deprecated" since we hide it from the sentry-cli --help output
  • send-event: Probably would be most useful here, this command sends individual events to Sentry

I am more uncertain about whether checking GAE_DEPLOYMENT_ID is necessary; can you please explain when you would envision this being useful?

szokeasaurusrex avatar May 03 '24 12:05 szokeasaurusrex

Send-metric is going to auto-detect the release if it's not specified by the user. This is part of the metrics specification, i.e. the release tag should be added by default. Looking at the env vars checked by the Python SDK, detect_release_name() in sentry-cli checks all of them except the two added in this PR.

Especially SENTRY_RELEASE seems to be a common way of setting the release across different platforms/environments.

elramen avatar May 03 '24 16:05 elramen