Skip to content

Add group worker for at_least_two_approvals service

What does this MR do and why?

  1. Add the ability to run at_least_two_approvals adherence check for all the projects within a group.
  2. This group worker would be used in the feature where we wish to run adherence checks for all the projects within a group.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Manually change the status of at least two approvals check for one of the projects. You can do that by running the following command in rails console
adherence_check = Projects::ComplianceStandards::Adherence.where(check_name: 2).last
adherence_check.status = "fail" # set either fail or success depending on the current value
adherence_check.save!
  1. Trigger the group worker by running the following (update the group_id and user_id accordingly)
::ComplianceManagement::Standards::Gitlab::AtLeastTwoApprovalsGroupWorker.perform_async({ 'group_id' => 33, 'user_id' => 1 })
  1. Verify that the status of the check is updated correctly again.

Related to #434199 (closed)

Edited by Huzaifa Iftikhar

Merge request reports