fix(commands): Add missing env vars for release name detection
Check env vars SENTRY_RELEASE and GAE_DEPLOYMENT_ID when detecting release name, as done by SDKs.
Fixes GH-2050
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 thereleases newcommand (which does not readdetect_release) -
bash-hook: Used to monitor bash scripts for errors; I believe this command is "soft-deprecated" since we hide it from thesentry-cli --helpoutput -
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?
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.