lib/release_tools/security/merge_requests_batch_merger.rb
# Merges valid security merge requests in batches:
#
# 1. Fetches security implementation issues associated to the last security release.
# 2. Iterates over every security implementation issue and validates their
# associated merge requests
# 3. If one of the merge requests is invalid, it assignes them back to the author,
# creates a discussion on the merge request targeting master and continues to the next
# security implementation issue.
# 4. If all of the merge requests are valid, merges them.
Merges valid security merge requests in batches:
1. Fetches security implementation issues associated to the last security release.
2. Iterates over every security implementation issue and validates their
associated merge requests
3. If one of the merge requests is invalid, it assignes them back to the author,
creates a discussion on the merge request targeting master and continues to the next
security implementation issue.
4. If all of the merge requests are valid, merges them.
Merges valid security merge requests in batches : 1 . Fetches security implementation issues associated to the last security release . 2 . Iterates over every security implementation issue and validates their associated merge requests 3 . If one of the merge requests is invalid it assignes them back to the author creates a discussion on the merge request targeting master and continues to the next security implementation issue . 4 . If all of the merge requests are valid merges them .
def execute
        return if security_issues.empty?
        logger.info("Validating #{security_issues.count} security issues")
        security_issues.each do |security_issue|
          @result.processed << security_issue
          invalid_merge_requests = validated_merge_requests(security_issue.merge_requests).last
          if invalid_merge_requests.any?
            @result.invalid << security_issue
            reassign_merge_requests(security_issue)
          else
            merge_in_batches(security_issue)
          end
        end
        notify_result
      end
def execute return if security_issues . empty? logger . info ( "Validating #{security_issues.count} security issues" ) security_issues . each do | security_issue | @result . processed << security_issue invalid_merge_requests = validated_merge_requests ( security_issue . merge_requests ) . last if invalid_merge_requests . any? @result . invalid << security_issue reassign_merge_requests ( security_issue ) else merge_in_batches ( security_issue ) end end notify_result end
Merges valid security merge requests in batches:
1.
Merges valid security merge requests in batches : 1 .