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
226a8605
Commit
226a8605
authored
Oct 21, 2020
by
Jose Vargas
Committed by
Adrien Kohlbecker
Nov 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Paginate project_runners in ci_cd settings
This pagination applies to the project ci_cd settings page
parent
9d660d49
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
2 deletions
+23
-2
app/controllers/projects/settings/ci_cd_controller.rb
app/controllers/projects/settings/ci_cd_controller.rb
+4
-2
app/views/projects/runners/_specific_runners.html.haml
app/views/projects/runners/_specific_runners.html.haml
+1
-0
changelogs/unreleased/jivanvl-add-pagination-specific-runners.yml
...gs/unreleased/jivanvl-add-pagination-specific-runners.yml
+5
-0
spec/features/runners_spec.rb
spec/features/runners_spec.rb
+13
-0
No files found.
app/controllers/projects/settings/ci_cd_controller.rb
View file @
226a8605
...
...
@@ -5,6 +5,8 @@ module Projects
class
CiCdController
<
Projects
::
ApplicationController
include
RunnerSetupScripts
NUMBER_OF_RUNNERS_PER_PAGE
=
20
before_action
:authorize_admin_pipeline!
before_action
:define_variables
before_action
do
...
...
@@ -108,13 +110,13 @@ module Projects
end
def
define_runners_variables
@project_runners
=
@project
.
runners
.
ordered
@project_runners
=
@project
.
runners
.
ordered
.
page
(
params
[
:page
]).
per
(
NUMBER_OF_RUNNERS_PER_PAGE
)
@assignable_runners
=
current_user
.
ci_owned_runners
.
assignable_for
(
project
)
.
ordered
.
page
(
params
[
:page
]).
per
(
20
)
.
page
(
params
[
:page
]).
per
(
NUMBER_OF_RUNNERS_PER_PAGE
)
@shared_runners
=
::
Ci
::
Runner
.
instance_type
.
active
...
...
app/views/projects/runners/_specific_runners.html.haml
View file @
226a8605
...
...
@@ -17,6 +17,7 @@
%h4
.underlined-title
=
_
(
'Runners activated for this project'
)
%ul
.bordered-list.activated-specific-runners
=
render
partial:
'projects/runners/runner'
,
collection:
@project_runners
,
as: :runner
=
paginate
@project_runners
,
theme:
"gitlab"
,
:params
=>
{
:anchor
=>
'#js-runners-settings'
}
-
if
@assignable_runners
.
any?
%h4
.underlined-title
=
_
(
'Available specific runners'
)
...
...
changelogs/unreleased/jivanvl-add-pagination-specific-runners.yml
0 → 100644
View file @
226a8605
---
title
:
Paginate project_runners in ci_cd settings
merge_request
:
45830
author
:
type
:
fixed
spec/features/runners_spec.rb
View file @
226a8605
...
...
@@ -122,6 +122,19 @@ RSpec.describe 'Runners' do
end
end
context
'when multiple runners are configured'
do
let!
(
:specific_runner
)
{
create
(
:ci_runner
,
:project
,
projects:
[
project
])
}
let!
(
:specific_runner_2
)
{
create
(
:ci_runner
,
:project
,
projects:
[
project
])
}
it
'adds pagination to the runner list'
do
stub_const
(
'Projects::Settings::CiCdController::NUMBER_OF_RUNNERS_PER_PAGE'
,
1
)
visit
project_runners_path
(
project
)
expect
(
find
(
'.pagination'
)).
not_to
be_nil
end
end
context
'when a specific runner exists in another project'
do
let
(
:another_project
)
{
create
(
:project
)
}
let!
(
:specific_runner
)
{
create
(
:ci_runner
,
:project
,
projects:
[
another_project
])
}
...
...
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