Skip to content

experiment(derived data): Add decorator for merged groups#118533

Draft
ceorourke wants to merge 2 commits into
masterfrom
ceorourke/experiment-derived-data-pt2
Draft

experiment(derived data): Add decorator for merged groups#118533
ceorourke wants to merge 2 commits into
masterfrom
ceorourke/experiment-derived-data-pt2

Conversation

@ceorourke

Copy link
Copy Markdown
Member

Add a decorator to indicate that we want to have different behavior for merged groups - in some cases we want the default behavior (use whatever is most recent) and in some cases we may want to prioritize the non-merged group's log over the merged in ones. This tries out a way of accomplishing that for the case where each group is assigned to a different user/team and the case where each group has set a different priority.

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Jun 25, 2026
def _track_progress_merged(state: StateView, entry: GroupActionLogEntry) -> AggregatorResult:
# ASSIGN advances progress the same way regardless of which group it came
# from, so merged-in assignments fall through to the default behavior.
if entry.type == GroupActionType.ASSIGN:

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.

add to this for whichever other ones will share this behavior

@github-actions

Copy link
Copy Markdown
Contributor

Backend Test Failures

Failures on 4dc8639 in this run:

tests/sentry/issues/derived/test_aggregators.py::test_merged_assign_advances_progresslog
[gw0] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/issues/derived/test_aggregators.py:574: in test_merged_assign_advances_progress
    _run_for_feature(
tests/sentry/issues/derived/test_aggregators.py:50: in _run_for_feature
    return p.run(entries)[feature]
           ^^^^^^^^^^^^^^
src/sentry/issues/derived/framework.py:309: in run
    state = self.step(state, entry)
            ^^^^^^^^^^^^^^^^^^^^^^^
src/sentry/issues/derived/framework.py:288: in step
    result = agg.fn(subset, entry)
             ^^^^^^^^^^^^^^^^^^^^^
src/sentry/issues/derived/merge.py:54: in wrapper
    return merged_fn(state, entry)
           ^^^^^^^^^^^^^^^^^^^^^^^
src/sentry/issues/derived/aggregators.py:140: in _track_progress_merged
    if entry.type in (GroupActionType.ASSIGN):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E   TypeError: argument of type 'GroupActionType' is not iterable
tests/sentry/issues/derived/test_aggregators.py::test_merged_set_priority_does_not_advance_progresslog
[gw0] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/issues/derived/test_aggregators.py:590: in test_merged_set_priority_does_not_advance_progress
    _run_for_feature(
tests/sentry/issues/derived/test_aggregators.py:50: in _run_for_feature
    return p.run(entries)[feature]
           ^^^^^^^^^^^^^^
src/sentry/issues/derived/framework.py:309: in run
    state = self.step(state, entry)
            ^^^^^^^^^^^^^^^^^^^^^^^
src/sentry/issues/derived/framework.py:288: in step
    result = agg.fn(subset, entry)
             ^^^^^^^^^^^^^^^^^^^^^
src/sentry/issues/derived/merge.py:54: in wrapper
    return merged_fn(state, entry)
           ^^^^^^^^^^^^^^^^^^^^^^^
src/sentry/issues/derived/aggregators.py:140: in _track_progress_merged
    if entry.type in (GroupActionType.ASSIGN):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E   TypeError: argument of type 'GroupActionType' is not iterable
tests/sentry/issues/derived/test_aggregators.py::test_merged_set_priority_does_not_override_nativelog
[gw0] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/issues/derived/test_aggregators.py:606: in test_merged_set_priority_does_not_override_native
    _run_for_feature(
tests/sentry/issues/derived/test_aggregators.py:50: in _run_for_feature
    return p.run(entries)[feature]
           ^^^^^^^^^^^^^^
src/sentry/issues/derived/framework.py:309: in run
    state = self.step(state, entry)
            ^^^^^^^^^^^^^^^^^^^^^^^
src/sentry/issues/derived/framework.py:288: in step
    result = agg.fn(subset, entry)
             ^^^^^^^^^^^^^^^^^^^^^
src/sentry/issues/derived/merge.py:54: in wrapper
    return merged_fn(state, entry)
           ^^^^^^^^^^^^^^^^^^^^^^^
src/sentry/issues/derived/aggregators.py:140: in _track_progress_merged
    if entry.type in (GroupActionType.ASSIGN):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E   TypeError: argument of type 'GroupActionType' is not iterable
tests/sentry/issues/derived/test_aggregators.py::test_merged_root_cause_does_not_advance_progresslog
[gw0] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/issues/derived/test_aggregators.py:622: in test_merged_root_cause_does_not_advance_progress
    _run_for_feature(
tests/sentry/issues/derived/test_aggregators.py:50: in _run_for_feature
    return p.run(entries)[feature]
           ^^^^^^^^^^^^^^
src/sentry/issues/derived/framework.py:309: in run
    state = self.step(state, entry)
            ^^^^^^^^^^^^^^^^^^^^^^^
src/sentry/issues/derived/framework.py:288: in step
    result = agg.fn(subset, entry)
             ^^^^^^^^^^^^^^^^^^^^^
src/sentry/issues/derived/merge.py:54: in wrapper
    return merged_fn(state, entry)
           ^^^^^^^^^^^^^^^^^^^^^^^
src/sentry/issues/derived/aggregators.py:140: in _track_progress_merged
    if entry.type in (GroupActionType.ASSIGN):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E   TypeError: argument of type 'GroupActionType' is not iterable

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.

1 participant