Commit 8b9f9dbb authored by Nick Thomas's avatar Nick Thomas

Make the mergeability check worker idempotent

parent 5c3ddecc
......@@ -1143,7 +1143,7 @@
:urgency: :low
:resource_boundary: :unknown
:weight: 1
:idempotent:
:idempotent: true
- :name: migrate_external_diffs
:feature_category: :source_code_management
:has_external_dependencies:
......
# frozen_string_literal: true
class MergeRequestMergeabilityCheckWorker # rubocop:disable Scalability/IdempotentWorker
class MergeRequestMergeabilityCheckWorker
include ApplicationWorker
feature_category :source_code_management
idempotent!
def perform(merge_request_id)
merge_request = MergeRequest.find_by_id(merge_request_id)
......
......@@ -25,5 +25,16 @@ describe MergeRequestMergeabilityCheckWorker do
subject.perform(merge_request.id)
end
end
it_behaves_like 'an idempotent worker' do
let(:merge_request) { create(:merge_request) }
let(:job_args) { [merge_request.id] }
it 'is mergeable' do
subject
expect(merge_request).to be_mergeable
end
end
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