Currently, we merge PRs in pingcap/tidb by ti-chi-bot with empty commit message, and merge PRs in tikv/tikv by ti-chi-bot with simply squash all intermediate messages. Both are less than awesome since we lost all information or mess up every information (with noise).
I’m thinking of a progress to populate fruitful commit message during the merging stage, but still without a complete idea. I post this topic here to see whether we have existing best practice to do so.
Roughly, maybe we can enrich the /merge command to check and fulfill the commit message with pre-defined template. Another thought is let committers merge manually and populate the commit message manually, but it seems hard to archive since our contributors somewhat get used to automation.
@tison Maybe we should explain what information is needed and why it is needed?
From the current implementation, when we commented on /merge, the commit message has not yet been determined. Finally, the commit obtained by merging PR through squash is configured by the tide component.
merge_commit_template : A mapping from org/repo or org to a set of Go templates to use when creating the title and body of merge commits. Go templates are evaluated with a PullRequest (see PullRequest type). This field and map keys are optional.
If what we need is an issue number, we can populate the issue number on the PR title manually, the robot directly uses the pr title as the commit message title.
If we need more information, we should fill in the information in the PR body, and the robot will directly use the PR body as the commit message body.
If the PR has no issue associated with it, we can add the issue-number-none label (by /label issue-number-none command) to remind the bot or CI to skip the issue number check. (Reference from the python community: https://github.com/python/cpython/pull/28228).
When bots merge PR, it will combine PR title and PR number as the commit message title, use PR body directly as commit message body, for example: