RFR: 1071: auto-set `/csr` flag from JBS state [v4]

Erik Joelsson erikj at openjdk.java.net
Mon Nov 29 15:50:49 UTC 2021


On Mon, 29 Nov 2021 15:39:35 GMT, Guoxiong Li <gli at openjdk.org> wrote:

>> bots/csr/src/main/java/org/openjdk/skara/bots/csr/CSRBot.java line 131:
>> 
>>> 129:                             // a Reviewer had requested and integrate it without satisfying that requirement.
>>> 130:                             log.info("CSR closed and withdrawn for " + describe(pr) + ", not removing CSR label");
>>> 131:                         } else if (!pr.labelNames().contains(CSR_LABEL)) {
>> 
>> I'm not sure about this case. For this to realistically happen, a CSR would have been filed and withdrawn before the PR was created. I don't think we should automatically add the label in this situation. @kevinrushforth what do you think?
>> 
>> If the label is already there, then we should certainly leave it there however.
>
> @erikj79 @kevinrushforth Thanks for the comments. It seems that my current code meets your comments. Did I misunderstand anything?
> 
> Please see the code below. When the CSR has been withdrawn, the bot only prints the information and doesn't add the csr label automatically. 
> 
> 
> if (!name.asString().equals("Approved")) {
>     if (name.asString().equals("Withdrawn")) {
>         log.info("CSR closed and withdrawn for " + describe(pr) + ", not removing CSR label");  // <----here
>     } else if (!pr.labelNames().contains(CSR_LABEL)) {
>         log.info("CSR issue resolution is not 'Approved' for " + describe(pr) + ", adding the CSR label");
>         pr.addLabel(CSR_LABEL);
>     } else {
>         log.info("CSR issue resolution is not 'Approved' for " + describe(pr) + ", not removing the CSR label");
>     }
>     continue;
> }
> 
> 
> 
> Maybe I should change the output message from `"CSR closed and withdrawn for " + describe(pr) + ", not removing CSR label"` to `"CSR closed and withdrawn for " + describe(pr) + ", not revising (not adding or not removing) CSR label"`.

You are right, I misread your code.

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

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


More information about the skara-dev mailing list