Skip to content

feat(issues): Record escalate/unresolve transitions in the action log#117852

Open
yuvmen wants to merge 2 commits into
masterfrom
yuvmen/manage-issue-states-action-log
Open

feat(issues): Record escalate/unresolve transitions in the action log#117852
yuvmen wants to merge 2 commits into
masterfrom
yuvmen/manage-issue-states-action-log

Conversation

@yuvmen

@yuvmen yuvmen commented Jun 16, 2026

Copy link
Copy Markdown
Member

Summary

Several automated/system paths transition group status via direct Group.objects...update(status=...) (bypassing update_group_status), so the transitions were never recorded in the action log. This publishes a system-sourced action at each site, mirroring 1:1 the Activity it already writes:

  • manage_issue_states ESCALATING (SET_ESCALATING) → EscalatingAction
  • manage_issue_states ONGOING (SET_UNRESOLVED) → UnresolveAction
  • post_process detect_new_escalation (SET_ESCALATING) → EscalatingAction

Adds GroupActionType.ESCALATING + EscalatingAction. It's named for the state the system observed (the group is escalating), not an actor "escalate" action — nobody performs it; it's a recorded fact mirroring Activity's SET_ESCALATING. (ONGOING/UNIGNORED both collapse to SET_UNRESOLVED in Activity, so both map to UnresolveAction; the dead UNIGNORED branch is left alone.)

All callers are system/automated, so source=SYSTEM. Uses publish_action directly (no action_context_scope) since the values are known and no deep context-reading primitive is in the path.

Regression transitions (SET_REGRESSION, in event_manager + status_change_consumer) are a separate, larger piece — tracked under its own ticket.

Test

TestManageIssueStatesActionLog (escalating/unresolve) + DetectNewEscalationTestMixin.test_has_escalated (post_process escalation), asserting the matching action attributed to system.

Part of ID-1631

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Jun 16, 2026
manage_issue_states transitions group status via direct .update (bypassing
update_group_status), so the escalating and ongoing transitions were never
recorded in the action log. Publish a system-sourced action mirroring the
Activity each branch already writes: EscalatingAction for SET_ESCALATING,
UnresolveAction for SET_UNRESOLVED.

Adds GroupActionType.ESCALATING + EscalatingAction. Named for the state the
system observed (the group is escalating), not an actor "escalate" action —
nobody performs it; it's a recorded fact mirroring Activity's SET_ESCALATING.

Part of ID-1631
@yuvmen yuvmen force-pushed the yuvmen/manage-issue-states-action-log branch from f533823 to 3f04f74 Compare June 16, 2026 21:15
@linear-code

linear-code Bot commented Jun 16, 2026

Copy link
Copy Markdown

ID-1631

@yuvmen yuvmen marked this pull request as ready for review June 16, 2026 21:27
@yuvmen yuvmen requested review from a team as code owners June 16, 2026 21:27
detect_new_escalation escalates groups from any status via a direct
group.update bypassing update_group_status, with its own SET_ESCALATING
Activity. Publish the matching EscalatingAction (source=system), same as the
manage_issue_states ESCALATING branch.

Part of ID-1631
Activity.objects.create_group_activity(
group=group, type=ActivityType.SET_ESCALATING, data=data
)
publish_action(

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.

We expect these to be unnecessary and potentially duplicative when Charles's stuff is ready, right? Should we wait?

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.

yea they are for sure, though I am not sure where it stands and I thought in the mean time I can mark the points of integration where we should take notice for him. But yes we should coordinate you are right.
These are just gaps I am finding that I want to make sure we correclty add source/actor to

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.

2 participants