Skip to content

Provide {{reference}} placeholder or method

Background

In gitlab-org/quality/triage-ops#159 (closed) we want to use short reference to avoid angering spam detection, however we can't easily do so for now, because we might not know we're triaging against issues or merge requests. It'll be nice if we can use a placeholder or a method in lib/gitlab/triage/resource/shared/issuable.rb for this.

Proposal for placeholders

  • {{reference}} for #123 or !123 depending on the resource
  • {{full_reference}} for gitlab-org/gitlab-ce#123 so it works across projects

Proposal for methods

  • #{to_reference} for #123 or !123 depending on the resource
  • #{to_reference(full: true)} for gitlab-org/gitlab-ce#123
  • Bonus: make to_reference know where it's going to land, and use short version when it's the same project, and full version when it's not the same project. Use full to force it full or not.