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

feat(relocation): Enable globally for superusers #61822

Merged
merged 1 commit into from
Dec 15, 2023

Conversation

azaslavsky
Copy link
Contributor

@azaslavsky azaslavsky commented Dec 15, 2023

Superusers (aka admins) will now be able to hit the relocation endpoint successfully in all deployments. The relocation:enabled flag, and the relocation.enabled option that controls it, will instead refer only to the self-serve endpoint, which will remain contained to the test region for now.

This means that admins can now trigger relocations in any region for any user, and are not throttled when they do so. Regular users may only trigger relocations for themselves in regions where relocations.enabled is set to True, and are subject to the global daily throttles.

Issue: getsentry/team-ospo#214

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Dec 15, 2023
Superusers (aka admins) will no be able to hit the relocation endpoint
successfully in all deployments. The `relocation:enabled` flag, and the
`relocation.enabled` option that controls it, will instead refer only to
the self-serve endpoint, which will remain contained to the test region
for now.

This means that admins can now trigger relocations in any region for any
user, and are not throttled when they do so. Regular users may only
trigger relocations for themselves in regions where
`relocations.enabled` is set to `True`, and are subject to the global
daily throttles.

Issue: getsentry/team-ospo#214
Copy link

codecov bot commented Dec 15, 2023

Codecov Report

Merging #61822 (137e966) into master (4413316) will decrease coverage by 0.01%.
Report is 17 commits behind head on master.
The diff coverage is 91.30%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #61822      +/-   ##
==========================================
- Coverage   81.20%   81.20%   -0.01%     
==========================================
  Files        5187     5187              
  Lines      228307   228390      +83     
  Branches    38294    38313      +19     
==========================================
+ Hits       185406   185460      +54     
- Misses      37269    37292      +23     
- Partials     5632     5638       +6     
Files Coverage Δ
src/sentry/options/defaults.py 100.00% <ø> (ø)
src/sentry/api/endpoints/relocations/index.py 95.68% <91.30%> (-1.49%) ⬇️

... and 23 files with indirect coverage changes

)

# Only superusers can start relocations for other users.
Copy link
Member

Choose a reason for hiding this comment

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

Good to be extra safe here, but just thinking if this would ever be a problem. Since the only time I'm thinking someone is allowed to enter in the owner of a relocation is in the admin panel

except KeyError:
return Response(
{"detail": ERR_UNKNOWN_RELOCATION_STATUS.substitute(status=status_str)},
status=400,
status=status.HTTP_400_BAD_REQUEST,
Copy link
Member

Choose a reason for hiding this comment

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

nice catches here on using status

@azaslavsky azaslavsky merged commit c3faedd into master Dec 15, 2023
51 checks passed
@azaslavsky azaslavsky deleted the az/open-post-endpoint branch December 15, 2023 21:47
Copy link

sentry-io bot commented Dec 20, 2023

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ ControlOption.DoesNotExist: ControlOption matching query does not exist. pytest.runtest.protocol tests/sentry/api/endpoi... View Issue

Did you find this useful? React with a 👍 or 👎

@github-actions github-actions bot locked and limited conversation to collaborators Jan 5, 2024
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants