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

migration: backfill apitoken last characters #63342

Merged
merged 3 commits into from
Jan 17, 2024

Conversation

mdtro
Copy link
Member

@mdtro mdtro commented Jan 17, 2024

Backfills the token_last_characters column on existing ApiTokens.

As of #62972, new ApiTokens are being created with this column already populated with the correct values. This backfill will only impact old tokens created prior.

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

@mdtro mdtro requested a review from a team as a code owner January 17, 2024 17:27
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Jan 17, 2024
Copy link
Contributor

This PR has a migration; here is the generated SQL for src/sentry/migrations/0631_apitoken_backfill_last_chars.py ()

--
-- MIGRATION NOW PERFORMS OPERATION THAT CANNOT BE WRITTEN AS SQL:
-- Raw Python operation
--

@mdtro mdtro force-pushed the mdtro/apitoken-backfill-last-chars branch from e95805a to c9bb0ac Compare January 17, 2024 17:31
@mdtro mdtro changed the title migration: backfill apitoken last chars migration: backfill apitoken last characters Jan 17, 2024
Copy link

codecov bot commented Jan 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (a2f2cd8) 56.54% compared to head (32ee72c) 81.34%.
Report is 1 commits behind head on master.

❗ Current head 32ee72c differs from pull request most recent head 12130cb. Consider uploading reports for the commit 12130cb to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##           master   #63342       +/-   ##
===========================================
+ Coverage   56.54%   81.34%   +24.80%     
===========================================
  Files        5196     5208       +12     
  Lines      230738   231097      +359     
  Branches    39867    39934       +67     
===========================================
+ Hits       130460   187993    +57533     
+ Misses      96256    37325    -58931     
- Partials     4022     5779     +1757     

see 1830 files with indirect coverage changes

Copy link
Member

@markstory markstory left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@mdtro mdtro force-pushed the mdtro/apitoken-backfill-last-chars branch from 32ee72c to 496a112 Compare January 17, 2024 22:22
Copy link
Contributor

This PR has a migration; here is the generated SQL for src/sentry/migrations/0632_apitoken_backfill_last_chars.py ()

--
-- MIGRATION NOW PERFORMS OPERATION THAT CANNOT BE WRITTEN AS SQL:
-- Raw Python operation
--

@mdtro mdtro enabled auto-merge (squash) January 17, 2024 22:45
@mdtro mdtro merged commit e1cf672 into master Jan 17, 2024
49 checks passed
@mdtro mdtro deleted the mdtro/apitoken-backfill-last-chars branch January 17, 2024 22:46
trillville pushed a commit that referenced this pull request Jan 19, 2024
Backfills the `token_last_characters` column on existing `ApiToken` entries.

As of #62972, new `ApiToken` entries
are being created with this column already populated with the correct
values. This backfill will only impact old tokens created prior.

Tracking Issue: #58918
Related RFC: getsentry/rfcs#32
@github-actions github-actions bot locked and limited conversation to collaborators Feb 2, 2024
@mdtro mdtro linked an issue Feb 2, 2024 that may be closed by this pull request
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.

feat: add name and token_last_characters to ApiToken
2 participants