diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2017-08-05 00:26:24 +0300 |
---|---|---|
committer | James Edwards-Jones <jedwardsjones@gitlab.com> | 2017-08-11 23:02:33 +0300 |
commit | 14936d0c34b50acb49dedc51fb8c8fe23a2dac1a (patch) | |
tree | fb4d80ea4cf53359eb22e3e15ff549cab9f0f354 /app | |
parent | 97bd335109bb7121842fb8c269dbae8cbe7c8bf7 (diff) |
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.rb | 7 |
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 |