Add group worker for at_least_two_approvals service
What does this MR do and why?
- Add the ability to run
at_least_two_approvals
adherence check for all the projects within a group. - 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.
- 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!
- Trigger the group worker by running the following (update the
group_id
anduser_id
accordingly)
::ComplianceManagement::Standards::Gitlab::AtLeastTwoApprovalsGroupWorker.perform_async({ 'group_id' => 33, 'user_id' => 1 })
- Verify that the status of the check is updated correctly again.
Related to #434199 (closed)
Edited by Huzaifa Iftikhar