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
b35753d8
Commit
b35753d8
authored
Jul 03, 2020
by
Laura Montemayor
Committed by
Bob Van Landuyt
Jul 03, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve timeout in admin/jobs
parent
3e2e2a8b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
1 deletion
+40
-1
app/controllers/admin/jobs_controller.rb
app/controllers/admin/jobs_controller.rb
+3
-1
changelogs/unreleased/lm-resolve-timeout.yml
changelogs/unreleased/lm-resolve-timeout.yml
+5
-0
spec/controllers/admin/jobs_controller_spec.rb
spec/controllers/admin/jobs_controller_spec.rb
+32
-0
No files found.
app/controllers/admin/jobs_controller.rb
View file @
b35753d8
# frozen_string_literal: true
class
Admin::JobsController
<
Admin
::
ApplicationController
BUILDS_PER_PAGE
=
30
def
index
# We need all builds for tabs counters
@all_builds
=
Ci
::
JobsFinder
.
new
(
current_user:
current_user
).
execute
...
...
@@ -8,7 +10,7 @@ class Admin::JobsController < Admin::ApplicationController
@scope
=
params
[
:scope
]
@builds
=
Ci
::
JobsFinder
.
new
(
current_user:
current_user
,
params:
params
).
execute
@builds
=
@builds
.
eager_load_everything
@builds
=
@builds
.
page
(
params
[
:page
]).
per
(
30
)
@builds
=
@builds
.
page
(
params
[
:page
]).
per
(
BUILDS_PER_PAGE
).
without_count
end
def
cancel_all
...
...
changelogs/unreleased/lm-resolve-timeout.yml
0 → 100644
View file @
b35753d8
---
title
:
Resolve timeout in admin/jobs
merge_request
:
35385
author
:
type
:
fixed
spec/controllers/admin/jobs_controller_spec.rb
0 → 100644
View file @
b35753d8
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
Admin
::
JobsController
do
describe
'GET #index'
do
context
'with an authenticated admin user'
do
it
'paginates builds without a total count'
,
:aggregate_failures
do
stub_const
(
"Admin::JobsController::BUILDS_PER_PAGE"
,
1
)
sign_in
(
create
(
:admin
))
create_list
(
:ci_build
,
2
)
get
:index
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
assigns
(
:builds
)).
to
be_a
(
Kaminari
::
PaginatableWithoutCount
)
expect
(
assigns
(
:builds
).
count
).
to
be
(
1
)
end
end
context
'without admin access'
do
it
'returns `not_found`'
do
sign_in
(
create
(
:user
))
get
:index
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
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