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
107adcd3
Commit
107adcd3
authored
Dec 17, 2020
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'lower-explore-pages' into 'master'
Lower explore page limit See merge request gitlab-org/gitlab!50233
parents
19d08365
b3f21f50
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
3 deletions
+11
-3
app/controllers/explore/projects_controller.rb
app/controllers/explore/projects_controller.rb
+5
-2
changelogs/unreleased/lower-explore-pages.yml
changelogs/unreleased/lower-explore-pages.yml
+5
-0
spec/controllers/explore/projects_controller_spec.rb
spec/controllers/explore/projects_controller_spec.rb
+1
-1
No files found.
app/controllers/explore/projects_controller.rb
View file @
107adcd3
...
...
@@ -9,13 +9,16 @@ class Explore::ProjectsController < Explore::ApplicationController
include
SortingPreference
MIN_SEARCH_LENGTH
=
3
PAGE_LIMIT
=
50
before_action
:set_non_archived_param
before_action
:set_sorting
# Limit taken from https://gitlab.com/gitlab-org/gitlab/issues/38357
# For background information on the limit, see:
# https://gitlab.com/gitlab-org/gitlab/-/issues/38357
# https://gitlab.com/gitlab-org/gitlab/-/issues/262682
before_action
only:
[
:index
,
:trending
,
:starred
]
do
limit_pages
(
200
)
limit_pages
(
PAGE_LIMIT
)
end
rescue_from
PageOutOfBoundsError
,
with: :page_out_of_bounds
...
...
changelogs/unreleased/lower-explore-pages.yml
0 → 100644
View file @
107adcd3
---
title
:
Lower /explore page limit
merge_request
:
50233
author
:
type
:
performance
spec/controllers/explore/projects_controller_spec.rb
View file @
107adcd3
...
...
@@ -60,7 +60,7 @@ RSpec.describe Explore::ProjectsController do
end
shared_examples
"blocks high page numbers"
do
let
(
:page_limit
)
{
200
}
let
(
:page_limit
)
{
described_class
::
PAGE_LIMIT
}
context
"page number is too high"
do
[
:index
,
:trending
,
:starred
].
each
do
|
endpoint
|
...
...
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