Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
e4d69844
Commit
e4d69844
authored
Apr 25, 2018
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not save associated records for pipeline builds twice
parent
e6f6f8e7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
12 deletions
+3
-12
lib/gitlab/ci/pipeline/chain/populate.rb
lib/gitlab/ci/pipeline/chain/populate.rb
+1
-5
spec/lib/gitlab/ci/pipeline/chain/populate_spec.rb
spec/lib/gitlab/ci/pipeline/chain/populate_spec.rb
+2
-7
No files found.
lib/gitlab/ci/pipeline/chain/populate.rb
View file @
e4d69844
...
@@ -14,14 +14,10 @@ module Gitlab
...
@@ -14,14 +14,10 @@ module Gitlab
@command
.
seeds_block
&
.
call
(
pipeline
)
@command
.
seeds_block
&
.
call
(
pipeline
)
##
##
# Populate pipeline with all stages
and builds from pipeline see
ds.
# Populate pipeline with all stages
, and stages with buil
ds.
#
#
pipeline
.
stage_seeds
.
each
do
|
stage
|
pipeline
.
stage_seeds
.
each
do
|
stage
|
pipeline
.
stages
<<
stage
.
to_resource
pipeline
.
stages
<<
stage
.
to_resource
stage
.
seeds
.
each
do
|
build
|
pipeline
.
builds
<<
build
.
to_resource
end
end
end
if
pipeline
.
stages
.
none?
if
pipeline
.
stages
.
none?
...
...
spec/lib/gitlab/ci/pipeline/chain/populate_spec.rb
View file @
e4d69844
...
@@ -35,11 +35,6 @@ describe Gitlab::Ci::Pipeline::Chain::Populate do
...
@@ -35,11 +35,6 @@ describe Gitlab::Ci::Pipeline::Chain::Populate do
it
'populates pipeline with stages'
do
it
'populates pipeline with stages'
do
expect
(
pipeline
.
stages
).
to
be_one
expect
(
pipeline
.
stages
).
to
be_one
expect
(
pipeline
.
stages
.
first
).
not_to
be_persisted
expect
(
pipeline
.
stages
.
first
).
not_to
be_persisted
end
it
'populates pipeline with builds'
do
expect
(
pipeline
.
builds
).
to
be_one
expect
(
pipeline
.
builds
.
first
).
not_to
be_persisted
expect
(
pipeline
.
stages
.
first
.
builds
).
to
be_one
expect
(
pipeline
.
stages
.
first
.
builds
).
to
be_one
expect
(
pipeline
.
stages
.
first
.
builds
.
first
).
not_to
be_persisted
expect
(
pipeline
.
stages
.
first
.
builds
.
first
).
not_to
be_persisted
end
end
...
@@ -151,8 +146,8 @@ describe Gitlab::Ci::Pipeline::Chain::Populate do
...
@@ -151,8 +146,8 @@ describe Gitlab::Ci::Pipeline::Chain::Populate do
step
.
perform!
step
.
perform!
expect
(
pipeline
.
stages
.
size
).
to
eq
1
expect
(
pipeline
.
stages
.
size
).
to
eq
1
expect
(
pipeline
.
builds
.
size
).
to
eq
1
expect
(
pipeline
.
stages
.
first
.
builds
.
size
).
to
eq
1
expect
(
pipeline
.
builds
.
first
.
name
).
to
eq
'rspec'
expect
(
pipeline
.
stages
.
first
.
builds
.
first
.
name
).
to
eq
'rspec'
end
end
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment