RFR: 2198: Backport PRs should check if a CSR is required [v2]

Erik Joelsson erikj at openjdk.org
Thu Mar 21 20:17:17 UTC 2024


On Wed, 20 Mar 2024 22:49:34 GMT, Zhao Song <zsong at openjdk.org> wrote:

>> This patch is trying to let the pr bot automatically requires csr for a backport PR if one of the associated has a resolved CSR.
>
> Zhao Song has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Make CSR process link a constant

bots/pr/src/main/java/org/openjdk/skara/bots/pr/CheckRun.java line 1566:

> 1564:                     .filter(Optional::isPresent)
> 1565:                     .map(Optional::get)
> 1566:                     .map(Backports::csrLink)

I'm a bit concerned that we will be going through csrLinks twice, first to see if there are any associated CSRs and then here to see if there are any resolved ones. Not sure if there is a feasible way to either combine the checks or cache the results between them.

bots/pr/src/main/java/org/openjdk/skara/bots/pr/CheckRun.java line 1580:

> 1578:                         "This backport might also need a CSR. `csr` label will be added to this PR.\n" +
> 1579:                         "Please go through the [CSR](" + CSR_PROCESS_LINK +
> 1580:                         ") process or using command `csr unneeded` to remove the CSR requirement.");

There is no need to use single newlines, they will just be ignored when the comment is formatted anyway.

Suggestion:

                pr.addComment("At least one of the issues associated with this backport has a resolved " +
                        "[CSR](" + CSR_PROCESS_LINK + ") for a different version. As this means that this " +
                        "backport may also need a CSR, the `csr` label is being added to this pull request " +
                        "to signal this potential requirement. The command `/csr unneeded` can be used to " + 
                        "remove the label in case a CSR is not needed.");

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

PR Review Comment: https://git.openjdk.org/skara/pull/1623#discussion_r1534578430
PR Review Comment: https://git.openjdk.org/skara/pull/1623#discussion_r1534613574


More information about the skara-dev mailing list