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
d8c7d25a
Commit
d8c7d25a
authored
Apr 04, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
bdb13c9e
9667ae2e
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
24 additions
and
9 deletions
+24
-9
app/controllers/projects/application_controller.rb
app/controllers/projects/application_controller.rb
+6
-0
app/controllers/projects/merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+3
-3
app/controllers/projects/pipelines_controller.rb
app/controllers/projects/pipelines_controller.rb
+6
-6
changelogs/unreleased/sh-fix-ref-name-caching.yml
changelogs/unreleased/sh-fix-ref-name-caching.yml
+5
-0
spec/controllers/projects/merge_requests_controller_spec.rb
spec/controllers/projects/merge_requests_controller_spec.rb
+2
-0
spec/controllers/projects/pipelines_controller_spec.rb
spec/controllers/projects/pipelines_controller_spec.rb
+2
-0
No files found.
app/controllers/projects/application_controller.rb
View file @
d8c7d25a
...
...
@@ -88,4 +88,10 @@ 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/projects/merge_requests_controller.rb
View file @
d8c7d25a
...
...
@@ -16,6 +16,8 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
before_action
:authenticate_user!
,
only:
[
:assign_related_issues
]
before_action
:check_user_can_push_to_source_branch!
,
only:
[
:rebase
]
around_action
:allow_gitaly_ref_name_caching
,
only:
[
:index
,
:show
]
def
index
@merge_requests
=
@issuables
...
...
@@ -315,10 +317,8 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
end
def
serializer
::
Gitlab
::
GitalyClient
.
allow_ref_name_caching
do
MergeRequestSerializer
.
new
(
current_user:
current_user
,
project:
merge_request
.
project
)
end
end
def
define_edit_vars
@source_project
=
@merge_request
.
source_project
...
...
app/controllers/projects/pipelines_controller.rb
View file @
d8c7d25a
...
...
@@ -8,6 +8,8 @@ class Projects::PipelinesController < Projects::ApplicationController
before_action
:authorize_create_pipeline!
,
only:
[
:new
,
:create
]
before_action
:authorize_update_pipeline!
,
only:
[
:retry
,
:cancel
]
around_action
:allow_gitaly_ref_name_caching
,
only:
[
:index
,
:show
]
wrap_parameters
Ci
::
Pipeline
POLLING_INTERVAL
=
10_000
...
...
@@ -148,13 +150,11 @@ class Projects::PipelinesController < Projects::ApplicationController
private
def
serialize_pipelines
::
Gitlab
::
GitalyClient
.
allow_ref_name_caching
do
PipelineSerializer
.
new
(
project:
@project
,
current_user:
@current_user
)
.
with_pagination
(
request
,
response
)
.
represent
(
@pipelines
,
disable_coverage:
true
,
preload:
true
)
end
end
def
render_show
respond_to
do
|
format
|
...
...
changelogs/unreleased/sh-fix-ref-name-caching.yml
0 → 100644
View file @
d8c7d25a
---
title
:
Fix and expand Gitaly FindCommit caching
merge_request
:
27018
author
:
type
:
performance
spec/controllers/projects/merge_requests_controller_spec.rb
View file @
d8c7d25a
...
...
@@ -60,6 +60,8 @@ describe Projects::MergeRequestsController do
end
it
"renders merge request page"
do
expect
(
::
Gitlab
::
GitalyClient
).
to
receive
(
:allow_ref_name_caching
).
and_call_original
go
(
format: :html
)
expect
(
response
).
to
be_success
...
...
spec/controllers/projects/pipelines_controller_spec.rb
View file @
d8c7d25a
...
...
@@ -97,6 +97,8 @@ describe Projects::PipelinesController do
RequestStore
.
clear!
RequestStore
.
begin!
expect
(
::
Gitlab
::
GitalyClient
).
to
receive
(
:allow_ref_name_caching
).
and_call_original
expect
{
get_pipelines_index_json
}
.
to
change
{
Gitlab
::
GitalyClient
.
get_request_count
}.
by
(
2
)
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