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
iv
gitlab-ce
Commits
bc621eef
Commit
bc621eef
authored
May 31, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pipelines can be canceled only when there are running builds
parent
ba81c912
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
2 deletions
+7
-2
CHANGELOG
CHANGELOG
+1
-0
app/models/ci/commit.rb
app/models/ci/commit.rb
+4
-0
app/views/projects/ci/commits/_commit.html.haml
app/views/projects/ci/commits/_commit.html.haml
+2
-2
No files found.
CHANGELOG
View file @
bc621eef
...
@@ -14,6 +14,7 @@ v 8.9.0 (unreleased)
...
@@ -14,6 +14,7 @@ v 8.9.0 (unreleased)
- Fix issues filter when ordering by milestone
- Fix issues filter when ordering by milestone
- Todos will display target state if issuable target is 'Closed' or 'Merged'
- Todos will display target state if issuable target is 'Closed' or 'Merged'
- Remove 'main language' feature
- Remove 'main language' feature
- Pipelines can be canceled only when there are running builds
- Projects pending deletion will render a 404 page
- Projects pending deletion will render a 404 page
- Measure queue duration between gitlab-workhorse and Rails
- Measure queue duration between gitlab-workhorse and Rails
- Make authentication service for Container Registry to be compatible with < Docker 1.11
- Make authentication service for Container Registry to be compatible with < Docker 1.11
...
...
app/models/ci/commit.rb
View file @
bc621eef
...
@@ -66,6 +66,10 @@ module Ci
...
@@ -66,6 +66,10 @@ module Ci
end
end
end
end
def
cancelable?
builds
.
running_or_pending
.
any?
end
def
cancel_running
def
cancel_running
builds
.
running_or_pending
.
each
(
&
:cancel
)
builds
.
running_or_pending
.
each
(
&
:cancel
)
end
end
...
...
app/views/projects/ci/commits/_commit.html.haml
View file @
bc621eef
...
@@ -63,9 +63,9 @@
...
@@ -63,9 +63,9 @@
%span
#{
build
.
name
}
%span
#{
build
.
name
}
-
if
can?
(
current_user
,
:update_pipeline
,
@project
)
-
if
can?
(
current_user
,
:update_pipeline
,
@project
)
-
if
commit
.
retryable?
&&
commit
.
builds
.
failed
.
any?
-
if
commit
.
retryable?
=
link_to
retry_namespace_project_pipeline_path
(
@project
.
namespace
,
@project
,
commit
.
id
),
class:
'btn has-tooltip'
,
title:
"Retry"
,
method: :post
do
=
link_to
retry_namespace_project_pipeline_path
(
@project
.
namespace
,
@project
,
commit
.
id
),
class:
'btn has-tooltip'
,
title:
"Retry"
,
method: :post
do
=
icon
(
"repeat"
)
=
icon
(
"repeat"
)
-
if
commit
.
activ
e?
-
if
commit
.
cancelabl
e?
=
link_to
cancel_namespace_project_pipeline_path
(
@project
.
namespace
,
@project
,
commit
.
id
),
class:
'btn btn-remove has-tooltip'
,
title:
"Cancel"
,
method: :post
do
=
link_to
cancel_namespace_project_pipeline_path
(
@project
.
namespace
,
@project
,
commit
.
id
),
class:
'btn btn-remove has-tooltip'
,
title:
"Cancel"
,
method: :post
do
=
icon
(
"remove"
)
=
icon
(
"remove"
)
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