Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2019-01-23 13:15:14 +0300
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2019-01-25 12:39:26 +0300
commit3508948dfeda84b9ce84325133c96e8f8aa12b85 (patch)
treeb756987c91f1c615e88910a9cbfe2f86bc8a9c3e
parentcfbcc191f0ea13b4e1676bac029840759b264694 (diff)
Add a new relation between a stage and related bridges
-rw-r--r--app/models/ci/stage.rb1
-rw-r--r--lib/gitlab/ci/pipeline/seed/stage.rb2
-rw-r--r--spec/lib/gitlab/import_export/all_models.yml1
3 files changed, 3 insertions, 1 deletions
diff --git a/app/models/ci/stage.rb b/app/models/ci/stage.rb
index 58f3fe2460a..0389945191e 100644
--- a/app/models/ci/stage.rb
+++ b/app/models/ci/stage.rb
@@ -14,6 +14,7 @@ module Ci
has_many :statuses, class_name: 'CommitStatus', foreign_key: :stage_id
has_many :builds, foreign_key: :stage_id
+ has_many :bridges, foreign_key: :stage_id
with_options unless: :importing? do
validates :project, presence: true
diff --git a/lib/gitlab/ci/pipeline/seed/stage.rb b/lib/gitlab/ci/pipeline/seed/stage.rb
index 015ca61d726..9c15064756a 100644
--- a/lib/gitlab/ci/pipeline/seed/stage.rb
+++ b/lib/gitlab/ci/pipeline/seed/stage.rb
@@ -41,7 +41,7 @@ module Gitlab
::Ci::Stage.new(attributes).tap do |stage|
seeds.each do |seed|
if seed.bridge?
- stage.statuses << seed.to_resource
+ stage.bridges << seed.to_resource
else
stage.builds << seed.to_resource
end
diff --git a/spec/lib/gitlab/import_export/all_models.yml b/spec/lib/gitlab/import_export/all_models.yml
index b641e144731..6897ac8a3a8 100644
--- a/spec/lib/gitlab/import_export/all_models.yml
+++ b/spec/lib/gitlab/import_export/all_models.yml
@@ -138,6 +138,7 @@ stages:
- pipeline
- statuses
- builds
+- bridges
statuses:
- project
- pipeline