-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
feat(GALE): Invalidate derived data on merge #118378
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
Changes from all commits
6ca743b
52d26eb
89a329f
a997f36
fd4c42a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,8 +8,9 @@ | |
| from django.db.models.functions import Coalesce | ||
| from taskbroker_client.retry import Retry | ||
|
|
||
| from sentry import eventstream, similarity, tsdb | ||
| from sentry import eventstream, features, similarity, tsdb | ||
| from sentry.db.models.base import Model | ||
| from sentry.issues.derived.processing import invalidate_group_derived_data | ||
| from sentry.issues.models.groupactionlogentry import GroupActionLogEntry | ||
| from sentry.models.group import Group | ||
| from sentry.silo.base import SiloMode | ||
|
|
@@ -59,7 +60,10 @@ def merge_groups( | |
| from_object_id = from_object_ids[0] | ||
|
|
||
| try: | ||
| new_group, _ = get_group_with_redirect(to_object_id) | ||
| new_group, _ = get_group_with_redirect( | ||
| to_object_id, | ||
| queryset=Group.objects.select_related("project__organization"), | ||
| ) | ||
| except Group.DoesNotExist: | ||
| logger.warning( | ||
| "group.malformed.invalid_id", | ||
|
|
@@ -206,9 +210,17 @@ def merge_groups( | |
| recursed=True, | ||
| eventstream_state=eventstream_state, | ||
| ) | ||
| elif eventstream_state: | ||
| # All `from_object_ids` have been merged! | ||
| eventstream.backend.end_merge(eventstream_state) | ||
| else: | ||
| if features.has( | ||
| "organizations:hard-delete-derived-data-invalidation", | ||
| new_group.project.organization, | ||
| ): | ||
|
Comment on lines
+215
to
+217
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: A Suggested FixThe Prompt for AI Agent |
||
| # hard delete derived data on the new group - it will be rebuilt when the next action is processed | ||
| invalidate_group_derived_data(new_group.id) | ||
|
cursor[bot] marked this conversation as resolved.
|
||
|
|
||
| if eventstream_state: | ||
| # All `from_object_ids` have been merged! | ||
| eventstream.backend.end_merge(eventstream_state) | ||
|
|
||
| return True | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.