Add local_reference (Merge Request ID) to commit template
What does this MR do and why?
This PR adds a %{local_reference}
Commit message templates variable that resolves to a simple merge request ID like !123
. Currently, %{reference}
resolves to the full MR reference like path/to/group/project!123
.
I'd like to reference IDs in the commit name like GitHub does by default with squash merges (commit message (#PR-ID)
).
Solves #199823
TODO
-
Add tests to https://gitlab.com/gitlab-org/gitlab/-/blob/master/spec/lib/gitlab/merge_requests/message_generator_spec.rb -
[Help wanted] Settle on a name for this variable. local_reference
may not be ideal. Here's a list of possible options I found:-
local_reference
(currently implemented) short_reference
id
mr_id
-
-
[Help wanted] Update the documentation to reflect the right introduction version.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Merge request reports
Activity
Hey @zadkiel!
Welcome to our community! We're excited to have you here, and can't wait to review this first MR with you!
Thank you for your contribution to GitLab. Please refer to the contribution flow documentation for a quick overview of the process, and the merge request (MR) guidelines for the detailed process.
Did you know about our community forks? Working from there will make your contribution process easier. Please check it out!
When you're ready for a first review, post
@gitlab-bot ready
. If you know a relevant reviewer(s) (for example, someone that was involved in a related issue), you can also assign them directly with@gitlab-bot ready @user1 @user2
.At any time, if you need help, feel free to post
@gitlab-bot help
or initiate a mentor session on Discord. Read more on how to get help.This message was generated automatically. You're welcome to improve it.
added Community contribution workflowin dev labels
assigned to @zadkiel
added docs-only label
removed docs-only label
added 1st contribution label
added linked-issue label
- Resolved by Zadkiel
mentioned in issue #199823
GitLab has made changes to its merge request feature, allowing users to reference merge requests using a local reference or merge request ID. This new feature has been added to the commit message template, making it easier for developers to reference merge requests in their commit messages. Additionally, GitLab has added other variables to the template to improve the user experience.
(AI-generated summary for revision 0c601d87)
added 3 commits
-
61909e65...664e37d3 - 2 commits from branch
gitlab-org:master
- 381e1e25 - Merge branch gitlab:master into zadkiel-master-patch-48442
-
61909e65...664e37d3 - 2 commits from branch