diff options
author | Tanya Pazitny <tpazitny@gitlab.com> | 2019-04-09 07:27:47 -0700 |
---|---|---|
committer | Tanya Pazitny <tpazitny@gitlab.com> | 2019-04-09 07:27:47 -0700 |
commit | 7964f3d4e4a19c1dbe73f4dbcff9e417f033d390 (patch) | |
tree | 1e3a39f0ca4255b3b9396186e236ee35adb6942c /lib/api/internal.rb | |
parent | 6e1aca2c919ccb9d2a630267a67eec5007379b93 (diff) | |
parent | 4bce8b8eb73c7c8e599feba1c1157ac90ec64bf2 (diff) | |
download | gitlab-ce-tpazitny/gitlab-ce-gitlab-issue-54894.tar.gz |
Merge branch 'master' into tpazitny/gitlab-ce-gitlab-issue-54894tpazitny/gitlab-ce-gitlab-issue-54894
Diffstat (limited to 'lib/api/internal.rb')
-rw-r--r-- | lib/api/internal.rb | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/lib/api/internal.rb b/lib/api/internal.rb index 9c7b9146c8f..00f0bbab231 100644 --- a/lib/api/internal.rb +++ b/lib/api/internal.rb @@ -256,19 +256,27 @@ module API post '/post_receive' do status 200 + output = {} # Messages to gitlab-shell + user = identify(params[:identifier]) + project = Gitlab::GlRepository.parse(params[:gl_repository]).first + push_options = Gitlab::PushOptions.new(params[:push_options]) + PostReceive.perform_async(params[:gl_repository], params[:identifier], - params[:changes], params[:push_options].to_a) + params[:changes], push_options.as_json) + + if Feature.enabled?(:mr_push_options, default_enabled: true) + mr_options = push_options.get(:merge_request) + output.merge!(process_mr_push_options(mr_options, project, user, params[:changes])) if mr_options.present? + end + broadcast_message = BroadcastMessage.current&.last&.message reference_counter_decreased = Gitlab::ReferenceCounter.new(params[:gl_repository]).decrease - output = { - merge_request_urls: merge_request_urls, + output.merge!( broadcast_message: broadcast_message, - reference_counter_decreased: reference_counter_decreased - } - - project = Gitlab::GlRepository.parse(params[:gl_repository]).first - user = identify(params[:identifier]) + reference_counter_decreased: reference_counter_decreased, + merge_request_urls: merge_request_urls + ) # A user is not guaranteed to be returned; an orphaned write deploy # key could be used |