-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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(aci): Create and update open periods when groups are resolved or unresolved #88650
Conversation
Codecov ReportAttention: Patch coverage is ✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## master #88650 +/- ##
==========================================
+ Coverage 87.72% 87.78% +0.06%
==========================================
Files 10064 10050 -14
Lines 569157 570161 +1004
Branches 22351 22220 -131
==========================================
+ Hits 499269 500507 +1238
+ Misses 69508 69235 -273
- Partials 380 419 +39 |
There's a failing test (
Would the fix be to set |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mostly lgtm just have a couple questions
Is the problem that the test is deleting a group that's referenced as a FK in the group open period model? Would you want to delete the group open period row when that happens? I think you'd need to set that up in the deletions task here (I could be totally off base but that's what I'd look at) |
Ah good point, added it there! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, wouldn't be offended if you wanted another pass by someone else on the team though
Suspect IssuesThis pull request was deployed and Sentry observed the following issues:
Did you find this useful? React with a 👍 or 👎 |
This PR adds all the writes to
sentry_groupopenperiod
to track the open periods as a group is resolved or unresolved. There's a lot of places we change group status (yay) so here's a breakdown of what we're doing in this PR:Creating open periods
event_manager._create_group
, guaranteeing every group will start with an open period.event_manager._handle_regression
. We deal with regressions further downstream in post_process as well, but this is the first spot where the regression is detected and the group is reopened so it makes sense to create a new open period here as well.create_group
fixture to create an open period so tests mimic this behavior. This method also closes the open period if we call it withcreate_group(status=GroupStatus.RESOLVED
.Updating open periods
We update an open period in the following ways based on the new status
GroupStatus.RESOLVED
: close the latest open periodGroupStatus.UNRESOLVED
: this one is more nuanced --GroupSubStatus.REGRESSED
, we do nothing. The regression is handled inevent_manager
as detailed above.In both these cases, we expect the open period to already exist. I've added logging to surface if this isn't the case and expect to see these errors until we backfill the table. Once the backfill is complete, any of these logs will indicate a gap in our handling of open periods. A potential interim fix here is to use the Activity to create the missing open period (ad-hoc backfill) so we can update it as expected. We can remove that once the larger backfill is run.
I've added
update_group_open_period
togroup.py
to capture all of this logic.Closing open periods
Group resolution is done either manually (in
group_index/update.py
process_group_resolution
) or via the auto-resolution task. Both these spots use theupdate_group_open_period
helper to update the open period.Merging/Unmerging groups: