Commit 77af103c authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch 'pass_update_sequence_id_to_jira_connect_workers' into 'master'

Pass update_sequence_id to JiraConnect workers

See merge request gitlab-org/gitlab!48234
parents c71eaa56 b61f203c
......@@ -118,7 +118,7 @@ module Git
commits_to_sync = limited_commits.select { |commit| Atlassian::JiraIssueKeyExtractor.has_keys?(commit.safe_message) }.map(&:sha)
if branch_to_sync || commits_to_sync.any?
JiraConnect::SyncBranchWorker.perform_async(project.id, branch_to_sync, commits_to_sync)
JiraConnect::SyncBranchWorker.perform_async(project.id, branch_to_sync, commits_to_sync, Atlassian::JiraConnect::Client.generate_update_sequence_id)
end
end
......
......@@ -58,7 +58,7 @@ module MergeRequests
return unless project.jira_subscription_exists?
if Atlassian::JiraIssueKeyExtractor.has_keys?(merge_request.title, merge_request.description)
JiraConnect::SyncMergeRequestWorker.perform_async(merge_request.id)
JiraConnect::SyncMergeRequestWorker.perform_async(merge_request.id, Atlassian::JiraConnect::Client.generate_update_sequence_id)
end
end
......
......@@ -718,10 +718,10 @@ RSpec.describe Git::BranchPushService, services: true do
end
shared_examples 'enqueues Jira sync worker' do
specify do
specify :aggregate_failures do
Sidekiq::Testing.fake! do
expect(JiraConnect::SyncBranchWorker).to receive(:perform_async)
.with(project.id, branch_to_sync, commits_to_sync)
.with(project.id, branch_to_sync, commits_to_sync, kind_of(Numeric))
.and_call_original
expect { subject.execute }.to change(JiraConnect::SyncBranchWorker.jobs, :size).by(1)
......
......@@ -20,7 +20,8 @@ RSpec.describe MergeRequests::BaseService do
describe '#execute_hooks' do
shared_examples 'enqueues Jira sync worker' do
it do
specify :aggregate_failures do
expect(JiraConnect::SyncMergeRequestWorker).to receive(:perform_async).with(kind_of(Numeric), kind_of(Numeric)).and_call_original
Sidekiq::Testing.fake! do
expect { subject.execute }.to change(JiraConnect::SyncMergeRequestWorker.jobs, :size).by(1)
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