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
1d465c3e
Commit
1d465c3e
authored
Sep 09, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
4da44a5d
9fd44513
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
37 additions
and
14 deletions
+37
-14
changelogs/unreleased/fj-11777-lower-search-count-limits.yml
changelogs/unreleased/fj-11777-lower-search-count-limits.yml
+5
-0
doc/update/mysql_to_postgresql.md
doc/update/mysql_to_postgresql.md
+9
-1
lib/gitlab/search_results.rb
lib/gitlab/search_results.rb
+3
-2
spec/lib/gitlab/project_search_results_spec.rb
spec/lib/gitlab/project_search_results_spec.rb
+4
-2
spec/lib/gitlab/search_results_spec.rb
spec/lib/gitlab/search_results_spec.rb
+9
-8
spec/lib/gitlab/snippet_search_results_spec.rb
spec/lib/gitlab/snippet_search_results_spec.rb
+3
-1
spec/support/helpers/search_helpers.rb
spec/support/helpers/search_helpers.rb
+4
-0
No files found.
changelogs/unreleased/fj-11777-lower-search-count-limits.yml
0 → 100644
View file @
1d465c3e
---
title
:
Lower search counters
merge_request
:
11777
author
:
type
:
performance
doc/update/mysql_to_postgresql.md
View file @
1d465c3e
...
@@ -13,7 +13,7 @@ NOTE: **Note:**
...
@@ -13,7 +13,7 @@ NOTE: **Note:**
Support for MySQL was removed in GitLab 12.1. This procedure should be performed
Support for MySQL was removed in GitLab 12.1. This procedure should be performed
**before**
installing GitLab 12.1.
**before**
installing GitLab 12.1.
[
pgloader
](
https://pgloader.io/
)
3.4.1+ is required.
[
pgloader
](
https://pgloader.io/
)
3.4.1+ is required
, confirm with
`pgloader -V`
.
You can install it directly from your distribution, for example in
You can install it directly from your distribution, for example in
Debian/Ubuntu:
Debian/Ubuntu:
...
@@ -125,6 +125,10 @@ new PostgreSQL one:
...
@@ -125,6 +125,10 @@ new PostgreSQL one:
create no indexes, preserve index names, no foreign keys,
create no indexes, preserve index names, no foreign keys,
data only
data only
SET MySQL PARAMETERS
net_read_timeout = '90',
net_write_timeout = '180'
ALTER SCHEMA 'gitlabhq_production' RENAME TO 'public'
ALTER SCHEMA 'gitlabhq_production' RENAME TO 'public'
;
;
...
@@ -221,6 +225,10 @@ new PostgreSQL one:
...
@@ -221,6 +225,10 @@ new PostgreSQL one:
WITH include no drop, truncate, disable triggers, create no tables,
WITH include no drop, truncate, disable triggers, create no tables,
create no indexes, preserve index names, no foreign keys,
create no indexes, preserve index names, no foreign keys,
data only
data only
SET MySQL PARAMETERS
net_read_timeout = '90',
net_write_timeout = '180'
ALTER SCHEMA 'gitlabhq_production' RENAME TO 'public'
ALTER SCHEMA 'gitlabhq_production' RENAME TO 'public'
...
...
lib/gitlab/search_results.rb
View file @
1d465c3e
...
@@ -2,7 +2,8 @@
...
@@ -2,7 +2,8 @@
module
Gitlab
module
Gitlab
class
SearchResults
class
SearchResults
COUNT_LIMIT
=
1001
COUNT_LIMIT
=
101
COUNT_LIMIT_MESSAGE
=
"
#{
COUNT_LIMIT
-
1
}
+"
attr_reader
:current_user
,
:query
,
:per_page
attr_reader
:current_user
,
:query
,
:per_page
...
@@ -60,7 +61,7 @@ module Gitlab
...
@@ -60,7 +61,7 @@ module Gitlab
def
formatted_limited_count
(
count
)
def
formatted_limited_count
(
count
)
if
count
>=
COUNT_LIMIT
if
count
>=
COUNT_LIMIT
"
#{
COUNT_LIMIT
-
1
}
+"
COUNT_LIMIT_MESSAGE
else
else
count
.
to_s
count
.
to_s
end
end
...
...
spec/lib/gitlab/project_search_results_spec.rb
View file @
1d465c3e
...
@@ -4,6 +4,8 @@
...
@@ -4,6 +4,8 @@
require
'spec_helper'
require
'spec_helper'
describe
Gitlab
::
ProjectSearchResults
do
describe
Gitlab
::
ProjectSearchResults
do
include
SearchHelpers
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:query
)
{
'hello world'
}
let
(
:query
)
{
'hello world'
}
...
@@ -31,10 +33,10 @@ describe Gitlab::ProjectSearchResults do
...
@@ -31,10 +33,10 @@ describe Gitlab::ProjectSearchResults do
where
(
:scope
,
:count_method
,
:expected
)
do
where
(
:scope
,
:count_method
,
:expected
)
do
'blobs'
|
:blobs_count
|
'1234'
'blobs'
|
:blobs_count
|
'1234'
'notes'
|
:limited_notes_count
|
'1000+'
'notes'
|
:limited_notes_count
|
max_limited_count
'wiki_blobs'
|
:wiki_blobs_count
|
'1234'
'wiki_blobs'
|
:wiki_blobs_count
|
'1234'
'commits'
|
:commits_count
|
'1234'
'commits'
|
:commits_count
|
'1234'
'projects'
|
:limited_projects_count
|
'1000+'
'projects'
|
:limited_projects_count
|
max_limited_count
'unknown'
|
nil
|
nil
'unknown'
|
nil
|
nil
end
end
...
...
spec/lib/gitlab/search_results_spec.rb
View file @
1d465c3e
...
@@ -4,6 +4,7 @@ require 'spec_helper'
...
@@ -4,6 +4,7 @@ require 'spec_helper'
describe
Gitlab
::
SearchResults
do
describe
Gitlab
::
SearchResults
do
include
ProjectForksHelper
include
ProjectForksHelper
include
SearchHelpers
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
let!
(
:project
)
{
create
(
:project
,
name:
'foo'
)
}
let!
(
:project
)
{
create
(
:project
,
name:
'foo'
)
}
...
@@ -35,11 +36,11 @@ describe Gitlab::SearchResults do
...
@@ -35,11 +36,11 @@ describe Gitlab::SearchResults do
using
RSpec
::
Parameterized
::
TableSyntax
using
RSpec
::
Parameterized
::
TableSyntax
where
(
:scope
,
:count_method
,
:expected
)
do
where
(
:scope
,
:count_method
,
:expected
)
do
'projects'
|
:limited_projects_count
|
'1000+'
'projects'
|
:limited_projects_count
|
max_limited_count
'issues'
|
:limited_issues_count
|
'1000+'
'issues'
|
:limited_issues_count
|
max_limited_count
'merge_requests'
|
:limited_merge_requests_count
|
'1000+'
'merge_requests'
|
:limited_merge_requests_count
|
max_limited_count
'milestones'
|
:limited_milestones_count
|
'1000+'
'milestones'
|
:limited_milestones_count
|
max_limited_count
'users'
|
:limited_users_count
|
'1000+'
'users'
|
:limited_users_count
|
max_limited_count
'unknown'
|
nil
|
nil
'unknown'
|
nil
|
nil
end
end
...
@@ -56,9 +57,9 @@ describe Gitlab::SearchResults do
...
@@ -56,9 +57,9 @@ describe Gitlab::SearchResults do
where
(
:count
,
:expected
)
do
where
(
:count
,
:expected
)
do
23
|
'23'
23
|
'23'
100
0
|
'10
00'
100
|
'1
00'
10
01
|
'1000+'
10
1
|
max_limited_count
1234
|
'1000+'
1234
|
max_limited_count
end
end
with_them
do
with_them
do
...
...
spec/lib/gitlab/snippet_search_results_spec.rb
View file @
1d465c3e
...
@@ -3,6 +3,8 @@
...
@@ -3,6 +3,8 @@
require
'spec_helper'
require
'spec_helper'
describe
Gitlab
::
SnippetSearchResults
do
describe
Gitlab
::
SnippetSearchResults
do
include
SearchHelpers
let!
(
:snippet
)
{
create
(
:snippet
,
content:
'foo'
,
file_name:
'foo'
)
}
let!
(
:snippet
)
{
create
(
:snippet
,
content:
'foo'
,
file_name:
'foo'
)
}
let
(
:results
)
{
described_class
.
new
(
Snippet
.
all
,
'foo'
)
}
let
(
:results
)
{
described_class
.
new
(
Snippet
.
all
,
'foo'
)
}
...
@@ -25,7 +27,7 @@ describe Gitlab::SnippetSearchResults do
...
@@ -25,7 +27,7 @@ describe Gitlab::SnippetSearchResults do
where
(
:scope
,
:count_method
,
:expected
)
do
where
(
:scope
,
:count_method
,
:expected
)
do
'snippet_titles'
|
:snippet_titles_count
|
'1234'
'snippet_titles'
|
:snippet_titles_count
|
'1234'
'snippet_blobs'
|
:snippet_blobs_count
|
'1234'
'snippet_blobs'
|
:snippet_blobs_count
|
'1234'
'projects'
|
:limited_projects_count
|
'1000+'
'projects'
|
:limited_projects_count
|
max_limited_count
'unknown'
|
nil
|
nil
'unknown'
|
nil
|
nil
end
end
...
...
spec/support/helpers/search_helpers.rb
View file @
1d465c3e
...
@@ -19,4 +19,8 @@ module SearchHelpers
...
@@ -19,4 +19,8 @@ module SearchHelpers
click_link
scope
click_link
scope
end
end
end
end
def
max_limited_count
Gitlab
::
SearchResults
::
COUNT_LIMIT_MESSAGE
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