Skip to content

fix: set default environment to production only if environment is None #90323

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

Merged
merged 6 commits into from
May 5, 2025

Conversation

seer-by-sentry[bot]
Copy link
Contributor

👋 Hi there! This PR was automatically generated by Autofix 🤖

Fixes SENTRY-3SWF. The issue was that: event_data.get() returned None when the 'environment' key existed with a None value, causing Environment.objects.get(name=None) to fail.

The environment was being defaulted to production even if the environment was an empty string. This change ensures that the environment is only defaulted to production if the environment is None.

If you have any questions or feedback for the Sentry team about this fix, please email autofix@sentry.io with the Run ID: 32163.

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Apr 24, 2025
@michellewzhang michellewzhang marked this pull request as ready for review April 24, 2025 19:47
@michellewzhang michellewzhang requested a review from a team as a code owner April 24, 2025 19:47
@michellewzhang michellewzhang requested a review from aliu39 April 24, 2025 19:47
@michellewzhang michellewzhang added the Trigger: getsentry tests Once code is reviewed: apply label to PR to trigger getsentry tests label Apr 24, 2025
@github-actions github-actions bot removed the Trigger: getsentry tests Once code is reviewed: apply label to PR to trigger getsentry tests label May 5, 2025
@michellewzhang michellewzhang added the Trigger: getsentry tests Once code is reviewed: apply label to PR to trigger getsentry tests label May 5, 2025
@aliu39 aliu39 merged commit 7f15142 into master May 5, 2025
60 of 61 checks passed
@aliu39 aliu39 deleted the autofix/fix-feedback-environment-default branch May 5, 2025 18:06
andrewshie-sentry pushed a commit that referenced this pull request May 12, 2025
#90323)

👋 Hi there! This PR was automatically generated by Autofix 🤖


Fixes
[SENTRY-3SWF](https://sentry.io/organizations/sentry/issues/6565092543/).
The issue was that: `event_data.get()` returned `None` when the
'environment' key existed with a `None` value, causing
`Environment.objects.get(name=None)` to fail.

The environment was being defaulted to production even if the
environment was an empty string. This change ensures that the
environment is only defaulted to production if the environment is None.

If you have any questions or feedback for the Sentry team about this
fix, please email [autofix@sentry.io](mailto:autofix@sentry.io) with the
Run ID: 32163.

---------

Co-authored-by: sentry-autofix[bot] <157164994+sentry-autofix[bot]@users.noreply.github.com>
Co-authored-by: Andrew Liu <159852527+aliu39@users.noreply.github.com>
Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>
@github-actions github-actions bot locked and limited conversation to collaborators May 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Scope: Backend Automatically applied to PRs that change backend components Trigger: getsentry tests Once code is reviewed: apply label to PR to trigger getsentry tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants