<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/gitlab/gitlab-ce.git/lib/banzai/reference_parser/issue_parser.rb, branch docs-processes</title>
<subtitle>gitlab.com: gitlab-org/gitlab-ce.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/'/>
<entry>
<title>Eager load project routes for issue references</title>
<updated>2018-05-28T11:38:20+00:00</updated>
<author>
<name>Yorick Peterse</name>
<email>yorickpeterse@gmail.com</email>
</author>
<published>2018-05-15T12:47:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=954968c684d12a58b265c9e3796faddc84edd400'/>
<id>954968c684d12a58b265c9e3796faddc84edd400</id>
<content type='text'>
This reduces the number of queries necessary when displaying the
activity page of a group.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reduces the number of queries necessary when displaying the
activity page of a group.
</pre>
</div>
</content>
</entry>
<entry>
<title>Support Markdown rendering using multiple projects</title>
<updated>2018-04-11T12:10:19+00:00</updated>
<author>
<name>Yorick Peterse</name>
<email>yorickpeterse@gmail.com</email>
</author>
<published>2018-04-03T13:45:17+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=daad7144ec7c0173439eeadd61590442e40a6051'/>
<id>daad7144ec7c0173439eeadd61590442e40a6051</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>Port `read_cross_project` ability from EE</title>
<updated>2018-02-22T16:11:36+00:00</updated>
<author>
<name>Bob Van Landuyt</name>
<email>bob@vanlanduyt.co</email>
</author>
<published>2017-12-11T14:21:06+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=148816cd67a314f17e79c107270cc708501bdd39'/>
<id>148816cd67a314f17e79c107270cc708501bdd39</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Refactor banzai to support referencing from group context</title>
<updated>2017-12-06T18:16:22+00:00</updated>
<author>
<name>Jarka Kadlecova</name>
<email>jarka@gitlab.com</email>
</author>
<published>2017-12-01T09:21:05+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=0c2fdb1c342fa5eb64bb0ed02091af3c06b37c0e'/>
<id>0c2fdb1c342fa5eb64bb0ed02091af3c06b37c0e</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Eliminate N+1 queries referencing issues</title>
<updated>2017-09-19T03:38:25+00:00</updated>
<author>
<name>Stan Hu</name>
<email>stanhu@gmail.com</email>
</author>
<published>2017-09-18T23:14:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=0a2f93aa6a791714fb35557f60b20a1a92682684'/>
<id>0a2f93aa6a791714fb35557f60b20a1a92682684</id>
<content type='text'>
To load issue 1, we see that in #38033 that about 835 ms of the
SQL queries were due to loading ProjectFeature. We should be
able to cut this down by eagerly loading this information.

Closes #38033
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
To load issue 1, we see that in #38033 that about 835 ms of the
SQL queries were due to loading ProjectFeature. We should be
able to cut this down by eagerly loading this information.

Closes #38033
</pre>
</div>
</content>
</entry>
<entry>
<title>Improve support for external issue references</title>
<updated>2017-06-30T12:47:53+00:00</updated>
<author>
<name>Adam Niedzielski</name>
<email>adamsunday@gmail.com</email>
</author>
<published>2017-06-30T12:47:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=9da3076944146444cb864d5db066a766c76b1935'/>
<id>9da3076944146444cb864d5db066a766c76b1935</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Enable Style/DotPosition Rubocop :cop:</title>
<updated>2017-06-21T13:48:12+00:00</updated>
<author>
<name>Grzegorz Bizon</name>
<email>grzegorz@gitlab.com</email>
</author>
<published>2017-06-21T13:48:12+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=0430b7644101fc70ed4be6bf69ccf05b900f4cdf'/>
<id>0430b7644101fc70ed4be6bf69ccf05b900f4cdf</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Backport of multiple_assignees_feature [ci skip]</title>
<updated>2017-05-04T14:11:53+00:00</updated>
<author>
<name>Valery Sizov</name>
<email>valery@gitlab.com</email>
</author>
<published>2017-05-04T12:11:15+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=387c4b2c21a44360386a9b8ce6849e7f1b8a3de9'/>
<id>387c4b2c21a44360386a9b8ce6849e7f1b8a3de9</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Add indication for closed or merged issuables in GFM</title>
<updated>2017-04-07T19:31:43+00:00</updated>
<author>
<name>Adam Buckland</name>
<email>adamjbuckland@gmail.com</email>
</author>
<published>2016-08-24T17:11:48+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=ace833b31dfac64a8b44242ce7d91c60285bf983'/>
<id>ace833b31dfac64a8b44242ce7d91c60285bf983</id>
<content type='text'>
Example: for issues that are closed, the links will now show '[closed]'
following the issue number. This is done as post-process after the markdown has
been loaded from the cache as the status of the issue may change between
the cache being populated and the content being displayed.

In order to avoid N+1 queries problem when rendering notes ObjectRenderer
populates the cache of referenced issuables for all notes at once,
before the post processing phase.

As a part of this change, the Banzai BaseParser#grouped_objects_for_nodes
method has been refactored to return a Hash utilising the node itself as the
key, since this was a common pattern of usage for this method.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Example: for issues that are closed, the links will now show '[closed]'
following the issue number. This is done as post-process after the markdown has
been loaded from the cache as the status of the issue may change between
the cache being populated and the content being displayed.

In order to avoid N+1 queries problem when rendering notes ObjectRenderer
populates the cache of referenced issuables for all notes at once,
before the post processing phase.

As a part of this change, the Banzai BaseParser#grouped_objects_for_nodes
method has been refactored to return a Hash utilising the node itself as the
key, since this was a common pattern of usage for this method.
</pre>
</div>
</content>
</entry>
<entry>
<title>Method for returning issues readable by a user</title>
<updated>2016-07-29T10:51:18+00:00</updated>
<author>
<name>Yorick Peterse</name>
<email>yorickpeterse@gmail.com</email>
</author>
<published>2016-07-20T18:13:02+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=002ad215818450d2cbbc5fa065850a953dc7ada8'/>
<id>002ad215818450d2cbbc5fa065850a953dc7ada8</id>
<content type='text'>
The method Ability.issues_readable_by_user takes a list of users and an
optional user and returns an Array of issues readable by said user. This
method in turn is used by
Banzai::ReferenceParser::IssueParser#nodes_visible_to_user so this
method no longer needs to get all the available abilities just to check
if a user has the "read_issue" ability.

To test this I benchmarked an issue with 222 comments on my development
environment. Using these changes the time spent in nodes_visible_to_user
was reduced from around 120 ms to around 40 ms.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The method Ability.issues_readable_by_user takes a list of users and an
optional user and returns an Array of issues readable by said user. This
method in turn is used by
Banzai::ReferenceParser::IssueParser#nodes_visible_to_user so this
method no longer needs to get all the available abilities just to check
if a user has the "read_issue" ability.

To test this I benchmarked an issue with 222 comments on my development
environment. Using these changes the time spent in nodes_visible_to_user
was reduced from around 120 ms to around 40 ms.
</pre>
</div>
</content>
</entry>
</feed>
