DefinitelyTyped / dt-mergebot

The bot which handles auto-merging your PRs
https://devblogs.microsoft.com/typescript/changes-to-how-we-manage-definitelytyped/
MIT License
112 stars 44 forks source link

Improve search for a relevant "ready to merge" #216

Closed elibarzilay closed 3 years ago

elibarzilay commented 3 years ago

The problem is that using firstApprovalDate can kick in when the first approval is irrelevant for Merge:Auto, so what can happen, as demonstrated in DefinitelyTyped/DefinitelyTyped#48652 is:

To solve this:

  1. Use lastApprovalDate instead, so the above scenario would ignore the request.
  2. If there is any "ready to merge" requests from author/owner/s A,B,C, which are before the sinceDate argument (which uses the above), post a JFYI for A,B,C (with comment that the others can do so too) that the earlier request is ignored due to new activity, and it should be re-posted.
  3. Actually, revise (2): instead of all R2M requests before sinceDate, look for the requests that are before that date and after the last "JFYI" note. This would avoid repetitions.

The above scenario should be "fixed" even if:

elibarzilay commented 3 years ago

I've talked about this with @RyanCavanaugh. And we agreed that there might be a problem with maintainers being surprised when the bot immediately merges once an approval is in if they missed an early request to merge.

However, on the flip side there is the problem of making it into a nagging argument-with-a-machine kind of a thing, similar to an unwanted "are you sure you want to quit?" questions. This is also because having further discussions and passing reviews shouldn't in general make any difference for an author's decision that they want to merge the PR.

So it seems like it's best to keep things as they are now. The implication for the dt maintainers is to generally be aware that if there is a valid (= post-first-approval) request for merge before a PR could be merged, then an approving review or a blessing could lead to an immediate merge.


For the record, there are two variants of the above suggestions: