gitlab-org--gitlab-foss/spec/lib/banzai
Yorick Peterse daad7144ec
Support Markdown rendering using multiple projects
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.
2018-04-11 14:10:19 +02:00
..
filter Merge branch '17939-osw-patch-support-gfm' into 'master' 2018-04-06 17:14:47 +00:00
pipeline
reference_parser Support Markdown rendering using multiple projects 2018-04-11 14:10:19 +02:00
color_parser_spec.rb Add Colors to GitLab Flavored Markdown 2018-01-29 17:39:19 +03:00
commit_renderer_spec.rb Support Markdown rendering using multiple projects 2018-04-11 14:10:19 +02:00
cross_project_reference_spec.rb Better group support notes-related code 2018-04-05 13:29:57 +02:00
filter_array_spec.rb
issuable_extractor_spec.rb Support Markdown rendering using multiple projects 2018-04-11 14:10:19 +02:00
object_renderer_spec.rb Support Markdown rendering using multiple projects 2018-04-11 14:10:19 +02:00
querying_spec.rb
redactor_spec.rb Support Markdown rendering using multiple projects 2018-04-11 14:10:19 +02:00
render_context_spec.rb Support Markdown rendering using multiple projects 2018-04-11 14:10:19 +02:00
renderer_spec.rb Resolve "DashboardController#activity.json is slow due to SQL" 2017-11-06 16:52:56 +00:00