RFR: 2454: Skara mistakenly marked a non-clean backport as clean [v3]
Erik Joelsson
erikj at openjdk.org
Wed Mar 12 23:17:17 UTC 2025
On Wed, 12 Mar 2025 22:42:04 GMT, Zhao Song <zsong at openjdk.org> wrote:
>> A user reported that Skara bot mistakenly marked a non-clean backport as clean. After investigation, I found that the PR was too large for the remote host to return the entire diff. The PR contained 8082 changed files, but when Skara bot requested the diff, only 3000 files were returned. Therefore, Skara bot was unable to compare some patches, so mistakenly mark the pr as clean.
>>
>> In this patch, Skara bot will now check if the PR is too large to evaluate. If it is, Skara bot will not evaluate if this PR is clean and will add a warning comment to the PR instead.
>
> Zhao Song has updated the pull request incrementally with two additional commits since the last revision:
>
> - fix copyright
> - update
forge/src/main/java/org/openjdk/skara/forge/github/GitHubPullRequest.java line 758:
> 756: } else {
> 757: return repository.toDiff(targetHash, headHash(), files, true);
> 758: }
Suggestion:
var complete = files.asArray().size() != json.get("changed_files").asInt();
return repository.toDiff(targetHash, headHash(), files, complete);
forge/src/main/java/org/openjdk/skara/forge/github/GitHubRepository.java line 594:
> 592: } else {
> 593: diffs = List.of(toDiff(metadata.parents().get(0), hash, o.get("files"), false));
> 594: }
Suggestion:
var complete = totalAdditions == sumAdditions && totalDeletions == sumDeletions;
diffs = List.of(toDiff(metadata.parents().get(0), hash, o.get("files"), complete));
vcs/src/main/java/org/openjdk/skara/vcs/Diff.java line 45:
> 43: this.to = to;
> 44: this.patches = patches;
> 45: this.complete = true;
Suggestion:
this(from, to, patches, true);
-------------
PR Review Comment: https://git.openjdk.org/skara/pull/1708#discussion_r1992412968
PR Review Comment: https://git.openjdk.org/skara/pull/1708#discussion_r1992414069
PR Review Comment: https://git.openjdk.org/skara/pull/1708#discussion_r1992417565
More information about the skara-dev
mailing list