rust-lang / triagebot

Automation/tooling for Rust spaces
https://triage.rust-lang.org
Apache License 2.0
170 stars 74 forks source link

handlers: add no merge policy notifications #1642

Closed davidtwco closed 1 year ago

davidtwco commented 1 year ago

Inspired by discussion on Zulip.

Add a handler for issue events that checks whether a merge commit has been added to the pull request and informs the user of the project's no merge policy.

cc @Mark-Simulacrum

davidtwco commented 1 year ago

This passes a cargo check but I haven't yet had the time to set up a proper environment to check it actually works, so opening as a draft.

davidtwco commented 1 year ago

I wonder if we'd get a Github-native warning by adding "require linear history" to the branch protections on rust-lang/rust or whatever other repositories. Maybe worth experimenting with?

I've received feedback that GitHub will offer a "fix this conflict" button of some sort that adds a merge commit, which is immediately incorrect, so we could reduce the incidences of this happening by preventing GitHub from offering that option.

Mark-Simulacrum commented 1 year ago

@davidtwco this is still marked as a draft, is that state accurate? Or are we good to go?

davidtwco commented 1 year ago

@davidtwco this is still marked as a draft, is that state accurate? Or are we good to go?

I haven't taken the time to set up a development environment for this locally and actually check it does what I expect it to (just because that seems like something that I'll need to block out some time to do).

Mark-Simulacrum commented 1 year ago

Oh. Well, feel free to if you want, but we can also merge this and then enable it (perhaps not on rust-lang/rust) and test it that way. Just let me know if you'd prefer that; it's pretty typical of triagebot PRs.

davidtwco commented 1 year ago

Oh. Well, feel free to if you want, but we can also merge this and then enable it (perhaps not on rust-lang/rust) and test it that way. Just let me know if you'd prefer that; it's pretty typical of triagebot PRs.

Sorry for the delay here, we can test it after merging I think.