Add co_authored_by to merge commit templates
What does this MR do and why?
This merge requests add support for %{co_authored_by}
variable in a merge commit templates. This solves #20421 (closed).
Variable expands to list of commit authors in a form:
Co-authored-by: Zane Doe <zdoe@example.com>
Co-authored-by: Alex Garcia <agarcia@example.com>
This format is often used by various tools to add more authors to a single commit, and would be most useful in a squash commit template. The format is already somewhat supported by gitlab, as the user mentioned that way is linked to in a commit view (see screenshots section).
A lot of complexity was added by the fact that the main commit author shouldn't be mentioned as a co-author. For merge commit, that means we should skip merging user (for non-merged MR we assume currently logged in user), while for squash commit we should skip MR author. We could simplify things a bit and future-proof this if we decided to ignore that and always include commit author as a co-author as well, so let me know if you'd rather have the simpler, but a bit less user-friendly version.
Screenshots or screen recordings
Docs:
The format is already somewhat supported by gitlab, as the user mentioned that way is linked to (it would just be a mailto link if no account would be tied to given email address):
How to set up and validate locally
- Go to any project -> settings -> general.
- Expand Merge Requests section.
- Fill in
Merge commit message template
orSquash commit message template
with new variable%{co_authored_by}
. - Commit a new branch with couple commits created by different authors (with different emails).
- Create a new MR from this branch.
- Check that the default message in MR widget renders co authors correctly.
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
Thank you for your contribution to GitLab. We believe that everyone can contribute and contributions like yours are what make GitLab great!
- Our Merge Request Coaches will ensure your contribution is reviewed in a timely manner*.
- If you haven't, please set up a
DANGER_GITLAB_API_TOKEN
. - You can comment
@gitlab-bot label ~"group::"
to add a group label. - After a few days, feel free to ask
@gitlab-bot help
or ping a Merge Request Coach. - Read more on how to get help.
This message was generated automatically. You're welcome to improve it.
added Community contribution label
added Hackathon label
1 Message This merge request adds or changes documentation files. A review from the Technical Writing team before you merge is recommended. Reviews can happen after you merge. Documentation review
The following files require a review from a technical writer:
doc/user/project/merge_requests/commit_templates.md
The review does not need to block merging this merge request. See the:
-
Metadata for the
*.md
files that you've changed. The first few lines of each*.md
file identify the stage and group most closely associated with your docs change. - The Technical Writer assigned for that stage and group.
- Documentation workflows for information on when to assign a merge request for review.
Reviewer roulette
Changes that require review have been detected!
Please refer to the table below for assigning reviewers and maintainers suggested by Danger in the specified category:
Category Reviewer Maintainer backend Reuben Pereira ( @rpereira2
) (UTC+5.5)Mark Chao ( @lulalala
) (UTC+8)UX Austin Regnery ( @aregnery
) (UTC-5)No maintainer available To spread load more evenly across eligible reviewers, Danger has picked a candidate for each review slot, based on their timezone. Feel free to override these selections if you think someone else would be better-suited or use the GitLab Review Workload Dashboard to find other available reviewers.
To read more on how to use the reviewer roulette, please take a look at the Engineering workflow and code review guidelines. Please consider assigning a reviewer or maintainer who is a domain expert in the area of the merge request.
Once you've decided who will review this merge request, assign them as a reviewer! Danger does not automatically notify them for you.
If needed, you can retry the
danger-review
job that generated this comment.Generated by
Dangeradded 1 commit
- bd0396d4 - Add merged_by and co_authors to merge commit templates
mentioned in merge request !75639 (merged)
mentioned in issue #20421 (closed)
added UX label
- Resolved by Marcel van Remmerden
@mvanremmerden I'm adding a UX label here as it feel to me that this is a user facing change. Please take a second look.
requested review from @pedroms
added devopscreate groupcode review sectiondev labels
- Resolved by Piotr Stankowski
- Resolved by Piotr Stankowski
mentioned in issue gitlab-org/quality/triage-reports#5563 (closed)
@trakos thanks for this great contribution!
I left a comment in !75639 (comment 760671957) that is also applicable to this MR.FYI regarding the dependency of this MR with !75639 (merged), I marked that other MR as blocking this one:
removed review request for @pedroms
assigned to @trakos
- Resolved by Pedro Moreira da Silva
added 2749 commits
-
bd0396d4...23b81f0a - 2748 commits from branch
gitlab-org:master
- 29f20b98 - Add co_authored_by to merge commit templates
-
bd0396d4...23b81f0a - 2748 commits from branch
- Resolved by Amy Qualls
- Resolved by Piotr Stankowski
- Resolved by Piotr Stankowski
- Resolved by Douglas Barbosa Alexandre
@pedroms
, thanks for approving this merge request.This is the first time the merge request is approved. To ensure full test coverage, please start a new pipeline before merging.
For more info, please refer to the following links:
- Resolved by Amy Qualls
Hi
@eread
@aqualls, please review this documentation Merge Request.Edited by Amy Qualls
marked the checklist item I have evaluated the MR acceptance checklist for this MR. as completed
added documentation twtriaged labels
requested review from @aqualls
- Resolved by Amy Qualls
question (non-blocking): is it time to stop listing all the options?
As we keep adding more substitution options, should we stop listing them below the text area, and instead link out to the docs, like we do for markdown and quick actions?
added Technical Writing UI text docsfeature tw-weight3 twfinished typefeature labels and removed twtriaged label
- Resolved by Douglas Barbosa Alexandre
@trakos I've left you a question, but it's non-blocking. The docs are fine. I'll approve and unassign myself. Adding @alexbuijs now.
changed milestone to %14.7
requested review from @alexbuijs and removed review request for @aqualls
added 1 commit
- 738e778b - Add co_authored_by to merge commit templates
added 1 commit
- 143e577c - Add co_authored_by to merge commit templates
- Resolved by Piotr Stankowski
mentioned in issue #349193 (closed)
- Resolved by Douglas Barbosa Alexandre
requested review from @dbalexandre and removed review request for @alexbuijs
mentioned in merge request !77350 (merged)
enabled an automatic merge when the pipeline for 8a1cfb7b succeeds
@trakos Thanks for your contribution
This LGTM. I triggered a new pipeline and set MWPS.- A deleted user
added backend label
Hi @trakos,
We would love to know how you found your code review experience in this merge request! Please leave a
or a on this comment to describe your experience.Once done, please comment
@gitlab-bot feedback
below and feel free to leave any additional feedback you have in the same comment.Thanks for your help!
mentioned in commit 316fbdcb
added workflowstaging-canary label
added workflowstaging label and removed workflowstaging-canary label
added workflowcanary label and removed workflowstaging label
added workflowproduction label and removed workflowcanary label
mentioned in merge request !77758 (merged)
added releasedcandidate label
added releasedpublished label and removed releasedcandidate label
mentioned in merge request kubitus-project/kubitus-installer!562 (merged)
added linked-issue label
added pipeline:mr-approved label