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: apitoken last characters option #59455

Closed
wants to merge 5 commits into from
Closed

Conversation

mdtro
Copy link
Member

@mdtro mdtro commented Nov 6, 2023

  • Add an option to toggle on/off automatically populating the token_last_characters for the ApiToken model.

This option will ensure tokens created from here on have the field populated. It will also allow me to thoroughly test the backfill migration needed for existing tokens that will be coming in a future PR by disabling the option in tests, creating a bunch of API tokens, and then running the backfill migration test.

Tracking Issue: #58918
RFC: getsentry/rfcs#32

Copy link

codecov bot commented Nov 7, 2023

Codecov Report

Merging #59455 (6120b76) into master (398c381) will decrease coverage by 0.01%.
Report is 849 commits behind head on master.
The diff coverage is 100.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #59455      +/-   ##
==========================================
- Coverage   80.76%   80.76%   -0.01%     
==========================================
  Files        5179     5179              
  Lines      227404   227418      +14     
  Branches    38254    38255       +1     
==========================================
+ Hits       183671   183679       +8     
- Misses      38138    38144       +6     
  Partials     5595     5595              
Files Coverage Δ
src/sentry/backup/comparators.py 94.35% <ø> (ø)
src/sentry/models/apitoken.py 99.02% <100.00%> (+0.06%) ⬆️
src/sentry/options/defaults.py 100.00% <100.00%> (ø)
static/app/components/avatar/avatarList.tsx 90.90% <ø> (ø)
...atic/app/utils/analytics/growthAnalyticsEvents.tsx 100.00% <ø> (ø)

... and 7 files with indirect coverage changes

Copy link
Contributor

@azaslavsky azaslavsky left a comment

Choose a reason for hiding this comment

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

If we want to be extra careful, we should modify one of the two calls to ApiToken.objects.create(...) in src/sentry/testutils/helpers/backups.py to include token_last_characters, while the other one continues writing null. Then we get coverage for both options while we roll this out, to prevent breaking self-hosted users.

src/sentry/backup/comparators.py Show resolved Hide resolved
@getsantry
Copy link
Contributor

getsantry bot commented Dec 7, 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 remove the label Waiting for: Community, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@getsantry getsantry bot added the Stale label Dec 7, 2023
@getsantry getsantry bot closed this Dec 15, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Dec 30, 2023
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 Stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants