Skip to content

Introduce BatchMerger service to merge MR in batches

Mayra Cabrera requested to merge merge-security-mrs-in-batches into master

What does this MR do?

Introduces ReleaseTools::Security::MergeRequestsBatchMerger to merge MRs in batches. This class does the following:

  1. Fetches security implementation issues from the latest security release tracking issue.
  2. 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
  3. If all the merge requests were merged, it cherry-picks the one targeting master in the current auto-deploy branch.
  4. Notifies the result to Slack (with IssueResult)

This class is executed from MergeRequestsMerger if merge_in_batches feature is enabled.

To do (backend)

  • 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

Merge request reports