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
- Whilst editing
- Whilst previewing (no MR context to use yet)
- When saved
How to set up and validate locally
- Enable the
markdown_placeholdersfeature flag. - Visit http://127.0.0.1:3001/gitlab-org/gitlab-test/-/merge_requests/1
- Edit the merge request description to include this line:
https://%{gitlab_server}/%{project_path}/-/merge_requests/%{merge_request_iid}. - Previewing the change should keep the
%{merge_request_iid}placeholder but replace%{gitlab_server}and%{project_path}. - 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.


