Commit 7a20e62e authored by Luke Duncalfe's avatar Luke Duncalfe

Enable API v3 `branches/:sha` partial response

https://gitlab.com/gitlab-org/gitlab/-/issues/344617
https://gitlab.com/gitlab-org/gitlab/-/issues/331326

Enabling the feature flag by default to enable protecting API v3
`commits/:sha` endpoint from causing frequent Gitaly timeouts.

It does this by returning a partial response without the commit diffs.

Changelog: performance
parent 3f51bfe0
...@@ -5,4 +5,4 @@ rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/344617 ...@@ -5,4 +5,4 @@ rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/344617
milestone: '14.5' milestone: '14.5'
type: development type: development
group: group::integrations group: group::integrations
default_enabled: false default_enabled: true
...@@ -101,7 +101,7 @@ module API ...@@ -101,7 +101,7 @@ module API
# of time after a Gitaly timeout, to mitigate frequent Gitaly timeouts # of time after a Gitaly timeout, to mitigate frequent Gitaly timeouts
# for some Commit diffs. # for some Commit diffs.
def diff_files(commit) def diff_files(commit)
return commit.diffs.diff_files unless Feature.enabled?(:api_v3_commits_skip_diff_files, commit.project) return commit.diffs.diff_files unless Feature.enabled?(:api_v3_commits_skip_diff_files, commit.project, default_enabled: :yaml)
cache_key = [ cache_key = [
GITALY_TIMEOUT_CACHE_KEY, GITALY_TIMEOUT_CACHE_KEY,
......
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