getsentry / getsentry/sentry

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

Open
#50,475 1 comment 0 reactions 0 assignees View on GitHub
Auth
Dominant language
Python
Stars
44.8k
Forks
4.9k
Avg merge
1d 5h
Merged PRs (30d)
624

Description

### 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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.