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
00bb7a8b
Commit
00bb7a8b
authored
Apr 07, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
737280e4
33316f7f
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
18 additions
and
4 deletions
+18
-4
app/controllers/projects/blob_controller.rb
app/controllers/projects/blob_controller.rb
+2
-0
app/controllers/projects/commits_controller.rb
app/controllers/projects/commits_controller.rb
+1
-2
app/controllers/projects/refs_controller.rb
app/controllers/projects/refs_controller.rb
+2
-0
app/controllers/projects_controller.rb
app/controllers/projects_controller.rb
+2
-2
changelogs/unreleased/sh-improve-find-commit-caching.yml
changelogs/unreleased/sh-improve-find-commit-caching.yml
+5
-0
spec/controllers/projects/blob_controller_spec.rb
spec/controllers/projects/blob_controller_spec.rb
+2
-0
spec/controllers/projects/refs_controller_spec.rb
spec/controllers/projects/refs_controller_spec.rb
+4
-0
No files found.
app/controllers/projects/blob_controller.rb
View file @
00bb7a8b
...
@@ -9,6 +9,8 @@ class Projects::BlobController < Projects::ApplicationController
...
@@ -9,6 +9,8 @@ class Projects::BlobController < Projects::ApplicationController
include
ActionView
::
Helpers
::
SanitizeHelper
include
ActionView
::
Helpers
::
SanitizeHelper
prepend_before_action
:authenticate_user!
,
only:
[
:edit
]
prepend_before_action
:authenticate_user!
,
only:
[
:edit
]
around_action
:allow_gitaly_ref_name_caching
,
only:
[
:show
]
before_action
:require_non_empty_project
,
except:
[
:new
,
:create
]
before_action
:require_non_empty_project
,
except:
[
:new
,
:create
]
before_action
:authorize_download_code!
before_action
:authorize_download_code!
...
...
app/controllers/projects/commits_controller.rb
View file @
00bb7a8b
...
@@ -7,6 +7,7 @@ class Projects::CommitsController < Projects::ApplicationController
...
@@ -7,6 +7,7 @@ class Projects::CommitsController < Projects::ApplicationController
include
RendersCommits
include
RendersCommits
prepend_before_action
(
only:
[
:show
])
{
authenticate_sessionless_user!
(
:rss
)
}
prepend_before_action
(
only:
[
:show
])
{
authenticate_sessionless_user!
(
:rss
)
}
around_action
:allow_gitaly_ref_name_caching
before_action
:whitelist_query_limiting
,
except: :commits_root
before_action
:whitelist_query_limiting
,
except: :commits_root
before_action
:require_non_empty_project
before_action
:require_non_empty_project
before_action
:assign_ref_vars
,
except: :commits_root
before_action
:assign_ref_vars
,
except: :commits_root
...
@@ -14,8 +15,6 @@ class Projects::CommitsController < Projects::ApplicationController
...
@@ -14,8 +15,6 @@ class Projects::CommitsController < Projects::ApplicationController
before_action
:validate_ref!
,
except: :commits_root
before_action
:validate_ref!
,
except: :commits_root
before_action
:set_commits
,
except: :commits_root
before_action
:set_commits
,
except: :commits_root
around_action
:allow_gitaly_ref_name_caching
def
commits_root
def
commits_root
redirect_to
project_commits_path
(
@project
,
@project
.
default_branch
)
redirect_to
project_commits_path
(
@project
,
@project
.
default_branch
)
end
end
...
...
app/controllers/projects/refs_controller.rb
View file @
00bb7a8b
...
@@ -4,6 +4,8 @@ class Projects::RefsController < Projects::ApplicationController
...
@@ -4,6 +4,8 @@ class Projects::RefsController < Projects::ApplicationController
include
ExtractsPath
include
ExtractsPath
include
TreeHelper
include
TreeHelper
around_action
:allow_gitaly_ref_name_caching
,
only:
[
:logs_tree
]
before_action
:require_non_empty_project
before_action
:require_non_empty_project
before_action
:validate_ref_id
before_action
:validate_ref_id
before_action
:assign_ref_vars
before_action
:assign_ref_vars
...
...
app/controllers/projects_controller.rb
View file @
00bb7a8b
...
@@ -10,6 +10,8 @@ class ProjectsController < Projects::ApplicationController
...
@@ -10,6 +10,8 @@ class ProjectsController < Projects::ApplicationController
prepend_before_action
(
only:
[
:show
])
{
authenticate_sessionless_user!
(
:rss
)
}
prepend_before_action
(
only:
[
:show
])
{
authenticate_sessionless_user!
(
:rss
)
}
around_action
:allow_gitaly_ref_name_caching
,
only:
[
:index
,
:show
]
before_action
:whitelist_query_limiting
,
only:
[
:create
]
before_action
:whitelist_query_limiting
,
only:
[
:create
]
before_action
:authenticate_user!
,
except:
[
:index
,
:show
,
:activity
,
:refs
,
:resolve
]
before_action
:authenticate_user!
,
except:
[
:index
,
:show
,
:activity
,
:refs
,
:resolve
]
before_action
:redirect_git_extension
,
only:
[
:show
]
before_action
:redirect_git_extension
,
only:
[
:show
]
...
@@ -26,8 +28,6 @@ class ProjectsController < Projects::ApplicationController
...
@@ -26,8 +28,6 @@ class ProjectsController < Projects::ApplicationController
before_action
:authorize_admin_project!
,
only:
[
:edit
,
:update
,
:housekeeping
,
:download_export
,
:export
,
:remove_export
,
:generate_new_export
]
before_action
:authorize_admin_project!
,
only:
[
:edit
,
:update
,
:housekeeping
,
:download_export
,
:export
,
:remove_export
,
:generate_new_export
]
before_action
:event_filter
,
only:
[
:show
,
:activity
]
before_action
:event_filter
,
only:
[
:show
,
:activity
]
around_action
:allow_gitaly_ref_name_caching
,
only:
[
:index
,
:show
]
layout
:determine_layout
layout
:determine_layout
def
index
def
index
...
...
changelogs/unreleased/sh-improve-find-commit-caching.yml
0 → 100644
View file @
00bb7a8b
---
title
:
Expand FindCommit caching to blob and refs
merge_request
:
27084
author
:
type
:
performance
spec/controllers/projects/blob_controller_spec.rb
View file @
00bb7a8b
...
@@ -10,6 +10,8 @@ describe Projects::BlobController do
...
@@ -10,6 +10,8 @@ describe Projects::BlobController do
context
'with file path'
do
context
'with file path'
do
before
do
before
do
expect
(
::
Gitlab
::
GitalyClient
).
to
receive
(
:allow_ref_name_caching
).
and_call_original
get
(
:show
,
get
(
:show
,
params:
{
params:
{
namespace_id:
project
.
namespace
,
namespace_id:
project
.
namespace
,
...
...
spec/controllers/projects/refs_controller_spec.rb
View file @
00bb7a8b
...
@@ -44,11 +44,15 @@ describe Projects::RefsController do
...
@@ -44,11 +44,15 @@ describe Projects::RefsController do
end
end
it
'renders JS'
do
it
'renders JS'
do
expect
(
::
Gitlab
::
GitalyClient
).
to
receive
(
:allow_ref_name_caching
).
and_call_original
xhr_get
(
:js
)
xhr_get
(
:js
)
expect
(
response
).
to
be_success
expect
(
response
).
to
be_success
end
end
it
'renders JSON'
do
it
'renders JSON'
do
expect
(
::
Gitlab
::
GitalyClient
).
to
receive
(
:allow_ref_name_caching
).
and_call_original
xhr_get
(
:json
)
xhr_get
(
:json
)
expect
(
response
).
to
be_success
expect
(
response
).
to
be_success
...
...
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