Commit 197f6acc authored by Bob Van Landuyt's avatar Bob Van Landuyt

Merge branch '216940-make-mergeability-check-worker-idempotent' into 'master'

Make the mergeability check worker idempotent

Closes #216940

See merge request gitlab-org/gitlab!31411
parents e779ebbc 8b9f9dbb
......@@ -1150,7 +1150,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