BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
e8ecae7e
Commit
e8ecae7e
authored
Jun 02, 2018
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reveert build_relations and simply add a line for creating iid
parent
b02b2602
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
16 deletions
+10
-16
populate.rb
lib/gitlab/ci/pipeline/chain/populate.rb
+7
-13
populate_spec.rb
spec/lib/gitlab/ci/pipeline/chain/populate_spec.rb
+3
-3
No files found.
lib/gitlab/ci/pipeline/chain/populate.rb
View file @
e8ecae7e
...
@@ -8,7 +8,13 @@ module Gitlab
...
@@ -8,7 +8,13 @@ module Gitlab
PopulateError
=
Class
.
new
(
StandardError
)
PopulateError
=
Class
.
new
(
StandardError
)
def
perform!
def
perform!
build_relations
# Allocate next IID. This operation must be outside of transactions of pipeline creations.
pipeline
.
ensure_project_iid!
##
# Populate pipeline with block argument of CreatePipelineService#execute.
#
@command
.
seeds_block
&
.
call
(
pipeline
)
##
##
# Populate pipeline with all stages, and stages with builds.
# Populate pipeline with all stages, and stages with builds.
...
@@ -31,18 +37,6 @@ module Gitlab
...
@@ -31,18 +37,6 @@ module Gitlab
def
break?
def
break?
pipeline
.
errors
.
any?
pipeline
.
errors
.
any?
end
end
private
def
build_relations
##
# Populate pipeline with block argument of CreatePipelineService#execute.
#
@command
.
seeds_block
&
.
call
(
pipeline
)
# Allocate next IID. This operation must be outside of transactions of pipeline creations.
pipeline
.
ensure_project_iid!
end
end
end
end
end
end
end
...
...
spec/lib/gitlab/ci/pipeline/chain/populate_spec.rb
View file @
e8ecae7e
...
@@ -140,10 +140,10 @@ describe Gitlab::Ci::Pipeline::Chain::Populate do
...
@@ -140,10 +140,10 @@ describe Gitlab::Ci::Pipeline::Chain::Populate do
expect
{
step
.
perform!
}.
to
raise_error
(
ActiveRecord
::
RecordNotSaved
)
expect
{
step
.
perform!
}.
to
raise_error
(
ActiveRecord
::
RecordNotSaved
)
end
end
it
'
does not waste
pipeline iid'
do
it
'
wastes
pipeline iid'
do
step
.
perform
rescue
nil
expect
{
step
.
perform!
}.
to
raise_error
expect
(
InternalId
.
ci_pipelines
.
where
(
project_id:
project
.
id
).
exists?
).
to
be_
fals
y
expect
(
InternalId
.
ci_pipelines
.
where
(
project_id:
project
.
id
).
exists?
).
to
be_
truth
y
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