[go: up one dir, main page]

Skip to content

Fix gfm reference for namespaces with the same path

What does this MR do and why?

Fix gfm reference for namespaces with the same path

When we create a system note reference when an issue gets mentioned in an epic, we created a relative reference, like "mentioned in gitlab#X".

However, when the group and the issue have the same namespace path name, it was an ambigious reference because the reference parser is looking first to resolve namespace paths within the current parent namespace.

In the example above, when there is a group and a project called gitlab, we'd create the system note on the gitlab project with mentioned in gitlab#X. When looking up a namespace with the name gitlab in the parent group of the issue, we'd find the group and would reference some issue that has the IID 123.

This is not correct, since we wanted to reference the group level issue/work item.

By generating an absolute reference in the case above mentioned in /gitlab#X we remove the ambiguity as the reference parser can find the correct group work item.

Changelog: fixed EE: true

References

Screenshots or screen recordings

Before After
before_same_path after_same_path

How to set up and validate locally

  1. Create a group and project that have the same name, e.g. Group: gitlab, and project gitlab
  2. Create an epic in the group
  3. Create an issue in the group
  4. Mention the issue in the epic with #:iid
  5. Go to the mentioned issue, and check the system note that includes the mention
  6. Before: It doesn't link to the epic but the issue again
  7. After: It links to the epic

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Nicolas Dular

Merge request reports

Loading