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

ref(grouping): Call _save_aggregate_new when feature flag enabled #64851

Merged
merged 3 commits into from
Feb 12, 2024

Conversation

lobsterkatie
Copy link
Member

@lobsterkatie lobsterkatie commented Feb 8, 2024

This PR is a step towards updating the logic of _save_aggregate. The new logic will be contained in a separate function, so as a first step, this PR creates the new function, with identical logic to _save_aggregate. That way, when changes are made, they'll be starting from the same baseline as they would be were _save_aggregate itself being modified, which should hopefully make reviewing easier. It also switches to calling this new function in the flag-on branch of assign_event_to_group.

Finally, to make sure that everything still works as expected, the assign_event_to_group tests have been modified to now run both branches, flag on and flag off.

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Feb 8, 2024
Copy link

sentry-io bot commented Feb 8, 2024

🔍 Existing Issues For Review

Your pull request is modifying functions with the following pre-existing issues:

📄 File: src/sentry/event_manager.py

Function Unhandled Issue
_save_aggregate UnableToAcquireLock: Unable to acquire <Lock: 'grouping-update-lock:61797'> due to error: Could not set key: 'l:groupi... ...
Event Count: 1

Did you find this useful? React with a 👍 or 👎

@lobsterkatie lobsterkatie force-pushed the kmclb-add-assign-to-group-tests branch 2 times, most recently from 6eabddc to 617d576 Compare February 8, 2024 09:27
@lobsterkatie lobsterkatie force-pushed the kmclb-run-new-_save_aggregate-logic branch from a0e70c6 to 41dba16 Compare February 8, 2024 09:46
@lobsterkatie lobsterkatie changed the title feat(grouping): Call _save_aggregate_new when feature flag enabled ref(grouping): Call _save_aggregate_new when feature flag enabled Feb 8, 2024
@lobsterkatie lobsterkatie force-pushed the kmclb-add-assign-to-group-tests branch from 617d576 to e517e7e Compare February 8, 2024 19:04
@lobsterkatie lobsterkatie force-pushed the kmclb-run-new-_save_aggregate-logic branch from 41dba16 to 4d75869 Compare February 8, 2024 19:06
@lobsterkatie lobsterkatie marked this pull request as ready for review February 8, 2024 20:29
@lobsterkatie lobsterkatie requested review from a team as code owners February 8, 2024 20:29
Copy link
Member

@JoshFerge JoshFerge left a comment

Choose a reason for hiding this comment

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

nit: it would be nice if you linked the PR this was stacked on top of, since GH's UI is not the best for navigating these

@lobsterkatie
Copy link
Member Author

nit: it would be nice if you linked the PR this was stacked on top of, since GH's UI is not the best for navigating these

Sorry - hadn't yet linked them all in the epic: #61661

(You'll notice I'm being super step-by-step-y with these changes. I really don't want to break ingestion.)

Copy link
Member

@wedamija wedamija left a comment

Choose a reason for hiding this comment

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

Is the eventual goal here to remove the existing save_aggregate and rename this new one?

@lobsterkatie
Copy link
Member Author

Is the eventual goal here to remove the existing save_aggregate and rename this new one?

Indeed.

Well, actually, that's a lie. Once the old version is gone, all of the logic from _save_aggregate_new can just move into assign_event_to_group. That currently just picks which version of _save_aggregate to call, and it will just become a pass-through once the original _save_aggregate is gone.

Copy link

codecov bot commented Feb 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (a1ae836) 81.40% compared to head (92c5d00) 81.40%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #64851      +/-   ##
==========================================
- Coverage   81.40%   81.40%   -0.01%     
==========================================
  Files        5251     5251              
  Lines      232145   232145              
  Branches    45581    45581              
==========================================
- Hits       188987   188972      -15     
- Misses      37276    37285       +9     
- Partials     5882     5888       +6     

see 7 files with indirect coverage changes

Base automatically changed from kmclb-add-assign-to-group-tests to master February 12, 2024 18:45
@lobsterkatie lobsterkatie force-pushed the kmclb-run-new-_save_aggregate-logic branch from 5f3a76f to b34661e Compare February 12, 2024 18:48
@lobsterkatie lobsterkatie force-pushed the kmclb-run-new-_save_aggregate-logic branch from b34661e to 92c5d00 Compare February 12, 2024 19:50
@lobsterkatie lobsterkatie merged commit 2d13378 into master Feb 12, 2024
49 checks passed
@lobsterkatie lobsterkatie deleted the kmclb-run-new-_save_aggregate-logic branch February 12, 2024 20:38
lobsterkatie added a commit that referenced this pull request Feb 12, 2024
…nabled (#64857)

This is a follow-up to #64851, and does a similar thing: Before modifying the logic of `find_existing_grouphash`, it creates an identical copy, `find_existing_grouphash_new`, to be called in the feature-flag-on branch of `assign_event_to_group` (via `_save_aggregate_new`). As in that PR, the reason for doing this is so that it will be easier to tell what actually changes between the current version of the function and the new version once those changes are made.
Copy link

sentry-io bot commented Feb 15, 2024

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ KeyError: 'event_metadata' pytest.runtest.protocol tests/sentry/tasks/test... View Issue
  • ‼️ KeyError: 'event_metadata' pytest.runtest.protocol tests/sentry/tasks/test... View Issue
  • ‼️ KeyError: 'event_metadata' pytest.runtest.protocol tests/sentry/tasks/test... View Issue
  • ‼️ KeyError: 'event_metadata' pytest.runtest.protocol tests/integration/test_... View Issue
  • ‼️ KeyError: 'event_metadata' pytest.runtest.protocol tests/sentry/integratio... View Issue

Did you find this useful? React with a 👍 or 👎

@github-actions github-actions bot locked and limited conversation to collaborators Mar 4, 2024
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.

4 participants