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

Erik Joelsson erikj at openjdk.java.net
Mon Apr 18 13:28:05 UTC 2022


On Mon, 18 Apr 2022 09:20:32 GMT, Guoxiong Li <gli at openjdk.org> wrote:

>> Hm, at second thought, I take that back. Removing it after adding a new comment is better.
>
> I updated the code just now. The new code changes the PR labels after commenting just as we discussed before.
> 
> And I refactored the method `processCommand` to avoid the multi-level nested conditional statements.

This wasn't quite how I envisioned it. I don't think we need to overload the handle method. I also don't think we should use the return value for this. We already use the reply parameter as a kind of return value, a parameter that you modify to return a new state to the caller. My idea was to just add two more parameters to the existing handle method:

..., List<String> labelsToAdd, List<String> labelsToRemove)

The logic in `processCommand` wouldn't need to change much. It would need to instantiate two ArrayLists in the case of `isCommit==false`, and then loop through each list to process the label changes on the pr. The `pr.addComment(writer.toString())` line would need to be moved from the end to just after each of the two `handle` calls.

-------------

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


More information about the skara-dev mailing list