Add support for a user parent resource in GFM
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.
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
- [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done