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
b169595f
Commit
b169595f
authored
Jan 15, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
59feefb5
8f8a223d
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
7 additions
and
83 deletions
+7
-83
app/controllers/projects/jobs_controller.rb
app/controllers/projects/jobs_controller.rb
+2
-12
app/views/projects/jobs/index.html.haml
app/views/projects/jobs/index.html.haml
+0
-4
changelogs/unreleased/remove-cancel-all-button-in-job-list-view.yml
.../unreleased/remove-cancel-all-button-in-job-list-view.yml
+5
-0
config/routes/project.rb
config/routes/project.rb
+0
-2
spec/controllers/projects/jobs_controller_spec.rb
spec/controllers/projects/jobs_controller_spec.rb
+0
-44
spec/features/projects/jobs_spec.rb
spec/features/projects/jobs_spec.rb
+0
-21
No files found.
app/controllers/projects/jobs_controller.rb
View file @
b169595f
...
...
@@ -4,10 +4,10 @@ class Projects::JobsController < Projects::ApplicationController
include
SendFileUpload
include
ContinueParams
before_action
:build
,
except:
[
:index
,
:cancel_all
]
before_action
:build
,
except:
[
:index
]
before_action
:authorize_read_build!
before_action
:authorize_update_build!
,
except:
[
:index
,
:show
,
:status
,
:raw
,
:trace
,
:
cancel_all
,
:
erase
]
except:
[
:index
,
:show
,
:status
,
:raw
,
:trace
,
:erase
]
before_action
:authorize_erase_build!
,
only:
[
:erase
]
before_action
:authorize_use_build_terminal!
,
only:
[
:terminal
,
:terminal_websocket_authorize
]
before_action
:verify_api_request!
,
only: :terminal_websocket_authorize
...
...
@@ -39,16 +39,6 @@ class Projects::JobsController < Projects::ApplicationController
end
# rubocop: enable CodeReuse/ActiveRecord
def
cancel_all
return
access_denied!
unless
can?
(
current_user
,
:update_build
,
project
)
@project
.
builds
.
running_or_pending
.
each
do
|
build
|
build
.
cancel
if
can?
(
current_user
,
:update_build
,
build
)
end
redirect_to
project_jobs_path
(
project
)
end
# rubocop: disable CodeReuse/ActiveRecord
def
show
@pipeline
=
@build
.
pipeline
...
...
app/views/projects/jobs/index.html.haml
View file @
b169595f
...
...
@@ -8,10 +8,6 @@
.nav-controls
-
if
can?
(
current_user
,
:update_build
,
@project
)
-
if
@all_builds
.
running_or_pending
.
limit
(
1
).
any?
# rubocop: disable CodeReuse/ActiveRecord
=
link_to
'Cancel running'
,
cancel_all_project_jobs_path
(
@project
),
data:
{
confirm:
'Are you sure?'
},
class:
'btn btn-danger'
,
method: :post
-
unless
@repository
.
gitlab_ci_yml
=
link_to
'Get started with Pipelines'
,
help_page_path
(
'ci/quick_start/README'
),
class:
'btn btn-info'
...
...
changelogs/unreleased/remove-cancel-all-button-in-job-list-view.yml
0 → 100644
View file @
b169595f
---
title
:
Remove Cancel all jobs button in general jobs list view
merge_request
:
author
:
Jordi Llull
type
:
removed
config/routes/project.rb
View file @
b169595f
...
...
@@ -317,8 +317,6 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
resources
:jobs
,
only:
[
:index
,
:show
],
constraints:
{
id:
/\d+/
}
do
collection
do
post
:cancel_all
resources
:artifacts
,
only:
[]
do
collection
do
get
:latest_succeeded
,
...
...
spec/controllers/projects/jobs_controller_spec.rb
View file @
b169595f
...
...
@@ -770,50 +770,6 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do
end
end
describe
'POST cancel_all'
do
before
do
project
.
add_developer
(
user
)
sign_in
(
user
)
end
context
'when jobs are cancelable'
do
before
do
create_list
(
:ci_build
,
2
,
:cancelable
,
pipeline:
pipeline
)
post_cancel_all
end
it
'redirects to a index page'
do
expect
(
response
).
to
have_gitlab_http_status
(
:found
)
expect
(
response
).
to
redirect_to
(
namespace_project_jobs_path
)
end
it
'transits to canceled'
do
expect
(
Ci
::
Build
.
all
).
to
all
(
be_canceled
)
end
end
context
'when jobs are not cancelable'
do
before
do
create_list
(
:ci_build
,
2
,
:canceled
,
pipeline:
pipeline
)
post_cancel_all
end
it
'redirects to a index page'
do
expect
(
response
).
to
have_gitlab_http_status
(
:found
)
expect
(
response
).
to
redirect_to
(
namespace_project_jobs_path
)
end
end
def
post_cancel_all
post
:cancel_all
,
params:
{
namespace_id:
project
.
namespace
,
project_id:
project
}
end
end
describe
'POST erase'
do
let
(
:role
)
{
:maintainer
}
...
...
spec/features/projects/jobs_spec.rb
View file @
b169595f
...
...
@@ -28,7 +28,6 @@ describe 'Jobs', :clean_gitlab_redis_shared_state do
end
it
"shows Pending tab jobs"
do
expect
(
page
).
to
have_link
'Cancel running'
expect
(
page
).
to
have_selector
(
'.nav-links li.active'
,
text:
'Pending'
)
expect
(
page
).
to
have_content
job
.
short_sha
expect
(
page
).
to
have_content
job
.
ref
...
...
@@ -44,7 +43,6 @@ describe 'Jobs', :clean_gitlab_redis_shared_state do
it
"shows Running tab jobs"
do
expect
(
page
).
to
have_selector
(
'.nav-links li.active'
,
text:
'Running'
)
expect
(
page
).
to
have_link
'Cancel running'
expect
(
page
).
to
have_content
job
.
short_sha
expect
(
page
).
to
have_content
job
.
ref
expect
(
page
).
to
have_content
job
.
name
...
...
@@ -60,7 +58,6 @@ describe 'Jobs', :clean_gitlab_redis_shared_state do
it
"shows Finished tab jobs"
do
expect
(
page
).
to
have_selector
(
'.nav-links li.active'
,
text:
'Finished'
)
expect
(
page
).
to
have_content
'No jobs to show'
expect
(
page
).
to
have_link
'Cancel running'
end
end
...
...
@@ -75,7 +72,6 @@ describe 'Jobs', :clean_gitlab_redis_shared_state do
expect
(
page
).
to
have_content
job
.
short_sha
expect
(
page
).
to
have_content
job
.
ref
expect
(
page
).
to
have_content
job
.
name
expect
(
page
).
not_to
have_link
'Cancel running'
end
end
...
...
@@ -94,23 +90,6 @@ describe 'Jobs', :clean_gitlab_redis_shared_state do
end
end
describe
"POST /:project/jobs/:id/cancel_all"
do
before
do
job
.
run!
visit
project_jobs_path
(
project
)
click_link
"Cancel running"
end
it
'shows all necessary content'
do
expect
(
page
).
to
have_selector
(
'.nav-links li.active'
,
text:
'All'
)
expect
(
page
).
to
have_content
'canceled'
expect
(
page
).
to
have_content
job
.
short_sha
expect
(
page
).
to
have_content
job
.
ref
expect
(
page
).
to
have_content
job
.
name
expect
(
page
).
not_to
have_link
'Cancel running'
end
end
describe
"GET /:project/jobs/:id"
do
context
"Job from project"
do
let
(
:job
)
{
create
(
:ci_build
,
:success
,
:trace_live
,
pipeline:
pipeline
)
}
...
...
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