-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable triagebot no-merges check #114157
Enable triagebot no-merges check #114157
Conversation
Add triagebot no-merges config cc rust-lang/triagebot#1704 rust-lang/rust#114157
This shouldn't affect submodule updates, should it? I don't think they have multiple parents. Affecting subtree updates seems like a real concern. I don't know what their workflow is like, but asking people to manually set labels seems like it would be a bit too much of an ask. Have you consulted with the people doing subtree updates? Would it be possible to add a configuration to ignore certain directories? BTW, I recommend not doing things like |
Yeah I think you're right.
It's really too bad that Github doesn't have better support for pull request templates, or I would recommend that. I haven't consulted with them, that's a good idea. Edit: Ignoring directories would work, but would of course come with a small amount of false negatives. I haven't found any other way of detecting if a commit comes from a subtree update. I've started a discussion with some contributors who commonly open sync PRs. |
r? @ehuss -- I think the only concern from me is also the subtree updates. FWIW, I have wanted to move those towards automation... but that's probably a longer term thing. |
b57b711
to
59bd741
Compare
add subtree-sync label to rustc update PRs For rust-lang/rust#114157
Alright so I've talked with the most prolific subtree updaters including: And the consensus was that the label method is better than a triagebot heuristic. Most will simply begin adding the Those wanting to add the label manually can use a link like the following:
Or you can use Github CLI tool:
If anyone else is already using scripts or would like a script for this, please let me know and I'll be happy to open a PR to add that to your repo. |
One final concern is backport PRs. I don't know if any of those contain merge commits, or if they are always cherry-picks. |
triagebot.toml
Outdated
@@ -402,6 +402,10 @@ message_on_add = """\ | |||
Issue #{number} "{title}" has been added. | |||
""" | |||
|
|||
[no-merges] | |||
exclude_labels = ["rollup", "subtree-sync"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also want to add those labels to the no-merges
policy in the Clippy repo: https://github.com/rust-lang/rust-clippy/blob/8c48b936ccf5cf62647420e604bb2cae155268a4/triagebot.toml#L12-L13
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, we should probably do the same in Miri. And that that point the sync PRs for the rustc → Miri direction (which are auto-created via our cronjob) should then also get that label.
Hm, the label doesn't seem to actually work? In rust-lang/miri#3059 the bot complained loudly about the merge commits. |
There is probably a race between creating the PR and adding the labels. AFAIK, GitHub doesn't do that atomically. |
Hm, but that means the planned strategy of using the labels to silence the bot isn't working. An alternative might be to have a tag inside the PR comment, like "triagebot: subtree-sync". I assume when triagebot runs to do its initial checks, it has definite access to the PR comment text, so there's no chance of a race condition here. |
Yeah I might need to add a delay or something. It has worked fine in my testing but that very well could be because the rust repo has a very large triagebot config and there was enough processing before no-merges to act as suitable delay. |
add subtree-sync label to rustc update PRs For rust-lang#114157
I think things like I don't particularly love using the body but that may be the easiest way. |
Is it possible to set the body in a PR URL? |
Also mentioned there is the possibility of using a template |
I don't think the label set by that is guaranteed to be visible to later triagebot commands, even if the processing happens before. In general if we need some metadata around PR creation time you either need to schedule the work to happen in the background after a delay or depend on metadata set in the PR (e.g., PR title, description). |
This configuration will exclude rollup PRs and subtree sync PRs from merge commit detection. On other PRs, it will post the default warning message and add the `has-merge-commits` and `S-waiting-on-author` labels when merge commits are detected. The eventual vision is to have bors refuse to merge if the `has-merge-commits` label is present. A reviewer can still force the merge by removing that label if they so wish.
59bd741
to
4baa12b
Compare
Updated for rust-lang/triagebot#1720 which has been merged |
@bors r+ rollup |
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#114157 (Enable triagebot no-merges check) - rust-lang#116257 (Suggest trait bounds for used associated type on type param) - rust-lang#116430 (vendoring in tarball sources) - rust-lang#116709 (Update minifier version to 0.2.3) - rust-lang#116786 (Update my mailmap entry) - rust-lang#116790 (opt-dist: disable unused features for tabled crate) - rust-lang#116802 (Remove `DefiningAnchor::Bubble` from opaque wf check) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#114157 - pitaj:triagebot_no-merges, r=ehuss Enable triagebot no-merges check Follow-up on rust-lang/triagebot#1704 ### Motivation Occasionally, a merge commit like rust-lang@cb5c011 makes it past manual review and gets merged into master. At one point, we tried adding a check to CI to prevent this from happening (rust-lang#105058), but that ended up [problematic](rust-lang#106319 (comment)) and was [reverted](rust-lang#106320). This kind of check is simply too fragile for CI, and there must be a way for a human to override the bot's decision. The capability to detect and warn about merge commits has been present in triagebot for quite some time, but was never enabled at rust-lang/rust, possibly due to concerns about false positives on rollup and subtree sync PRs. This PR intends to alleviate those concerns. ### Configuration This configuration will exclude rollup PRs and subtree sync PRs from merge commit detection, and it will post the default warning message and add the `has-merge-commits` and `S-waiting-on-author` labels when merge commits are detected on other PRs. The eventual vision is to have bors refuse to merge if the `has-merge-commits` label is present. A reviewer can still force the merge by removing that label if they so wish. ### Note for contributors The rollup tool should add that label automatically, but anyone performing subtree updates should begin including "subtree update" in the titles of those PRs, to avoid false positives. r? infra ## Open Questions 1. This configuration uses the default message that's built into triagebot: > There are merge commits (commits with multiple parents) in your changes. We have a [no merge policy](https://rustc-dev-guide.rust-lang.org/git.html#no-merge-policy) so these commits will need to be removed for this pull request to be merged. > > You can start a rebase with the following commands: > ```shell-session > $ # rebase > $ git rebase -i master > $ # delete any merge commits in the editor that appears > $ git push --force-with-lease > ``` Any changes to this are easy, I'll just have to add a `message` option. Should we mention the excluded titles in the message?
54: Pull upstream master 2023 10 17 r=pietroalbini a=Veykril * rust-lang/rust#116196 * rust-lang/rust#116824 * rust-lang/rust#116822 * rust-lang/rust#116477 * rust-lang/rust#116826 * rust-lang/rust#116820 * rust-lang/rust#116811 * rust-lang/rust#116808 * rust-lang/rust#116805 * rust-lang/rust#116800 * rust-lang/rust#116798 * rust-lang/rust#116754 * rust-lang/rust#114370 * rust-lang/rust#116804 * rust-lang/rust#116802 * rust-lang/rust#116790 * rust-lang/rust#116786 * rust-lang/rust#116709 * rust-lang/rust#116430 * rust-lang/rust#116257 * rust-lang/rust#114157 * rust-lang/rust#116731 * rust-lang/rust#116550 * rust-lang/rust#114330 * rust-lang/rust#116724 * rust-lang/rust#116782 * rust-lang/rust#116776 * rust-lang/rust#115955 * rust-lang/rust#115196 * rust-lang/rust#116775 * rust-lang/rust#114589 * rust-lang/rust#113747 * rust-lang/rust#116772 * rust-lang/rust#116771 * rust-lang/rust#116760 * rust-lang/rust#116755 * rust-lang/rust#116732 * rust-lang/rust#116522 * rust-lang/rust#116341 * rust-lang/rust#116172 * rust-lang/rust#110604 * rust-lang/rust#110729 * rust-lang/rust#116527 * rust-lang/rust#116688 * rust-lang/rust#116757 * rust-lang/rust#116753 * rust-lang/rust#116748 * rust-lang/rust#116741 * rust-lang/rust#116594 * rust-lang/rust#116691 * rust-lang/rust#116643 * rust-lang/rust#116683 * rust-lang/rust#116635 * rust-lang/rust#115515 * rust-lang/rust#116742 * rust-lang/rust#116661 * rust-lang/rust#116576 * rust-lang/rust#116540 * rust-lang/rust#116352 * rust-lang/rust#116737 * rust-lang/rust#116730 * rust-lang/rust#116723 * rust-lang/rust#116715 * rust-lang/rust#116603 * rust-lang/rust#116591 * rust-lang/rust#115439 * rust-lang/rust#116264 * rust-lang/rust#116727 * rust-lang/rust#116704 * rust-lang/rust#116696 * rust-lang/rust#116695 * rust-lang/rust#116644 * rust-lang/rust#116630 * rust-lang/rust#116728 * rust-lang/rust#116689 * rust-lang/rust#116679 * rust-lang/rust#116618 * rust-lang/rust#116577 * rust-lang/rust#115653 * rust-lang/rust#116702 * rust-lang/rust#116015 * rust-lang/rust#115822 * rust-lang/rust#116407 * rust-lang/rust#115719 * rust-lang/rust#115524 * rust-lang/rust#116705 * rust-lang/rust#116645 * rust-lang/rust#116233 * rust-lang/rust#115108 * rust-lang/rust#116670 * rust-lang/rust#116676 * rust-lang/rust#116666 Co-authored-by: Benoît du Garreau <[email protected]> Co-authored-by: Colin Finck <[email protected]> Co-authored-by: Ian Jackson <[email protected]> Co-authored-by: Joshua Liebow-Feeser <[email protected]> Co-authored-by: León Orell Valerian Liehr <[email protected]> Co-authored-by: Trevor Gross <[email protected]> Co-authored-by: Evan Merlock <[email protected]> Co-authored-by: joboet <[email protected]> Co-authored-by: Ralf Jung <[email protected]> Co-authored-by: DaniPopes <[email protected]> Co-authored-by: Mark Rousskov <[email protected]> Co-authored-by: onur-ozkan <[email protected]> Co-authored-by: Nicholas Nethercote <[email protected]> Co-authored-by: The 8472 <[email protected]> Co-authored-by: Samuel Thibault <[email protected]> Co-authored-by: reez12g <[email protected]> Co-authored-by: Jakub Beránek <[email protected]>
Follow-up on rust-lang/triagebot#1704
Motivation
Occasionally, a merge commit like cb5c011 makes it past manual review and gets merged into master.
At one point, we tried adding a check to CI to prevent this from happening (#105058), but that ended up problematic and was reverted. This kind of check is simply too fragile for CI, and there must be a way for a human to override the bot's decision.
The capability to detect and warn about merge commits has been present in triagebot for quite some time, but was never enabled at rust-lang/rust, possibly due to concerns about false positives on rollup and subtree sync PRs. This PR intends to alleviate those concerns.
Configuration
This configuration will exclude rollup PRs and subtree sync PRs from merge commit detection, and it will post the default warning message and add the
has-merge-commits
andS-waiting-on-author
labels when merge commits are detected on other PRs.The eventual vision is to have bors refuse to merge if the
has-merge-commits
label is present. A reviewer can still force the merge by removing that label if they so wish.Note for contributors
The rollup tool should add that label automatically, but anyone performing subtree updates should begin including "subtree update" in the titles of those PRs, to avoid false positives.
r? infra
Open Questions
Any changes to this are easy, I'll just have to add a
message
option. Should we mention the excluded titles in the message?