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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
59e1e971
Commit
59e1e971
authored
May 30, 2018
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add build_relations method in Chain::Populate
parent
09122f93
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
7 deletions
+13
-7
lib/gitlab/ci/pipeline/chain/create.rb
lib/gitlab/ci/pipeline/chain/create.rb
+0
-3
lib/gitlab/ci/pipeline/chain/populate.rb
lib/gitlab/ci/pipeline/chain/populate.rb
+13
-4
No files found.
lib/gitlab/ci/pipeline/chain/create.rb
View file @
59e1e971
...
@@ -6,9 +6,6 @@ module Gitlab
...
@@ -6,9 +6,6 @@ module Gitlab
include
Chain
::
Helpers
include
Chain
::
Helpers
def
perform!
def
perform!
# Allocate next IID outside of transaction
pipeline
.
ensure_project_iid!
::
Ci
::
Pipeline
.
transaction
do
::
Ci
::
Pipeline
.
transaction
do
pipeline
.
save!
pipeline
.
save!
...
...
lib/gitlab/ci/pipeline/chain/populate.rb
View file @
59e1e971
...
@@ -8,10 +8,7 @@ module Gitlab
...
@@ -8,10 +8,7 @@ module Gitlab
PopulateError
=
Class
.
new
(
StandardError
)
PopulateError
=
Class
.
new
(
StandardError
)
def
perform!
def
perform!
##
build_relations
# 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.
...
@@ -34,6 +31,18 @@ module Gitlab
...
@@ -34,6 +31,18 @@ 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
...
...
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