Commit c206ad40 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Fix multi-project pipelines after services refactoring

parent 2f054c2d
......@@ -37,14 +37,13 @@ module Ci
pipeline = Ci::CreatePipelineService.new(project, job.user, ref: params[:ref])
.execute(:pipeline, ignore_skip_ci: true) do |pipeline|
# TODO this needs a solution and specs
job.sourced_pipelines.build(
source = job.sourced_pipelines.build(
source_pipeline: job.pipeline,
source_project: job.project,
pipeline: pipeline,
project: project)
pipeline.source_pipeline = source
pipeline.variables.build(variables)
end
......
......@@ -185,6 +185,12 @@ describe API::Triggers do
expect(response).to have_http_status(201)
expect(Ci::Pipeline.last.source).to eq('pipeline')
expect(Ci::Pipeline.last.triggered_by_pipeline).not_to be_nil
expect(Ci::Sources::Pipeline.last).to have_attributes(
pipeline_id: (a_value > 0),
source_pipeline_id: (a_value > 0),
source_job_id: (a_value > 0),
source_project_id: (a_value > 0)
)
end
context 'when build is complete' do
......
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