Prevent unnecessary Gitaly calls when rendering comment excerpts
What does this MR do?
Defers post-processing of Markdown to after we truncate the HTML
This should make post-processing a little bit faster and saves us some unnecessary Gitaly calls
Testing locally
-
Create a comment that mentions yourself (so it creates a todo) and has a link to a repo file on the 2nd line.
For example:
@root Hello world! [Test](.gitignore)
-
Open the todos page and you should see that the note rendered looks like:
@root Hello world!...
Before this MR, you can see in the performance bar that Gitaly calls are made even though there is no repo link here. With the changes in this MR, you should see that there are no more Gitaly calls.
Screenshots
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team