RFR: 1256: Use stream api to simplify the csr issue lookup [v4]

Erik Joelsson erikj at openjdk.java.net
Wed Dec 1 17:54:29 UTC 2021


On Wed, 1 Dec 2021 16:39:11 GMT, Guoxiong Li <gli at openjdk.org> wrote:

>> Hi all,
>> 
>> This patch adds the common methods `Issue#linksWithRelationships`, `Issue#csrLink` and `Issue#csrIssue` and refactors the code to reduce the loop nested statements by using these common methods.
>> 
>> All the existing tests passed.
>> 
>> Best Regards,
>> -- Guoxiong
>
> Guoxiong Li has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Encapsulate the csrLink method.

bots/pr/src/main/java/org/openjdk/skara/bots/pr/CSRCommand.java line 118:

> 116:             if (csrOptional.isEmpty()) {
> 117:                 // The csr link exists but the csr issue doesn't exist.
> 118:                 // We should remind the user to remove the link firstly.

I missed this in the previous patch.

I don't think we can ask the user to remove a broken link in JBS. I'm pretty sure that would require admin actions. Here we should just treat it as if the link didn't exist and remove the label.

bots/pr/src/main/java/org/openjdk/skara/bots/pr/CSRCommand.java line 132:

> 130:                     || !resolution.get("name").asString().equals("Withdrawn")) {
> 131:                 // The issue has a non-withdrawn csr issue, the bot should direct the user to withdraw the csr firstly.
> 132:                 reply.println("the issue for this pull request, [" + jbsIssue.get().id() + "](" + jbsIssue.get().webUrl() + "), has " +

I missed this in the previous patch. The language of this reply needs some work. Here is my suggestion.

"The CSR requirement cannot be removed as there already is a CSR associated with the main issue of this pull request. Please withdraw the CSR [link] and then use the command '/csr unneeded' again."

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

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


More information about the skara-dev mailing list