rust-lang / triagebot

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

Don't post mentions for draft PRs. #1638

Closed ehuss closed 2 years ago

ehuss commented 2 years ago

The mentions can be quite noisy, so this provides a way to prevent them from being posted. Presumably a draft PR is under construction and may change over time, so the mentions may be premature. Once the author clicks "Ready for review", triagebot will re-scan the PR and post any mentions that haven't already been posted.

cc #1637

Mark-Simulacrum commented 2 years ago

We should try to see if we can ping the moment a PR exits draft status, otherwise it can move to being merged without being pinged very easily.

(Not sure what hook to listen on for that, if any).

We probably also ought to make bors error on r+ for draft PRs, but that's less important.

ehuss commented 2 years ago

We should try to see if we can ping the moment a PR exits draft status, otherwise it can move to being merged without being pinged very easily.

Perhaps I'm misunderstanding the question, but this should do that. When the user clicks "Ready for Review", the webhook sends a ReadyForReview action, which should then immediately post any mentions. here is an example where immediately after the "marked this pull request as ready" event, it posts the mention comment.

Mark-Simulacrum commented 2 years ago

Oh, yes, indeed. Sorry, must have read the diff too quickly.

This looks good to me then, thanks!