Skip to content

Add support for a user parent resource in GFM

Vijay Hawoldar requested to merge vij-personal-snippet-gfm-user into master

What does this MR do?

It was discovered that references or links to resources in comments or descriptions of PersonalSnippets, were not being converted properly by the GFM (docs). This is, in part, because the AbstractReferenceFilter (ARF) would skip those references due to the PersonalSnippet not belonging to a group or project.

This MR is the first part of addressing this issue, by adding a user to the context, along side project and group. In the case of snippets, this will be the author (other resources will have/use a project or group).

This way, the ARF can use that user object as the parent, and generate cross-reference links (e.g. gitlab-org/gitlab!1) when references or links to resources are added to the snippet description or comments.

There is a lot more context and information over in the issue this relates to, here: #217305 (closed)

This change will be hidden behind the feature flag :personal_snippet_reference_filters (off by default), so that we can prevent it from giving users an inconsistent experience. This means once the MR is merged, the references in PersonalSnippets will continue to not be processed until this flag is enabled for the user.

Before this MR: Screenshot_2020-08-06_at_12.15.42

After this MR: Screenshot_2020-08-06_at_12.15.47

Does this MR meet the acceptance criteria?


Availability and Testing

Edited by Vijay Hawoldar

Merge request reports