RFR: 2190: Setting maximum size limit for PR diff in generating Webrev

Zhao Song zsong at openjdk.org
Thu Mar 7 18:51:55 UTC 2024


On Thu, 7 Mar 2024 18:22:39 GMT, Erik Joelsson <erikj at openjdk.org> wrote:

>> https://github.com/openjdk/tsan/pull/17, there are more than 5000 commits in this pr and mlbridge bot was trying to generate the webrev. The generation of webrev was successful but the webrev file was too big and exceeded GitHub's file size limit.
>> 
>> So as ErikJ suggested, if the diff of the pr is too large, we shouldn't generate webrev for it.
>
> bots/mlbridge/src/main/java/org/openjdk/skara/bots/mlbridge/ArchiveMessages.java line 329:
> 
>> 327:                 "Changes: " + pr.changeUrl() + "\n" +
>> 328:                 (webrev.diffTooLarge() ?
>> 329:                         "  Webrev: Webrev is not available because diff is too large\n" :
> 
> This string is repeated a lot, can we make it a constant, at least within this class?

Sure, will fix it

> webrev/src/main/java/org/openjdk/skara/webrev/Webrev.java line 210:
> 
>> 208:                     .mapToInt(Hunk::changes)
>> 209:                     .sum();
>> 210:             return totalChanges > 300000;
> 
> Please make this a constant.

Sure

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

PR Review Comment: https://git.openjdk.org/skara/pull/1617#discussion_r1516655418
PR Review Comment: https://git.openjdk.org/skara/pull/1617#discussion_r1516655523


More information about the skara-dev mailing list