Commit 46395b78 authored by Kamil Trzciński's avatar Kamil Trzciński Committed by Simon Knox

Merge branch...

Merge branch 'fix/sm/37559-pipeline-triggered-through-api-not-showing-trigger-variables' into 'master'

Fix `ci_builds` to have an associated `trigger_request_id`

See merge request !14244
parent 4c123ee7
...@@ -14,7 +14,7 @@ module Ci ...@@ -14,7 +14,7 @@ module Ci
pipeline = Ci::CreatePipelineService.new(project, trigger.owner, ref: params[:ref]) pipeline = Ci::CreatePipelineService.new(project, trigger.owner, ref: params[:ref])
.execute(:trigger, ignore_skip_ci: true) do |pipeline| .execute(:trigger, ignore_skip_ci: true) do |pipeline|
trigger.trigger_requests.create!(pipeline: pipeline) pipeline.trigger_requests.create!(trigger: trigger)
create_pipeline_variables!(pipeline) create_pipeline_variables!(pipeline)
end end
......
---
title: Fix Pipeline Triggers to show triggered label and predefined variables (e.g.
CI_PIPELINE_TRIGGERED)
merge_request: 14244
author:
type: fixed
...@@ -34,6 +34,8 @@ describe Ci::PipelineTriggerService do ...@@ -34,6 +34,8 @@ describe Ci::PipelineTriggerService do
expect(result[:pipeline].ref).to eq('master') expect(result[:pipeline].ref).to eq('master')
expect(result[:pipeline].project).to eq(project) expect(result[:pipeline].project).to eq(project)
expect(result[:pipeline].user).to eq(trigger.owner) expect(result[:pipeline].user).to eq(trigger.owner)
expect(result[:pipeline].trigger_requests.to_a)
.to eq(result[:pipeline].builds.map(&:trigger_request).uniq)
expect(result[:status]).to eq(:success) expect(result[:status]).to eq(:success)
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment