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
Jérome Perrin
gitlab-ce
Commits
ed986806
Commit
ed986806
authored
Feb 23, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Process skipped jobs in the pipeline when retrying it
parent
1965482f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
11 deletions
+12
-11
app/services/ci/retry_pipeline_service.rb
app/services/ci/retry_pipeline_service.rb
+9
-10
lib/gitlab/optimistic_locking.rb
lib/gitlab/optimistic_locking.rb
+3
-1
No files found.
app/services/ci/retry_pipeline_service.rb
View file @
ed986806
module
Ci
class
RetryPipelineService
<
::
BaseService
include
Gitlab
::
OptimisticLocking
def
execute
(
pipeline
)
unless
can?
(
current_user
,
:update_pipeline
,
pipeline
)
raise
Gitlab
::
Access
::
AccessDeniedError
end
pipeline
.
builds
.
failed_or_canceled
.
tap
do
|
builds
|
stage_idx
=
builds
.
order
(
'stage_idx ASC'
)
.
pluck
(
'DISTINCT stage_idx'
).
first
pipeline
.
mark_as_processable_after_stage
(
stage_idx
)
builds
.
find_each
do
|
build
|
pipeline
.
builds
.
failed_or_canceled
.
find_each
do
|
build
|
next
unless
build
.
retryable?
Ci
::
RetryBuildService
.
new
(
project
,
current_user
)
.
reprocess
(
build
)
end
pipeline
.
builds
.
skipped
.
find_each
do
|
skipped
|
retry_optimistic_lock
(
skipped
)
{
|
build
|
build
.
process
}
end
MergeRequests
::
AddTodoWhenBuildFailsService
...
...
lib/gitlab/optimistic_locking.rb
View file @
ed986806
module
Gitlab
module
OptimisticLocking
extend
self
module_function
def
retry_lock
(
subject
,
retries
=
100
,
&
block
)
loop
do
...
...
@@ -15,5 +15,7 @@ module Gitlab
end
end
end
alias
:retry_optimistic_lock
:retry_lock
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