Add "merge_request_iid" placeholder to markdown_placeholders feature

What does this MR do and why?

Adds a merge_request_iid placeholder to the markdown_placeholders feature.

Some web apps, like an external code review tool, might have URLs that are the same as the GitLab merge request but with the hostname swapped out.

For example, https://gitlab.com/gitlab-org/gitlab/-/merge_requests/123 would become https://example.com/gitlab-org/gitlab/-/merge_requests/1.

Surfacing that in a merge request template, as opposed to using a CI job with a service account to change the description or post a comment, is only missing one thing - the merge request ID!

References

Related to #14389

Screenshots or screen recordings

  1. Whilst editing

image

  1. Whilst previewing (no MR context to use yet)

image

  1. When saved

image

How to set up and validate locally

  1. Enable the markdown_placeholders feature flag.
  2. Visit http://127.0.0.1:3001/gitlab-org/gitlab-test/-/merge_requests/1
  3. Edit the merge request description to include this line: https://%{gitlab_server}/%{project_path}/-/merge_requests/%{merge_request_iid}.
  4. Previewing the change should keep the %{merge_request_iid} placeholder but replace %{gitlab_server} and %{project_path}.
  5. Saving the change should show you a new description of https://127.0.0.1/gitlab-org/gitlab-test/-/merge_requests/1.

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.

Merge request reports

Loading