Introduce BatchMerger service to merge MR in batches
What does this MR do?
Introduces ReleaseTools::Security::MergeRequestsBatchMerger
to merge MRs in batches. This class does the following:
- Fetches security implementation issues from the latest security release tracking issue.
- For every security implementation issue
Security::ImplementationIssue
:- Verifies if their merge requests are ready to be processed. If they're not, it skips to the next one.
- Validates their merge requests
- If all of their merge requests are valid, proceed to merge them.
- If any of them is invalid, it assigns them back to the author and creates a discussion on the merge request targeting
master
- If all the merge requests were merged, it cherry-picks the one targeting
master
in the current auto-deploy branch. - Notifies the result to Slack (with
IssueResult
)
This class is executed from MergeRequestsMerger
if merge_in_batches
feature is enabled.
backend)
To do (-
Find security issues and merge requests through ReleaseTools::Security::IssueCrawler
-
Log how many security issues were found -
Validate merge requests per issue -
If all merge requests are valid, merge them. -
Send the result to Slack -
Pick the merge request targeting master
to the auto-deploy branch. -
Add specs
Related to https://gitlab.com/gitlab-org/release-tools/-/issues/369
Edited by Mayra Cabrera