RFR: SKARA-1096: New command and label for JEPs, similar to CSR [v5]

Erik Joelsson erikj at openjdk.java.net
Thu Apr 14 13:08:25 UTC 2022

On Thu, 14 Apr 2022 12:54:46 GMT, Erik Joelsson <erikj at openjdk.org> wrote:

>>> An important property of the different bot modules is that they can be run independently in different Java processes. We are for instance currently not running the PullRequestBot and the CSRBot in the same JVM instance.
>> From your description, I think this is a synchronization problem in a distributed system. Conceptually, the correct solution is using the distributed lock, but the current SKARA project don't have such mechanism.
> If change operations are done in the right order, it wouldn't be a problem. In this case, if the jep command added the label after the comment, it would be fine without synchronization. One can also argue that this issue will self correct anyway. The JEPBot will see the correct comment eventually and restore the label. The downside is that until that happens (which can easily take enough time to be confusing to users), the PR will show that the JEP has been targeted.

I pondered on this some more and I think we can fix it. We can extend `CommandHandler::handle` for PRs with another parameter for returning a collection of labels to add to the PR. PullRequestCommandWorkItem calls this with an empty collection and any command that needs to add labels after the reply is posted can add them to this collection.


PR: https://git.openjdk.java.net/skara/pull/1297

More information about the skara-dev mailing list