Commit 33780dd6 authored by Robert Speicher's avatar Robert Speicher

Merge branch '198042-argumenterror-wrong-number-of-arguments-given-1-expected-2' into 'master'

AutoMergeProcessWorker: Resolve "ArgumentError: wrong number of arguments (given 1, expected 2)"

Closes #198042

See merge request gitlab-org/gitlab!23407
parents 7aa2ccc5 fd81dab1
---
title: Fixes AutoMergeProcessWorker failing when merge train service is not available
for a merge request
merge_request: 23407
author:
type: fixed
...@@ -13,7 +13,7 @@ module AutoMerge ...@@ -13,7 +13,7 @@ module AutoMerge
merge_train_service = AutoMerge::MergeTrainService.new(project, merge_request.merge_user) merge_train_service = AutoMerge::MergeTrainService.new(project, merge_request.merge_user)
return abort(merge_request) unless merge_train_service.available_for?(merge_request) return abort(merge_request, 'This merge request cannot be added to the merge train') unless merge_train_service.available_for?(merge_request)
merge_train_service.execute(merge_request) merge_train_service.execute(merge_request)
end end
......
...@@ -61,7 +61,11 @@ describe AutoMerge::AddToMergeTrainWhenPipelineSucceedsService do ...@@ -61,7 +61,11 @@ describe AutoMerge::AddToMergeTrainWhenPipelineSucceedsService do
end end
it 'aborts auto merge' do it 'aborts auto merge' do
expect(service).to receive(:abort).once expect(service).to receive(:abort).once.and_call_original
expect(SystemNoteService)
.to receive(:abort_add_to_merge_train_when_pipeline_succeeds).once
.with(merge_request, project, user, 'This merge request cannot be added to the merge train')
subject subject
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment