Add %{issue_id} and %{issue_title} placeholders to MR title template
Summary
Extends the MR title template feature (!228477 (merged)) with two new placeholder variables:
%{issue_id}— the IID of the issue linked via the source branch name (for example,123from branch123-fix-bug)%{issue_title}— the title of that issue
This lets users configure templates like:
``` Resolve %{issue_id} "%{issue_title}" ```
Which produces: Resolve 123 "Fix the login bug" — a configurable version of the existing default title behavior when a branch name starts with an issue IID.
What does this MR do?
- Adds
issue_idandissue_titletoPLACEHOLDERSinMessageGenerator, accepting the issue as a 4th argument (consistent with the existingsquasharg pattern) - Updates all existing
PLACEHOLDERSlambdas to accept the 4th_arg for a consistent signature - Adds
issue: nilkeyword arg toMessageGenerator#new_mr_titleand threads it through toreplace_placeholders, following the same pattern assquash:insquash_commit_message BuildService#assign_title_from_templatepasses the already-memoizedissue(resolved from branch name viaIssuesFinder, respecting visibility) — no extra DB query- Adds
issue_idandissue_titletoALLOWED_NEW_MR_TITLE_PLACEHOLDERS - Adds specs to
MessageGeneratorandBuildService - Updates documentation
MR acceptance checklist
- I have evaluated the MR acceptance checklist for this MR.
References
- Part of #16080
- Extends !228477 (merged)
- Feedback: #16080 (comment 3293084165)
Edited by Marc Shaw