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
71dc1bea
Commit
71dc1bea
authored
May 02, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
1cc1e0f7
86900f00
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
24 additions
and
16 deletions
+24
-16
app/models/ci/build.rb
app/models/ci/build.rb
+1
-1
changelogs/unreleased/53064-bypassing-pipeline-jobs-by-canceling-the-pipeline-and-manually-running-later-jobs.yml
...anceling-the-pipeline-and-manually-running-later-jobs.yml
+5
-0
doc/ci/pipelines.md
doc/ci/pipelines.md
+3
-0
spec/features/projects/jobs_spec.rb
spec/features/projects/jobs_spec.rb
+3
-3
spec/features/projects/pipelines/pipeline_spec.rb
spec/features/projects/pipelines/pipeline_spec.rb
+4
-4
spec/lib/gitlab/ci/status/build/factory_spec.rb
spec/lib/gitlab/ci/status/build/factory_spec.rb
+4
-4
spec/models/ci/build_spec.rb
spec/models/ci/build_spec.rb
+2
-2
spec/requests/api/jobs_spec.rb
spec/requests/api/jobs_spec.rb
+2
-2
No files found.
app/models/ci/build.rb
View file @
71dc1bea
...
@@ -352,7 +352,7 @@ module Ci
...
@@ -352,7 +352,7 @@ module Ci
end
end
def
retryable?
def
retryable?
!
archived?
&&
(
success?
||
failed?
||
canceled?
)
!
archived?
&&
(
success?
||
failed?
)
end
end
def
retries_count
def
retries_count
...
...
changelogs/unreleased/53064-bypassing-pipeline-jobs-by-canceling-the-pipeline-and-manually-running-later-jobs.yml
0 → 100644
View file @
71dc1bea
---
title
:
Make canceled jobs not retryable
merge_request
:
27503
author
:
type
:
changed
doc/ci/pipelines.md
View file @
71dc1bea
...
@@ -266,6 +266,9 @@ Clicking on an individual job will show you its job trace, and allow you to:
...
@@ -266,6 +266,9 @@ Clicking on an individual job will show you its job trace, and allow you to:
-
Retry the job.
-
Retry the job.
-
Erase the job trace.
-
Erase the job trace.
NOTE:
**Note:**
To prevent jobs from being bypassed or run out of order, canceled jobs can only be retried when the whole pipeline they belong to is retried.
### Seeing the failure reason for jobs
### Seeing the failure reason for jobs
> [Introduced](https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/17782) in GitLab 10.7.
> [Introduced](https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/17782) in GitLab 10.7.
...
...
spec/features/projects/jobs_spec.rb
View file @
71dc1bea
...
@@ -936,8 +936,8 @@ describe 'Jobs', :clean_gitlab_redis_shared_state do
...
@@ -936,8 +936,8 @@ describe 'Jobs', :clean_gitlab_redis_shared_state do
find
(
'.js-cancel-job'
).
click
find
(
'.js-cancel-job'
).
click
end
end
it
'loads the page and shows
all needed
controls'
do
it
'loads the page and shows
no
controls'
do
expect
(
page
).
to
have_content
'Retry'
expect
(
page
).
not_
to
have_content
'Retry'
end
end
end
end
end
end
...
@@ -946,7 +946,7 @@ describe 'Jobs', :clean_gitlab_redis_shared_state do
...
@@ -946,7 +946,7 @@ describe 'Jobs', :clean_gitlab_redis_shared_state do
context
"Job from project"
,
:js
do
context
"Job from project"
,
:js
do
before
do
before
do
job
.
run!
job
.
run!
job
.
cancel!
job
.
drop!
(
:script_failure
)
visit
project_job_path
(
project
,
job
)
visit
project_job_path
(
project
,
job
)
wait_for_requests
wait_for_requests
...
...
spec/features/projects/pipelines/pipeline_spec.rb
View file @
71dc1bea
...
@@ -115,11 +115,11 @@ describe 'Pipeline', :js do
...
@@ -115,11 +115,11 @@ describe 'Pipeline', :js do
end
end
end
end
it
'cancels the running build and
shows
retry button'
do
it
'cancels the running build and
does not show
retry button'
do
find
(
'#ci-badge-deploy .ci-action-icon-container'
).
click
find
(
'#ci-badge-deploy .ci-action-icon-container'
).
click
page
.
within
(
'#ci-badge-deploy'
)
do
page
.
within
(
'#ci-badge-deploy'
)
do
expect
(
page
).
to
have_css
(
'.js-icon-retry'
)
expect
(
page
).
not_
to
have_css
(
'.js-icon-retry'
)
end
end
end
end
end
end
...
@@ -133,11 +133,11 @@ describe 'Pipeline', :js do
...
@@ -133,11 +133,11 @@ describe 'Pipeline', :js do
end
end
end
end
it
'cancels the preparing build and
shows
retry button'
do
it
'cancels the preparing build and
does not show
retry button'
do
find
(
'#ci-badge-deploy .ci-action-icon-container'
).
click
find
(
'#ci-badge-deploy .ci-action-icon-container'
).
click
page
.
within
(
'#ci-badge-deploy'
)
do
page
.
within
(
'#ci-badge-deploy'
)
do
expect
(
page
).
to
have_css
(
'.js-icon-retry'
)
expect
(
page
).
not_
to
have_css
(
'.js-icon-retry'
)
end
end
end
end
end
end
...
...
spec/lib/gitlab/ci/status/build/factory_spec.rb
View file @
71dc1bea
...
@@ -163,11 +163,11 @@ describe Gitlab::Ci::Status::Build::Factory do
...
@@ -163,11 +163,11 @@ describe Gitlab::Ci::Status::Build::Factory do
it
'matches correct extended statuses'
do
it
'matches correct extended statuses'
do
expect
(
factory
.
extended_statuses
)
expect
(
factory
.
extended_statuses
)
.
to
eq
[
Gitlab
::
Ci
::
Status
::
Build
::
Canceled
,
Gitlab
::
Ci
::
Status
::
Build
::
Retryable
]
.
to
eq
[
Gitlab
::
Ci
::
Status
::
Build
::
Canceled
]
end
end
it
'
fabricates
a retryable build status'
do
it
'
does not fabricate
a retryable build status'
do
expect
(
status
).
to
be_a
Gitlab
::
Ci
::
Status
::
Build
::
Retryable
expect
(
status
).
not_
to
be_a
Gitlab
::
Ci
::
Status
::
Build
::
Retryable
end
end
it
'fabricates status with correct details'
do
it
'fabricates status with correct details'
do
...
@@ -177,7 +177,7 @@ describe Gitlab::Ci::Status::Build::Factory do
...
@@ -177,7 +177,7 @@ describe Gitlab::Ci::Status::Build::Factory do
expect
(
status
.
illustration
).
to
include
(
:image
,
:size
,
:title
)
expect
(
status
.
illustration
).
to
include
(
:image
,
:size
,
:title
)
expect
(
status
.
label
).
to
eq
'canceled'
expect
(
status
.
label
).
to
eq
'canceled'
expect
(
status
).
to
have_details
expect
(
status
).
to
have_details
expect
(
status
).
to
have_action
expect
(
status
).
not_
to
have_action
end
end
end
end
...
...
spec/models/ci/build_spec.rb
View file @
71dc1bea
...
@@ -1434,7 +1434,7 @@ describe Ci::Build do
...
@@ -1434,7 +1434,7 @@ describe Ci::Build do
build
.
cancel!
build
.
cancel!
end
end
it
{
is_expected
.
to
be_retryable
}
it
{
is_expected
.
not_
to
be_retryable
}
end
end
end
end
...
@@ -1964,7 +1964,7 @@ describe Ci::Build do
...
@@ -1964,7 +1964,7 @@ describe Ci::Build do
context
'when build has been canceled'
do
context
'when build has been canceled'
do
subject
{
build_stubbed
(
:ci_build
,
:manual
,
status: :canceled
)
}
subject
{
build_stubbed
(
:ci_build
,
:manual
,
status: :canceled
)
}
it
{
is_expected
.
to
be_playable
}
it
{
is_expected
.
not_
to
be_playable
}
end
end
context
'when build is successful'
do
context
'when build is successful'
do
...
...
spec/requests/api/jobs_spec.rb
View file @
71dc1bea
...
@@ -863,7 +863,7 @@ describe API::Jobs do
...
@@ -863,7 +863,7 @@ describe API::Jobs do
end
end
describe
'POST /projects/:id/jobs/:job_id/retry'
do
describe
'POST /projects/:id/jobs/:job_id/retry'
do
let
(
:job
)
{
create
(
:ci_build
,
:
cance
led
,
pipeline:
pipeline
)
}
let
(
:job
)
{
create
(
:ci_build
,
:
fai
led
,
pipeline:
pipeline
)
}
before
do
before
do
post
api
(
"/projects/
#{
project
.
id
}
/jobs/
#{
job
.
id
}
/retry"
,
api_user
)
post
api
(
"/projects/
#{
project
.
id
}
/jobs/
#{
job
.
id
}
/retry"
,
api_user
)
...
@@ -873,7 +873,7 @@ describe API::Jobs do
...
@@ -873,7 +873,7 @@ describe API::Jobs do
context
'user with :update_build permission'
do
context
'user with :update_build permission'
do
it
'retries non-running job'
do
it
'retries non-running job'
do
expect
(
response
).
to
have_gitlab_http_status
(
201
)
expect
(
response
).
to
have_gitlab_http_status
(
201
)
expect
(
project
.
builds
.
first
.
status
).
to
eq
(
'
cance
led'
)
expect
(
project
.
builds
.
first
.
status
).
to
eq
(
'
fai
led'
)
expect
(
json_response
[
'status'
]).
to
eq
(
'pending'
)
expect
(
json_response
[
'status'
]).
to
eq
(
'pending'
)
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