Skip to content

ref(grouping): Add check for suppress_unnecessary_secondary_hash flag#64312

Merged
lobsterkatie merged 2 commits intomasterfrom
kmclb-add-check-for-suppress-unnecessary-secondary-hash-flag
Jan 31, 2024
Merged

ref(grouping): Add check for suppress_unnecessary_secondary_hash flag#64312
lobsterkatie merged 2 commits intomasterfrom
kmclb-add-check-for-suppress-unnecessary-secondary-hash-flag

Conversation

@lobsterkatie
Copy link
Copy Markdown
Member

@lobsterkatie lobsterkatie commented Jan 31, 2024

This wraps _save_aggregate (whose logic is going to be updated in a new version of the function) in a new function, assign_event_to_group, which determines whether to run the current version or the new version. Which version to run is controlled both by the suppress_unnecessary_secondary_hash flag added in #64128 and by the project's grouping configs - any project using the mobile config as either their primary or secondary config has to use the current logic, since the new logic won't include any of the hierarchical grouping code. Note: For now both branches call the current version of _save_aggregate, as the new version has yet to be written.

In addition, two bits of logic from save_error_events, which set group data on the event and the job, have been moved into the new wrapper.

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Jan 31, 2024
@codecov
Copy link
Copy Markdown

codecov bot commented Jan 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (d175433) 81.27% compared to head (8d776c4) 81.27%.
Report is 8 commits behind head on master.

❗ Current head 8d776c4 differs from pull request most recent head e61e526. Consider uploading reports for the commit e61e526 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #64312      +/-   ##
==========================================
- Coverage   81.27%   81.27%   -0.01%     
==========================================
  Files        5236     5236              
  Lines      230537   230536       -1     
  Branches    45229    45229              
==========================================
- Hits       187370   187362       -8     
- Misses      37323    37330       +7     
  Partials     5844     5844              

see 8 files with indirect coverage changes

@lobsterkatie lobsterkatie marked this pull request as ready for review January 31, 2024 19:57
@lobsterkatie lobsterkatie requested a review from a team as a code owner January 31, 2024 19:57
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I believe this would be more appropriate return type

Suggested change
def assign_event_to_group(event: Event, job: Job, metric_tags: MutableTags) -> Optional[GroupInfo]:
def assign_event_to_group(event: Event, job: Job, metric_tags: MutableTags) -> GroupInfo | None:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You can follow this up on the next PR if you want to merge it now

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Oh, yeah, I guess we can do that now, without even using __future__, huh? Yay for finally being off of Python 3.8!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Finally 🚀

@lobsterkatie lobsterkatie force-pushed the kmclb-add-check-for-suppress-unnecessary-secondary-hash-flag branch from 8d776c4 to e61e526 Compare January 31, 2024 20:28
@lobsterkatie lobsterkatie merged commit 54ede04 into master Jan 31, 2024
@lobsterkatie lobsterkatie deleted the kmclb-add-check-for-suppress-unnecessary-secondary-hash-flag branch January 31, 2024 21:22
@sentry
Copy link
Copy Markdown
Contributor

sentry bot commented Jan 31, 2024

Suspect Issues

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

  • ‼️ IntegrityError: UniqueViolation('duplicate key value violates unique constraint "sentry_groupedmessage_project_id... sentry.tasks.store.save_event View Issue

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

@lobsterkatie lobsterkatie added the Trigger: Revert Add to a merged PR to revert it (skips CI) label Jan 31, 2024
@getsentry-bot
Copy link
Copy Markdown
Contributor

PR reverted: 1f95319

getsentry-bot added a commit that referenced this pull request Jan 31, 2024
…hash` flag (#64312)"

This reverts commit 54ede04.

Co-authored-by: lobsterkatie <14812505+lobsterkatie@users.noreply.github.com>
lobsterkatie added a commit that referenced this pull request Feb 2, 2024
…ag (#64410)

NOTE: This is a redo of #64312, which got reverted when it seemed it might be causing an error. Turns out it wasn't to blame, so pushing it through again.

---------

This wraps `_save_aggregate` (whose logic is going to be updated in a new version of the function) in a new function, `assign_event_to_group`, which determines whether to run the current version or the new version. Which version to run is controlled both by the `suppress_unnecessary_secondary_hash` flag added in #64128 and by the project's grouping configs - any project using the mobile config as either their primary or secondary config has to use the current logic, since the new logic won't include any of the hierarchical grouping code. Note: For now both branches call the current version of `_save_aggregate`, as the new version has yet to be written.

In addition, two bits of logic from `save_error_events`, which set group data on the event and the job, have been moved into the new wrapper.
cmanallen pushed a commit that referenced this pull request Feb 7, 2024
…ag (#64410)

NOTE: This is a redo of #64312, which got reverted when it seemed it might be causing an error. Turns out it wasn't to blame, so pushing it through again.

---------

This wraps `_save_aggregate` (whose logic is going to be updated in a new version of the function) in a new function, `assign_event_to_group`, which determines whether to run the current version or the new version. Which version to run is controlled both by the `suppress_unnecessary_secondary_hash` flag added in #64128 and by the project's grouping configs - any project using the mobile config as either their primary or secondary config has to use the current logic, since the new logic won't include any of the hierarchical grouping code. Note: For now both branches call the current version of `_save_aggregate`, as the new version has yet to be written.

In addition, two bits of logic from `save_error_events`, which set group data on the event and the job, have been moved into the new wrapper.
@github-actions github-actions bot locked and limited conversation to collaborators Feb 16, 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 Trigger: Revert Add to a merged PR to revert it (skips CI)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants