summaryrefslogtreecommitdiff
path: root/lib/api/issues.rb
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2019-08-17 15:39:39 -0700
committerStan Hu <stanhu@gmail.com>2019-08-17 20:35:37 -0700
commitba7c501fef5976ea7a1cc4212e84742246fed781 (patch)
tree1386ef44b4e8daa361c0a4944ba560e3bdafc9f5 /lib/api/issues.rb
parent1068483f7260e5866c7d54f1f09b716dbf463c80 (diff)
downloadgitlab-ce-ba7c501fef5976ea7a1cc4212e84742246fed781.tar.gz
Fix Gitaly N+1 calls with listing issues/MRs via APIsh-fix-issues-api-gitaly-nplusone
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 'lib/api/issues.rb')
-rw-r--r--lib/api/issues.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/api/issues.rb b/lib/api/issues.rb
index d687acf3423..7819c2de515 100644
--- a/lib/api/issues.rb
+++ b/lib/api/issues.rb
@@ -96,7 +96,8 @@ module API
with: Entities::Issue,
with_labels_details: declared_params[:with_labels_details],
current_user: current_user,
- issuable_metadata: issuable_meta_data(issues, 'Issue', current_user)
+ issuable_metadata: issuable_meta_data(issues, 'Issue', current_user),
+ include_subscribed: false
}
present issues, options
@@ -122,7 +123,8 @@ module API
with: Entities::Issue,
with_labels_details: declared_params[:with_labels_details],
current_user: current_user,
- issuable_metadata: issuable_meta_data(issues, 'Issue', current_user)
+ issuable_metadata: issuable_meta_data(issues, 'Issue', current_user),
+ include_subscribed: false
}
present issues, options