summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2017-08-04 21:26:24 +0000
committerSean McGivern <sean@mcgivern.me.uk>2017-08-04 21:26:24 +0000
commitedc81ea6c89d92a3ed7fb54da433e1c4f9b95576 (patch)
treef63e15e79bdddb0d478b313b9d5b6093a405bef6 /app
parent848097b57bcde309b2e40fbae74d642d87af9718 (diff)
parent1614eb8b0a9fb2d719e6af7fec13d76db7d99892 (diff)
downloadgitlab-ce-edc81ea6c89d92a3ed7fb54da433e1c4f9b95576.tar.gz
Merge branch 'fix/sm/34547-cannot-connect-to-ci-server-error-messages' into 'master'
Fix "Cannot connect to CI server error messages" Closes #34547 See merge request !13252
Diffstat (limited to 'app')
-rw-r--r--app/services/merge_requests/create_service.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/services/merge_requests/create_service.rb b/app/services/merge_requests/create_service.rb
index 19189e64acf..5414fa79def 100644
--- a/app/services/merge_requests/create_service.rb
+++ b/app/services/merge_requests/create_service.rb
@@ -12,7 +12,6 @@ module MergeRequests
merge_request.source_project = source_project
merge_request.source_branch = params[:source_branch]
merge_request.merge_params['force_remove_source_branch'] = params.delete(:force_remove_source_branch)
- merge_request.head_pipeline = head_pipeline_for(merge_request)
create(merge_request)
end
@@ -22,10 +21,16 @@ module MergeRequests
notification_service.new_merge_request(issuable, current_user)
todo_service.new_merge_request(issuable, current_user)
issuable.cache_merge_request_closes_issues!(current_user)
+ update_merge_requests_head_pipeline(issuable)
end
private
+ def update_merge_requests_head_pipeline(merge_request)
+ pipeline = head_pipeline_for(merge_request)
+ merge_request.update(head_pipeline_id: pipeline.id) if pipeline
+ end
+
def head_pipeline_for(merge_request)
return unless merge_request.source_project