gitlab-org--gitlab-foss/spec/services
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
..
applications
auth
boards
chat_names
ci
clusters
deploy_keys
deploy_tokens
discussions
emails
events Support Markdown rendering using multiple projects 2018-04-11 14:10:19 +02:00
files
gpg_keys
groups
issuable
issues
keys
labels
lfs
members
merge_requests
milestones
notes Support Markdown rendering using multiple projects 2018-04-11 14:10:19 +02:00
projects
prometheus
protected_branches
protected_tags
quick_actions
search
tags
test_hooks
users
wiki_pages
access_token_validation_service_spec.rb
after_branch_delete_service_spec.rb
base_count_service_spec.rb
check_gcp_project_billing_service_spec.rb
cohorts_service_spec.rb
compare_service_spec.rb
create_branch_service_spec.rb
create_deployment_service_spec.rb
create_release_service_spec.rb
create_snippet_service_spec.rb
delete_branch_service_spec.rb
delete_merged_branches_service_spec.rb
event_create_service_spec.rb
git_push_service_spec.rb
git_tag_push_service_spec.rb
gravatar_service_spec.rb
import_export_clean_up_service_spec.rb
note_summary_spec.rb
notification_service_spec.rb
pages_service_spec.rb
preview_markdown_service_spec.rb
push_event_payload_service_spec.rb
repair_ldap_blocked_user_service_spec.rb
repository_archive_clean_up_service_spec.rb
reset_project_cache_service_spec.rb
search_service_spec.rb
spam_service_spec.rb
submit_usage_ping_service_spec.rb
system_hooks_service_spec.rb
system_note_service_spec.rb
todo_service_spec.rb
update_merge_request_metrics_service_spec.rb
update_release_service_spec.rb
update_snippet_service_spec.rb
upload_service_spec.rb
user_project_access_changed_service_spec.rb
verify_pages_domain_service_spec.rb
web_hook_service_spec.rb