RFR: 1806: Optimize the CSR progress message and log when CSR not found

Zhao Song zsong at openjdk.org
Thu Jan 26 18:14:54 UTC 2023

On Thu, 26 Jan 2023 17:00:45 GMT, Erik Joelsson <erikj at openjdk.org> wrote:

>> A user reported that she have a PR which can't find its corresponding CSR. 
>> Erik found that the issue was caused by the user not updating their branch in a long time, and the fixVersion in the .jcheck/conf file was still set at 20. However, the fixVersion of the CSR was 21, make the bot unable to locate the corresponding CSR. 
>> In this patch, I optimized the CSR progress message and log.
> bots/pr/src/main/java/org/openjdk/skara/bots/pr/CheckRun.java line 77:
>> 75:     private Duration expiresIn;
>> 76: 
>> 77:     private Optional<JdkVersion> versionOpt;
> Fields should not be `Optional`. We should also not add fields that are arbitrarily initiated as a side effect of some method. This needs to be initiated in one place and then propagated through parameters. Looking at the calling tree of the various getIssue methods, this looks like a pretty bad mess. Not sure how to untangle this to propagate the version value.

I add this field because I don't want to call `BotUtils.getVersion(pr)` twice. If adding a field is a bad idea, I think just call `BotUtils.getVersion(pr)` twice is better than add `JdkVersion` to many method interfaces.


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

More information about the skara-dev mailing list