homu
homu copied to clipboard
Add owner/name prefix to PR number in “Auto merge of …”/“Rollup merge of …” message
Fixes #144
Disclaimer: I have no idea how to test this code to make sure it’s working properly and doing the right thing.
It's also worth noting this may break integrations such as:
- publish toolstate - https://github.com/rust-lang/rust/blob/master/src/tools/publish_toolstate.py#L316
- Clippy - https://github.com/rust-lang/rust-clippy/blob/master/util/fetch_prs_between.sh#L14
- rust log analyzer - https://github.com/rust-lang/rust-log-analyzer/blob/master/src/bin/server/worker.rs#L225
Otherwise this seems good, but I would like to see PRs landed that fix the above cases before we merge (so we don't break things).
I guess rollup merge commit messages are relevant, too…
Rollup merges are looked for by the clippy script I linked previously and (new) the thanks script https://github.com/rust-lang/thanks/blob/master/src/main.rs#L271
Looking at something like the incorrect backlinks appearing in https://github.com/rust-lang/rust/issues/7235, the “successful merges” list is relevant, too.
Okay, wait… this is even worse. Every “auto merge” commit has the full PR message in it. Which means, if we look at any PR that fixes an issues, e.g. https://github.com/rust-lang/rust-clippy/pull/7175, (which contains Fixes #6804 in the PR message), then the corresponding auto merge will create a wrong backlink when the commit is transferred to rust-lang/rust. I.e. https://github.com/rust-lang/rust/issues/6804 contains a wrong backlink.
So… maybe the better approach is to somehow find-and-replace all non-prefixed issue numbers in the PR message when creating the commit message for the “auto merge” or the “rollup merge” commit. This would then also remove the problem with the successful merges list and the PR message itself could keep the unprefixed variant of the PR numbers.
So I’ll remove 0a66ef752e66dfce4614aa3809ac0e0e68a3de49 for now.