Sync workflow label when a work item is closed

What does this MR do and why?

StatusLabelSyncProcessor keeps work item status and workflow:: labels in sync. It reacted only to open and update events, so the close path (auto-close by a merged MR, and the /close quick action) did not apply workflowcomplete, even though the status transitions to Complete on close.

This MR makes the processor also react to issue.close and work_item.close. The existing sync logic then applies the matching workflow label on close. Issue-type work items emit issue.close and other work item types emit work_item.close, which matches the existing open and update pairing.

This is the triage-ops half of the fix for gitlab-org/gitlab#604636 (closed). The monolith half, now merged, is gitlab-org/gitlab!259542 (merged), which adds the status change to the close webhook changes payload. Reopen is handled in a separate follow-up (gitlab-org/gitlab#632254 (closed)).

Expected impact & dry-runs

This is a reactive processor change, not a scheduled policy, so the scheduled dry-run flow does not apply. A rack-console replay is possible per REACTIVE.md with a close payload that includes changes.status.

Impact: closing a work item that has a status record in a GitLab group syncs its workflow label (for example status Complete applies workflowcomplete). Work items without a status record are unaffected, since the close webhook omits the status change for them.

Tests: the registers listeners expectation now includes the close events, and a close-scenario spec was added. Full spec suite for the processor passes.

Action items

Edited by Agnes Slota

Merge request reports

Loading
Loading