Skip to content

Split out approval work service from refresh worker

What does this MR do and why?

Split out approval work service from refresh worker

This MR extracts approval-related logic from the main refresh worker into a dedicated service and worker to improve code organization and maintainability. The changes include:

  • New ApprovalService: Extracted approval logic into EE::MergeRequests::Refresh::ApprovalService
  • New ApprovalWorker: Created EE::MergeRequests::Refresh::ApprovalWorker to handle approval updates asynchronously
  • Feature Flag: Added split_refresh_approval_worker feature flag to control the rollout
  • Comprehensive Tests: Added full test coverage for both the service and worker

The approval service handles:

  • Updating approvers for source and target branch merge requests
  • Resetting approvals when needed
  • Syncing various approval rule types (code owners, scan results, etc.)
  • Managing approval states and notifications

This separation allows for better testing, debugging, and future enhancements to the approval workflow.

References

Edited by Marc Shaw

Merge request reports

Loading