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

Zhao Song zsong at openjdk.org
Thu Jan 26 18:21:23 UTC 2023


On Thu, 26 Jan 2023 18:12:38 GMT, Zhao Song <zsong at openjdk.org> wrote:

>> 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.

I think the calling tree of `issues()` is in a mess because we have two different type of issues(`org.openjdk.skara.vcs.openjdk` and `org.openjdk.skara.issuetracker.Issue`). Besides,  we don't have class fields to store issues, csrIssues, JepIssues. So we need to call `issues()` three times.

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

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


More information about the skara-dev mailing list