diff options
author | Stan Hu <stanhu@gmail.com> | 2019-08-18 01:39:39 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-08-18 06:35:37 +0300 |
commit | ba7c501fef5976ea7a1cc4212e84742246fed781 (patch) | |
tree | 1386ef44b4e8daa361c0a4944ba560e3bdafc9f5 /spec/requests/api/issues/get_project_issues_spec.rb | |
parent | 1068483f7260e5866c7d54f1f09b716dbf463c80 (diff) |
Fix Gitaly N+1 calls with listing issues/MRs via API
In GitLab 9.0,
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/9661 removed the
`subscribed` flag from the API when the user requested a list of issues
or merge requests since calculating this value triggers extensive
Markdown processing.
In GitLab 12.0 via a4fbf39e, we accidentally reintroduced this
performance regression by changing `IssueBasic` to `Issue` in
`entities.rb`. This showed up as a Gitaly N+1 issue since the Markdown
processing would attempt to extract a commit if it detected a regex that
matched a commit.
We restore the prior behavior by once again removing the `subscribed`
flag for the bulk list of issues and merge requests and add a test to
ensure they aren't reintroduced.
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/66202
Diffstat (limited to 'spec/requests/api/issues/get_project_issues_spec.rb')
-rw-r--r-- | spec/requests/api/issues/get_project_issues_spec.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/spec/requests/api/issues/get_project_issues_spec.rb b/spec/requests/api/issues/get_project_issues_spec.rb index f7ca6fd1e0a..521d6b88734 100644 --- a/spec/requests/api/issues/get_project_issues_spec.rb +++ b/spec/requests/api/issues/get_project_issues_spec.rb @@ -575,6 +575,7 @@ describe API::Issues do expect(json_response['assignee']).to be_a Hash expect(json_response['author']).to be_a Hash expect(json_response['confidential']).to be_falsy + expect(json_response['subscribed']).to be_truthy end it 'exposes the closed_at attribute' do |