summaryrefslogtreecommitdiff
path: root/spec/support/reference_parser_helpers.rb
Commit message (Collapse)AuthorAgeFilesLines
* Move spec helpers/matchers/shared examples/contexts to their relevant folderRémy Coutable2018-04-231-39/+0
| | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* Support Markdown rendering using multiple projectsrendering-markdown-multiple-projectsYorick Peterse2018-04-111-2/+6
| | | | | | | | | | | | | | | | | | | This refactors the Markdown pipeline so it supports the rendering of multiple documents that may belong to different projects. An example of where this happens is when displaying the event feed of a group. In this case we retrieve events for all projects in the group. Previously we would group events per project and render these chunks separately, but this would result in many SQL queries being executed. By extending the Markdown pipeline to support this out of the box we can drastically reduce the number of SQL queries. To achieve this we introduce a new object to the pipeline: Banzai::RenderContext. This object simply wraps two other objects: an optional Project instance, and an optional User instance. On its own this wouldn't be very helpful, but a RenderContext can also be used to associate HTML documents with specific Project instances. This work is done in Banzai::ObjectRenderer and allows us to reuse as many queries (and results) as possible.
* Fix N+1 in MergeRequestParserSean McGivern2018-04-051-0/+30
| | | | | | | | read_project can be prevented by a very expensive condition, which we want to avoid, while still not writing manual SQL queries. read_project_for_iids is used by read_issue_iid and read_merge_request_iid to satisfy both of those constraints, and allow the declarative policy runner to use its normal caching strategy.
* Split Markdown rendering & reference gatheringYorick Peterse2016-05-261-0/+5
This splits the Markdown rendering and reference extraction phases into two distinct code bases. The reference extraction phase no longer relies on the html-pipeline Gem (and any related code) and allows for extracting of references from multiple HTML nodes in a single pass. This means that if you want to extract user references from 200 comments you no longer need to run 200 times N number of queries, instead only a handful of queries may be needed.