Formalize what we support for references to external issues [meta]
External issue reference pattern
External issue reference pattern is never formally specified in our documentation. From the code perspective we have:
-
https://gitlab.com/gitlab-org/gitlab-ce/blob/78ee24ba53a4a44d829613495ec0d5f1bbb5a9ee/app/models/project_services/issue_tracker_service.rb#L9 - for Redmine, Bugzilla and custom issue tracker integrations. This regex also allows references such as
#123
. - https://gitlab.com/gitlab-org/gitlab-ce/blob/78ee24ba53a4a44d829613495ec0d5f1bbb5a9ee/app/models/project_services/jira_service.rb#L22 - for JIRA
I found some evidence that #123
format is expected by the users. See https://gitlab.com/gitlab-org/gitlab-ce/issues/18827#note_12568147 where a user expresses a concern that this feature is now broken and we commit to fixing it (which we did).
Referencing internal issues in other projects from projects with external issue tracker enabled
Internal issues in other projects can still be referenced when a project has an external issue tracker, for example from merge request comments. This should just work (TM). But it doesn't:
- https://gitlab.com/gitlab-org/gitlab-ce/issues/33679 [confidential]
- https://gitlab.com/gitlab-org/gitlab-ce/issues/34076
- gitlab-foss#34446 (moved)
Referencing external issues in other projects
I didn't find any mention of this in the documentation, nor any explicit trace in the codebase. In fact, for JIRA integration we don't even know how such a reference should look like. If a reference to a current project is DEVOPS-3
then the reference to another project should be namespace/project-nameDEVOPS-3
. As you can see we are clearly missing a separator here.
That said, it is possible if we use #1234
format (discussed in the "External issue reference pattern" section), for example for Redmine. This partially works, see https://gitlab.com/gitlab-org/gitlab-ce/issues/34082. However, this may be a totally accidental feature.
Technical debt
We have Banzai::Filter::IssueReferenceFilter
and Banzai::Filter::ExternalIssueReferenceFilter
. Banzai::Filter::IssueReferenceFilter
is responsible both for managing references to internal issues and references to external issues. The role of Banzai::Filter::ExternalIssueReferenceFilter
is unclear to me, there is a chance that it's never used currently. I consider this as a technical debt and main source of bugs in this area from the code perspective.
Relevant bits of documentation
Feel free to add more!
- https://docs.gitlab.com/ce/user/markdown.html#special-gitlab-references
- https://docs.gitlab.com/ce/user/project/issues/crosslinking_issues.html
- https://docs.gitlab.com/ce/user/project/integrations/redmine.html
- https://docs.gitlab.com/ce/user/project/integrations/jira.html
- https://docs.gitlab.com/ce/user/project/integrations/bugzilla.html
- https://docs.gitlab.com/ce/integration/external-issue-tracker.html