Commit 933f2cb3 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Resolve CE/EE conflicts related to pipeline seeds

parent b0191139
......@@ -7,11 +7,8 @@ module Ci
include Presentable
include Gitlab::OptimisticLocking
include Gitlab::Utils::StrongMemoize
<<<<<<< HEAD
prepend ::EE::Ci::Pipeline
=======
>>>>>>> upstream/master
belongs_to :project, inverse_of: :pipelines
belongs_to :user
......
......@@ -8,15 +8,10 @@ module Ci
Gitlab::Ci::Pipeline::Chain::Validate::Repository,
Gitlab::Ci::Pipeline::Chain::Validate::Config,
Gitlab::Ci::Pipeline::Chain::Skip,
<<<<<<< HEAD
EE::Gitlab::Ci::Pipeline::Chain::Limit::Size,
Gitlab::Ci::Pipeline::Chain::Populate,
Gitlab::Ci::Pipeline::Chain::Create,
EE::Gitlab::Ci::Pipeline::Chain::Limit::Activity].freeze
=======
Gitlab::Ci::Pipeline::Chain::Populate,
Gitlab::Ci::Pipeline::Chain::Create].freeze
>>>>>>> upstream/master
def execute(source, ignore_skip_ci: false, save_on_errors: true, trigger_request: nil, schedule: nil, mirror_update: false, &block)
@pipeline = Ci::Pipeline.new
......
......@@ -20,7 +20,6 @@ module Ci
.execute(:trigger, ignore_skip_ci: true) do |pipeline|
pipeline.trigger_requests.build(trigger: trigger)
pipeline.variables.build(variables)
<<<<<<< HEAD
end
if pipeline.persisted?
......@@ -46,8 +45,6 @@ module Ci
pipeline.source_pipeline = source
pipeline.variables.build(variables)
=======
>>>>>>> upstream/master
end
if pipeline.persisted?
......@@ -63,15 +60,12 @@ module Ci
end
end
<<<<<<< HEAD
def job_from_token
strong_memoize(:job) do
Ci::Build.find_by_token(params[:token].to_s)
end
end
=======
>>>>>>> upstream/master
def variables
params[:variables].to_h.map do |key, value|
{ key: key, value: value }
......
require 'spec_helper'
describe Gitlab::Ci::Pipeline::Chain::Populate do
<<<<<<< HEAD
set(:project) { create(:project, :repository) }
=======
set(:project) { create(:project) }
>>>>>>> upstream/master
set(:user) { create(:user) }
let(:pipeline) do
......@@ -143,11 +139,7 @@ describe Gitlab::Ci::Pipeline::Chain::Populate do
end
let(:pipeline) do
<<<<<<< HEAD
build(:ci_pipeline, ref: 'master', project: project, config: config)
=======
build(:ci_pipeline, ref: 'master', config: config)
>>>>>>> upstream/master
end
it 'populates pipeline according to used policies' do
......
......@@ -238,12 +238,8 @@ describe Ci::Pipeline, :mailer do
describe 'pipeline stages' do
describe '#stage_seeds' do
<<<<<<< HEAD
let(:project) { create(:project, :repository) }
let(:pipeline) { build(:ci_pipeline, project: project, config: config) }
=======
let(:pipeline) { build(:ci_pipeline, config: config) }
>>>>>>> upstream/master
let(:config) { { rspec: { script: 'rake' } } }
it 'returns preseeded stage seeds object' do
......@@ -258,17 +254,10 @@ describe Ci::Pipeline, :mailer do
rspec: { stage: 'test', script: 'rspec' },
spinach: { stage: 'test', script: 'spinach' } }
end
<<<<<<< HEAD
it 'correctly fabricates a stage seeds object' do
seeds = pipeline.stage_seeds
=======
it 'correctly fabricates a stage seeds object' do
seeds = pipeline.stage_seeds
>>>>>>> upstream/master
expect(seeds.size).to eq 2
expect(seeds.first.attributes[:name]).to eq 'test'
expect(seeds.second.attributes[:name]).to eq 'deploy'
......@@ -280,11 +269,7 @@ describe Ci::Pipeline, :mailer do
context 'when refs policy is specified' do
let(:pipeline) do
<<<<<<< HEAD
build(:ci_pipeline, ref: 'feature', tag: true, project: project, config: config)
=======
build(:ci_pipeline, ref: 'feature', tag: true, config: config)
>>>>>>> upstream/master
end
let(:config) do
......@@ -302,17 +287,10 @@ describe Ci::Pipeline, :mailer do
end
context 'when source policy is specified' do
<<<<<<< HEAD
let(:pipeline) do
build(:ci_pipeline, source: :schedule, project: project, config: config)
end
let(:config) do
{ production: { stage: 'deploy', script: 'cap prod', only: ['triggers'] },
spinach: { stage: 'test', script: 'spinach', only: ['schedules'] } }
=======
let(:pipeline) { build(:ci_pipeline, source: :schedule, config: config) }
let(:config) do
{ production: { stage: 'deploy', script: 'cap prod', only: ['triggers'] },
spinach: { stage: 'test', script: 'spinach', only: ['schedules'] } }
......@@ -324,22 +302,9 @@ describe Ci::Pipeline, :mailer do
expect(seeds.size).to eq 1
expect(seeds.first.attributes[:name]).to eq 'test'
expect(seeds.dig(0, 0, :name)).to eq 'spinach'
>>>>>>> upstream/master
end
end
<<<<<<< HEAD
it 'returns stage seeds only assigned to schedules' do
seeds = pipeline.stage_seeds
expect(seeds.size).to eq 1
expect(seeds.first.attributes[:name]).to eq 'test'
expect(seeds.dig(0, 0, :name)).to eq 'spinach'
end
end
=======
>>>>>>> upstream/master
context 'when kubernetes policy is specified' do
let(:config) do
{
......@@ -351,21 +316,12 @@ describe Ci::Pipeline, :mailer do
}
}
end
<<<<<<< HEAD
context 'when kubernetes is active' do
shared_examples 'same behavior between KubernetesService and Platform::Kubernetes' do
it 'returns seeds for kubernetes dependent job' do
seeds = pipeline.stage_seeds
=======
context 'when kubernetes is active' do
shared_examples 'same behavior between KubernetesService and Platform::Kubernetes' do
it 'returns seeds for kubernetes dependent job' do
seeds = pipeline.stage_seeds
>>>>>>> upstream/master
expect(seeds.size).to eq 2
expect(seeds.dig(0, 0, :name)).to eq 'spinach'
expect(seeds.dig(1, 0, :name)).to eq 'production'
......@@ -373,11 +329,7 @@ describe Ci::Pipeline, :mailer do
end
context 'when user configured kubernetes from Integration > Kubernetes' do
<<<<<<< HEAD
let(:project) { create(:kubernetes_project, :repository) }
=======
let(:project) { create(:kubernetes_project) }
>>>>>>> upstream/master
let(:pipeline) { build(:ci_pipeline, project: project, config: config) }
it_behaves_like 'same behavior between KubernetesService and Platform::Kubernetes'
......@@ -405,28 +357,17 @@ describe Ci::Pipeline, :mailer do
describe '#seeds_size' do
context 'when refs policy is specified' do
<<<<<<< HEAD
let(:project) { create(:project, :repository) }
=======
>>>>>>> upstream/master
let(:config) do
{ production: { stage: 'deploy', script: 'cap prod', only: ['master'] },
spinach: { stage: 'test', script: 'spinach', only: ['tags'] } }
end
<<<<<<< HEAD
let(:pipeline) do
build(:ci_pipeline, ref: 'feature', tag: true, project: project, config: config)
end
=======
let(:pipeline) do
build(:ci_pipeline, ref: 'feature', tag: true, config: config)
end
>>>>>>> upstream/master
it 'returns real seeds size' do
expect(pipeline.seeds_size).to eq 1
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