Skip to content

Cleanup/deprecate scopes BitField in favor of the already existing scope_list #50475

Closed

Description

@mydea

Problem Statement

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.

Product Area

Other

Activity

  1. github-actions commented on Jun 29, 2023

    @github-actions
    Contributor

    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 🥀

  2. self-assigned this
    on Jul 28, 2025
  3. removed their assignment
    on Aug 4, 2025
  4. sentry-junior commented on Oct 13, 2026

    @sentry-junior
    Contributor

    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.

  5. sentry-junior commented on Oct 19, 2026

    @sentry-junior
    Contributor

    Done. The legacy scopes BitField has been fully removed in favor of scope_list:

    The column drop has run in production; Redash confirms the scopes columns are gone. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions