RFR: 1188: The pr/NNNN branches are not always deleted when a PR is closed

Guoxiong Li gli at openjdk.java.net
Mon Nov 22 15:44:54 UTC 2021


On Mon, 22 Nov 2021 14:11:57 GMT, Erik Joelsson <erikj at openjdk.org> wrote:

>> Hi all,
>> 
>> When a PR is ready for reviewing, the label `rfr` will be added and skara will create the branch `pr/NNNN` for it. 
>> If we convert the PR back to draft, the label `rfr` would be removed and the branch `pr/NNNN` won't be deleted. 
>> Then we close the PR, **the bot won't deleted the branch**.
>> 
>> The reason is that the following code checks the label `rfr` or `integrated` to decide whether the bot should remove the branch.
>> 
>> 
>>     private boolean isOfInterest(PullRequest pr) {
>>         var labels = new HashSet<>(pr.labelNames());
>>         if (!(labels.contains("rfr") || labels.contains("integrated"))) {
>>             log.fine("PR is not yet ready - needs either 'rfr' or 'integrated' label");
>>             return false;
>>         }
>>         // ignore......
>>     }
>> 
>> 
>> To solve this issue, this patch adds one situation about the branch existing or not. And the corresponding test is added.
>> 
>> Thanks for taking the time to review.
>> 
>> Best Regards,
>> -- Guoxiong
>
> Looks good and well spotted!

@erikj79 Thanks for your review. Could I get your help to sponsor this patch?

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

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


More information about the skara-dev mailing list