diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 11:59:07 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 11:59:07 +0000 |
commit | 8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca (patch) | |
tree | 544930fb309b30317ae9797a9683768705d664c4 /app/services/jira_connect/sync_service.rb | |
parent | 4b1de649d0168371549608993deac953eb692019 (diff) | |
download | gitlab-ce-8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca.tar.gz |
Add latest changes from gitlab-org/gitlab@13-7-stable-eev13.7.0-rc42
Diffstat (limited to 'app/services/jira_connect/sync_service.rb')
-rw-r--r-- | app/services/jira_connect/sync_service.rb | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/app/services/jira_connect/sync_service.rb b/app/services/jira_connect/sync_service.rb index f8855fb6deb..b2af284f1f0 100644 --- a/app/services/jira_connect/sync_service.rb +++ b/app/services/jira_connect/sync_service.rb @@ -6,13 +6,15 @@ module JiraConnect self.project = project end - def execute(commits: nil, branches: nil, merge_requests: nil, update_sequence_id: nil) - JiraConnectInstallation.for_project(project).each do |installation| + # Parameters: see Atlassian::JiraConnect::Client#send_info + # Includes: update_sequence_id, commits, branches, merge_requests, pipelines + def execute(**args) + JiraConnectInstallation.for_project(project).flat_map do |installation| client = Atlassian::JiraConnect::Client.new(installation.base_url, installation.shared_secret) - response = client.store_dev_info(project: project, commits: commits, branches: branches, merge_requests: merge_requests, update_sequence_id: update_sequence_id) + responses = client.send_info(project: project, **args) - log_response(response) + responses.each { |r| log_response(r) } end end @@ -29,7 +31,7 @@ module JiraConnect jira_response: response&.to_json } - if response && response['errorMessages'] + if response && (response['errorMessages'] || response['rejectedBuilds'].present?) logger.error(message) else logger.info(message) |