RFR: 1587: Adding review comments should not mean approval status change [v2]

Erik Joelsson erikj at openjdk.org
Thu Oct 20 20:12:38 UTC 2022

On Thu, 20 Oct 2022 19:21:47 GMT, Zhao Song <zsong at openjdk.org> wrote:

>> The issue here is ' if a user leaves additional comments using the "Review changes" dialog, and selects the "Comments", then their approval is considered revoked.'
>> I believe this happens because if we use "Review changes" to add a comment, it will add a review with `Review.Verdict.NONE` to our pr.  According to our current logic, this new review will cover old reviews, so the approval will be revoked.
>> I made changes to `CheckablePullRequest#filterActiveReviews`. Now If latest review is just a comment, the verdict will inherit from the previous review.
> Zhao Song has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains one new commit since the last revision:
>   SKARA-1587

bots/pr/src/main/java/org/openjdk/skara/bots/pr/CheckablePullRequest.java line 143:

> 141:                 var reviewNewer = prevReview.createdAt().isBefore(review.createdAt());
> 142: 
> 143:                 if ((!review.verdict().equals(Review.Verdict.NONE)) && ((prevReviewCorrectTarget && reviewCorrectTarget && reviewNewer)

Maybe break the line for better readability before the first `&&`.


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

More information about the skara-dev mailing list