Integrated: 1696: CSRBot uses wrong fixVersion when resolving CSR issues for PR

Erik Joelsson erikj at openjdk.org
Mon Dec 5 17:56:05 UTC 2022


On Tue, 29 Nov 2022 23:49:32 GMT, Erik Joelsson <erikj at openjdk.org> wrote:

> When CSRBot looks for a suitable issue in a set of Backports and main bug, it gets the fixVersion from the target branch of the PR. This is conceptually wrong, as the PR may be including a change to the fixVersion, and if that is the case, any associated bug should be resolved with fixVersion set to the value the PR changed it to.
> 
> We currently have this PR where exactly that is happening:
> https://github.com/openjdk/jdk/pull/10924
> 
> The associated bugs have fixVersion correctly set to 21, as this is the initial change for bumping the JDK version from 20 to 21. This is causing CSRBot to not be able to find the linked CSR issues.
> 
> The same kind of logic is also present in PullRequestBot, and unfortunately the methods are copied. The reason for this is the lack of a common place to put application level shared logic for multiple bots. 
> 
> This patch changes the getVersion logic to first try to get it from the sourceHash of the PR and if that fails, fallback to the targetRef like before. I don't think this will fail much in practice, but there could be corner cases where it might be possible. The failure condition here is catching `UncheckedRestException` and checking the return code. This isn't ideal, and that particular exception is a bit of an implementation detail. Maybe we should consider providing a better API for getting file contents that may be missing?
> 
> I'm introducing a new module with this change where common bot logic can be housed, and put the updated version extraction logic there. This has been missing for a long time IMO and there is a lot of possible cleanup possible after introducing this module. Several modules have similar classes doing almost the same thing. I also think that some of the "utils" logic in the forge module could find a better home here.

This pull request has now been integrated.

Changeset: e5add2dd
Author:    Erik Joelsson <erikj at openjdk.org>
URL:       https://git.openjdk.org/skara/commit/e5add2ddab6488e87d54a2ea26d89ddeeacf21d3
Stats:     209 lines in 14 files changed: 156 ins; 40 del; 13 mod

1696: CSRBot uses wrong fixVersion when resolving CSR issues for PR

Reviewed-by: ihse

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

PR: https://git.openjdk.org/skara/pull/1429


More information about the skara-dev mailing list