Integrated: 2231: JCheck ran twice unnecessarily
Zhao Song
zsong at openjdk.org
Fri Apr 12 16:12:49 UTC 2024
On Thu, 11 Apr 2024 20:19:42 GMT, Zhao Song <zsong at openjdk.org> wrote:
> Recently, I found sometimes JCheck ran twice unnecessarily in some prs.
> For example:
> https://github.com/openjdk/jdk/pull/16005
> https://github.com/openjdk/jdk/pull/14586
>
> In the above prs, the authors didn't update .jcheck/conf in the source branch, but skara executed jcheck twice with the jcheck config in the merged commit(merged target branch and source branch).
>
> After investigation,l found that in this case, skara bot will make a mistake.
> Let's say we have two branches:
> Target branch: initialCommit <-- updateJCheckCommit <-- latestCommit
> Source Branch: initialCommit <-- editCommit
> In CheckRun, Skara bot would create a squashed commit(final head is editCommit and parent is latestCommit), and the squashed commit would include diffs in updateJCheckCommit, latestCommit, editCommit. Later, Skara bot would use CheckRun#isFileUpdated to check if .jcheck/conf is updated in the squashed commit and it will return true, therefore run jcheck twice.
>
> To resolve this problem, I think we should rewrite isFileUpdated, skara bot should find the common ancestor of target branch and source branch first, then check if the file is updated between mergeBase and the head of source branch.
This pull request has now been integrated.
Changeset: 894690e9
Author: Zhao Song <zsong at openjdk.org>
URL: https://git.openjdk.org/skara/commit/894690e9bbb3a6b6473f599fb374a402edc4076c
Stats: 78 lines in 2 files changed: 61 ins; 10 del; 7 mod
2231: JCheck ran twice unnecessarily
Reviewed-by: erikj
-------------
PR: https://git.openjdk.org/skara/pull/1635
More information about the skara-dev
mailing list