Commit b2cdc30f authored by Robert May's avatar Robert May

Enable caching on merge requests API

Changelog: performance
parent f536b8cd
---
name: api_caching_merge_requests
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/61067
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/330342
milestone: '13.12'
type: development
group: group::source code
default_enabled: false
......@@ -207,11 +207,7 @@ module API
options = serializer_options_for(merge_requests).merge(project: user_project)
options[:project] = user_project
if Feature.enabled?(:api_caching_merge_requests, user_project, type: :development, default_enabled: :yaml)
present_cached merge_requests, expires_in: 2.days, **options
else
present merge_requests, options
end
present_cached merge_requests, expires_in: 2.days, **options
end
desc 'Create a merge request' do
......
......@@ -1005,14 +1005,6 @@ RSpec.describe API::MergeRequests do
it_behaves_like 'merge requests list'
context 'when :api_caching_merge_requests is disabled' do
before do
stub_feature_flags(api_caching_merge_requests: false)
end
it_behaves_like 'merge requests list'
end
it "returns 404 for non public projects" do
project = create(:project, :private)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment