You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cleanup/deprecate scopes BitField in favor of the already existing scope_list #50475
Currently, our auth-related models have both a scopes field, which is a BitField, as well as a scope_list, which is an array of strings.
As far as I can tell, we used to use the scopes field but migrated to scope_list some years ago. However, both still remain, and when working with these things it can be a bit confusing about what/why exists/is used.
@mitsuhiko checked and it seems we have migrated scopes -> scope_list some time ago already, so maybe we can actually just deprecate this right now in order to make this clearer for the future. (probably needs more investigation, though).
Note that even today, this is flawed because the list of BitField values is not in sync with the actual list of available scopes, e.g. scopes that are added in getsentry + some we added later cannot be represented by the BitField.
Solution Brainstorm
Deprecate/remove the scopes BitField field from all models that have it.
This issue has gone three weeks without activity. In another week, I will close it.
But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!
"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀
Follow-up PR: #127282 removes the scopes BitField fallback from get_scopes(); the field and migrations remain unchanged for now. Production check in the control DB returned 0 rows with nonzero scopes and empty scope_list across sentry_apitoken, sentry_apikey, sentry_apiauthorization, sentry_apigrant, and sentry_sentryapp. The PR is ready for review.
Activity
github-actions commentedon Jun 29, 2023
This issue has gone three weeks without activity. In another week, I will close it.
But! If you comment or otherwise update it, I will reset the clock, and if you label it
Status: BacklogorStatus: In Progress, I will leave it alone ... forever!"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀
sentry-junior commentedon Oct 13, 2026
Follow-up PR: #127282 removes the
scopesBitField fallback fromget_scopes(); the field and migrations remain unchanged for now. Production check in the control DB returned 0 rows with nonzeroscopesand emptyscope_listacrosssentry_apitoken,sentry_apikey,sentry_apiauthorization,sentry_apigrant, andsentry_sentryapp. The PR is ready for review.ref(auth): Stop falling back to scopes bitfield in get_scopes (#127282)
ref(auth): Move legacy scopes bitfield columns to pending deletion
ref(auth): Move legacy scopes bitfield columns to pending deletion (#…
ref(auth): Drop legacy scopes bitfield columns
ref(auth): Drop legacy scopes bitfield columns (#127761)
sentry-junior commentedon Oct 19, 2026
Done. The legacy
scopesBitField has been fully removed in favor ofscope_list:get_scopes()fallback to the bitfield (prod check found 0 rows depending on it)SafeRemoveField(MOVE_TO_PENDING)scopescolumns,SafeRemoveField(DELETE)The column drop has run in production; Redash confirms the
scopescolumns are gone. Closing.ref(auth): Move legacy scopes bitfield columns to pending deletion (#…
ref(auth): Drop legacy scopes bitfield columns (#127761)