Skip to content

ref(releases): Bulk read and update on the happy path #92508

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

Open
wants to merge 19 commits into
base: master
Choose a base branch
from

Conversation

cmanallen
Copy link
Member

@cmanallen cmanallen commented May 29, 2025

Presently we are reading then updating each release individually. This is inefficient. We can read and update multiple releases at a time. As of the most recent run we read and updated 100x the number of rows in the happy path as we did the unhappy path. By implementing the bulk logic in the happy path first we can minimize our change surface and receive 99% of the reward. Note: tasks are chunked by organization so we can't move everything into a single query. But for the scope of an individual task (org) we are reading and updating with two queries.

Moving to this bulk refactor allowed us to further flatten the function definitions. Making them more tractable when trying to read and understand the code. This new behavior has unit and integration testing in addition to the unchanged functional test coverage. In a follow up PR I'll clean up the unhappy path.

Current total system time is ~15 minutes. We'll measure success by stable operation and improvements to total system time.

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label May 29, 2025
Copy link

codecov bot commented May 29, 2025

Codecov Report

Attention: Patch coverage is 93.60000% with 8 lines in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/sentry/release_health/tasks.py 86.66% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #92508      +/-   ##
==========================================
+ Coverage   87.78%   87.92%   +0.14%     
==========================================
  Files       10258    10250       -8     
  Lines      588215   587705     -510     
  Branches    22859    22727     -132     
==========================================
+ Hits       516347   516742     +395     
+ Misses      71421    70541     -880     
+ Partials      447      422      -25     

Copy link
Member

@aliu39 aliu39 left a comment

Choose a reason for hiding this comment

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

Changes look good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Backend Automatically applied to PRs that change backend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants