RFR: 1588: Bridge messages should not be sent for PRs in draft state [v2]
Guoxiong Li
gli at openjdk.org
Sat Feb 11 12:29:48 UTC 2023
On Fri, 10 Feb 2023 17:42:16 GMT, Zhao Song <zsong at openjdk.org> wrote:
> Thinking about this some more, this simple solution has a pretty big drawback. There is no actual synchronization between events. All bot actions are asynchronous. Imagine the following scenario.
>
> 1. User posts comment "I'm putting this PR in draft to work on the feedback"
> 2. User puts PR in draft
> 3. mlbridge bot processes PR, finds it in draft and does nothing
> 4. User removes draft state
> 5. mlbridge bot processes PR, finds new comment from 1 and posts it.
>
> For this to work correctly, draft PRs still need to be processed by mlbridge, and any events up until the draft state change need to be processed as usual.
>
> This is still possibly better than what we have, but I'm not sure. Opinions?
Good Caught. This is a case we need to solve.
I updated the code just now, which ignores the comments in method `ArchiveWorkItem#ignoreComment`
instead of filtering the draft PRs in method `MailingListBridgeBot#getPeriodicItems`.
In order to get the time when the PR was last marked as draft, I add a new API `lastMarkedAsDraftTime` to `PullRequest`
and implement it in the sub-classes. The related tests about this new case and the new API are also added.
-------------
PR: https://git.openjdk.org/skara/pull/1469
More information about the skara-dev
mailing list