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
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
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
16 deletions
+10
-16
lib/gitlab/ci/pipeline/chain/populate.rb
lib/gitlab/ci/pipeline/chain/populate.rb
+7
-13
spec/lib/gitlab/ci/pipeline/chain/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
PopulateError
=
Class
.
new
(
StandardError
)
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.
...
...
@@ -31,18 +37,6 @@ module Gitlab
def
break?
pipeline
.
errors
.
any?
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
...
...
spec/lib/gitlab/ci/pipeline/chain/populate_spec.rb
View file @
e8ecae7e
...
...
@@ -140,10 +140,10 @@ describe Gitlab::Ci::Pipeline::Chain::Populate do
expect
{
step
.
perform!
}.
to
raise_error
(
ActiveRecord
::
RecordNotSaved
)
end
it
'
does not waste
pipeline iid'
do
step
.
perform
rescue
nil
it
'
wastes
pipeline iid'
do
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
...
...
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