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

Erik Joelsson erikj at openjdk.java.net
Mon Nov 22 14:14:27 UTC 2021


On Sun, 21 Nov 2021 14:56:30 GMT, Guoxiong Li <gli 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!

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

Marked as reviewed by erikj (Lead).

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


More information about the skara-dev mailing list