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
f908c72f
Commit
f908c72f
authored
Jun 27, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
b6cb3cbb
ab0c3e08
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
6 deletions
+17
-6
app/controllers/application_controller.rb
app/controllers/application_controller.rb
+6
-0
app/controllers/projects/application_controller.rb
app/controllers/projects/application_controller.rb
+0
-6
app/controllers/search_controller.rb
app/controllers/search_controller.rb
+2
-0
changelogs/unreleased/sh-add-gitaly-ref-caching-search-controller.yml
...nreleased/sh-add-gitaly-ref-caching-search-controller.yml
+5
-0
spec/controllers/search_controller_spec.rb
spec/controllers/search_controller_spec.rb
+4
-0
No files found.
app/controllers/application_controller.rb
View file @
f908c72f
...
...
@@ -516,6 +516,12 @@ class ApplicationController < ActionController::Base
def
sentry_context
Gitlab
::
Sentry
.
context
(
current_user
)
end
def
allow_gitaly_ref_name_caching
::
Gitlab
::
GitalyClient
.
allow_ref_name_caching
do
yield
end
end
end
ApplicationController
.
prepend
(
EE
::
ApplicationController
)
app/controllers/projects/application_controller.rb
View file @
f908c72f
...
...
@@ -87,10 +87,4 @@ class Projects::ApplicationController < ApplicationController
def
check_issues_available!
return
render_404
unless
@project
.
feature_available?
(
:issues
,
current_user
)
end
def
allow_gitaly_ref_name_caching
::
Gitlab
::
GitalyClient
.
allow_ref_name_caching
do
yield
end
end
end
app/controllers/search_controller.rb
View file @
f908c72f
...
...
@@ -5,6 +5,8 @@ class SearchController < ApplicationController
include
SearchHelper
include
RendersCommits
around_action
:allow_gitaly_ref_name_caching
skip_before_action
:authenticate_user!
requires_cross_project_access
if:
->
do
search_term_present
=
params
[
:search
].
present?
||
params
[
:term
].
present?
...
...
changelogs/unreleased/sh-add-gitaly-ref-caching-search-controller.yml
0 → 100644
View file @
f908c72f
---
title
:
Enable Gitaly ref caching for SearchController
merge_request
:
30105
author
:
type
:
performance
spec/controllers/search_controller_spec.rb
View file @
f908c72f
...
...
@@ -17,6 +17,10 @@ describe SearchController do
set
(
:project
)
{
create
(
:project
,
:public
,
:repository
,
:wiki_repo
)
}
before
do
expect
(
::
Gitlab
::
GitalyClient
).
to
receive
(
:allow_ref_name_caching
).
and_call_original
end
subject
{
get
(
:show
,
params:
{
project_id:
project
.
id
,
scope:
scope
,
search:
'merge'
})
}
where
(
:partial
,
:scope
)
do
...
...
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