summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/controllers/projects/merge_requests_controller.rb2
-rw-r--r--changelogs/unreleased/sh-enable-ref-name-caching-discussions.yml5
-rw-r--r--spec/controllers/projects/merge_requests_controller_spec.rb2
3 files changed, 8 insertions, 1 deletions
diff --git a/app/controllers/projects/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb
index 9e7e3ed5afb..2695f8a3192 100644
--- a/app/controllers/projects/merge_requests_controller.rb
+++ b/app/controllers/projects/merge_requests_controller.rb
@@ -16,7 +16,7 @@ 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]
+ around_action :allow_gitaly_ref_name_caching, only: [:index, :show, :discussions]
def index
@merge_requests = @issuables
diff --git a/changelogs/unreleased/sh-enable-ref-name-caching-discussions.yml b/changelogs/unreleased/sh-enable-ref-name-caching-discussions.yml
new file mode 100644
index 00000000000..12f4a5a499d
--- /dev/null
+++ b/changelogs/unreleased/sh-enable-ref-name-caching-discussions.yml
@@ -0,0 +1,5 @@
+---
+title: Enable Gitaly ref name caching for discussions.json
+merge_request: 29951
+author:
+type: performance
diff --git a/spec/controllers/projects/merge_requests_controller_spec.rb b/spec/controllers/projects/merge_requests_controller_spec.rb
index 34cbf0c8723..0eca663a683 100644
--- a/spec/controllers/projects/merge_requests_controller_spec.rb
+++ b/spec/controllers/projects/merge_requests_controller_spec.rb
@@ -1001,6 +1001,8 @@ describe Projects::MergeRequestsController do
before do
project.add_developer(user)
sign_in(user)
+
+ expect(::Gitlab::GitalyClient).to receive(:allow_ref_name_caching).and_call_original
end
it 'returns 200' do