diff options
author | Douwe Maan <douwe@gitlab.com> | 2016-06-16 20:49:13 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2016-06-16 20:49:13 +0000 |
commit | 84632f0aff1d509a89bb09940e49d3f43d189c56 (patch) | |
tree | f20eee52ea60aacba1d487ba05f4f3d571721fb2 /spec/services | |
parent | 0de44624684c2c9dc63dfce4f37072506d10a14d (diff) | |
parent | 19a290e7bfcb5e74a0e9975fd3f7396ca0e2e990 (diff) | |
download | gitlab-ce-84632f0aff1d509a89bb09940e49d3f43d189c56.tar.gz |
Merge branch 'banzai-issue-filter-queries' into 'master'
Reduce SQL query counts in IssueReferenceFilter
## What does this MR do?
This MR adds a preparation phase for reference filters that allows them to prepare/create data structures used while iterating over HTML nodes. In this particular case the preparation phase is used for issue references to greatly cut down the amount of queries executed to get projects/issues for Markdown references.
## Are there points in the code the reviewer needs to double check?
No.
## Why was this MR needed?
Rendering Markdown containing issue references would run at most two queries for every issue reference: one to get the project and one to get the issue from said project. When rendering Markdown with lots of issue references this would result in _a lot_ of queries being executed.
## What are the relevant issue numbers?
#18042
See merge request !4410
Diffstat (limited to 'spec/services')
-rw-r--r-- | spec/services/git_push_service_spec.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/spec/services/git_push_service_spec.rb b/spec/services/git_push_service_spec.rb index 18692f1279a..f99ad046f0d 100644 --- a/spec/services/git_push_service_spec.rb +++ b/spec/services/git_push_service_spec.rb @@ -312,7 +312,8 @@ describe GitPushService, services: true do end it "doesn't close issues when external issue tracker is in use" do - allow(project).to receive(:default_issues_tracker?).and_return(false) + allow_any_instance_of(Project).to receive(:default_issues_tracker?). + and_return(false) # The push still shouldn't create cross-reference notes. expect do |