summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2018-03-22 10:56:12 +0000
committerKamil Trzciński <ayufan@ayufan.eu>2018-03-22 10:56:12 +0000
commitd68ddc8366dec3a9aed357c96446a43d36e5de43 (patch)
treeb59480cf52148f7d2fbeac1a9c4fcfdab48c6082
parent4718f22f5751f8d50bd7897ff4a967ccc5625c80 (diff)
parente3507c9282241047d4a983f6251c5692b0f9edee (diff)
downloadgitlab-ce-d68ddc8366dec3a9aed357c96446a43d36e5de43.tar.gz
Merge branch '37987-speed-up-pipeline-creation' into 'master'
Speed Up Pipeline Creation See merge request gitlab-org/gitlab-ce!17443
-rw-r--r--app/models/ci/pipeline.rb2
-rw-r--r--spec/services/ci/process_pipeline_service_spec.rb2
2 files changed, 3 insertions, 1 deletions
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb
index f2edcdd61fd..44f9bdf111e 100644
--- a/app/models/ci/pipeline.rb
+++ b/app/models/ci/pipeline.rb
@@ -14,7 +14,7 @@ module Ci
has_many :stages
has_many :statuses, class_name: 'CommitStatus', foreign_key: :commit_id, inverse_of: :pipeline
- has_many :builds, foreign_key: :commit_id
+ has_many :builds, foreign_key: :commit_id, inverse_of: :pipeline
has_many :trigger_requests, dependent: :destroy, foreign_key: :commit_id # rubocop:disable Cop/ActiveRecordDependent
has_many :variables, class_name: 'Ci::PipelineVariable'
diff --git a/spec/services/ci/process_pipeline_service_spec.rb b/spec/services/ci/process_pipeline_service_spec.rb
index 0ce41e7c7ee..feb5120bc68 100644
--- a/spec/services/ci/process_pipeline_service_spec.rb
+++ b/spec/services/ci/process_pipeline_service_spec.rb
@@ -9,6 +9,8 @@ describe Ci::ProcessPipelineService, '#execute' do
end
before do
+ stub_ci_pipeline_to_return_yaml_file
+
stub_not_protect_default_branch
project.add_developer(user)