diff options
author | Shinya Maeda <shinya@gitlab.com> | 2017-09-01 00:17:56 +0900 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2017-09-04 21:55:26 +0900 |
commit | d614c431055286eaab3b82e810186ac19a2c4fd7 (patch) | |
tree | 1cd600d5212471e79f295c310e736b2545fc6add /lib | |
parent | cff104ec4b0dd2c53ed907ab7ca423b7c587dee8 (diff) | |
download | gitlab-ce-d614c431055286eaab3b82e810186ac19a2c4fd7.tar.gz |
Fix trigger_request.variables
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/v3/triggers.rb | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/api/v3/triggers.rb b/lib/api/v3/triggers.rb index 497ccbe20c6..13cfb9fe38b 100644 --- a/lib/api/v3/triggers.rb +++ b/lib/api/v3/triggers.rb @@ -32,15 +32,13 @@ module API render_api_error!(result[:message], result[:http_status]) else pipeline = result[:pipeline] - trigger_request = pipeline.trigger_request + trigger_request = Ci::TriggerRequest.find_by(commit_id: pipeline.id) # We switched to Ci::PipelineVariable from Ci::TriggerRequest.variables. # Ci::TriggerRequest doesn't save variables anymore. # Here is copying Ci::PipelineVariable to Ci::TriggerRequest.variables for presenting the variables. # The same endpoint in v4 API pressents Pipeline instead of TriggerRequest, so it doesn't need such a process. - pipeline.variables.each do |variable| - trigger_request.variables << { key: variable.key, value: variable.value } - end + trigger_request.variables = params[:variables] present trigger_request, with: ::API::V3::Entities::TriggerRequest end |