RFR: 1452: Can never notify on first commit [v3]

Zhao Song zsong at openjdk.org
Thu Oct 6 18:52:03 UTC 2022


On Thu, 6 Oct 2022 17:56:38 GMT, Erik Joelsson <erikj at openjdk.org> wrote:

>> Zhao Song has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   set a threshold to determine whether should notify on first commit
>
> bots/notify/src/main/java/org/openjdk/skara/bots/notify/RepositoryWorkItem.java line 368:
> 
>> 366: 
>> 367:             boolean hasBranchHistory = !history.isEmpty();
>> 368:             int existingCommits = localRepo.getExistingCommits();
> 
> I think this should probably be inlined on line 372. Yes, that will make us call the method for each branch when there are branches without commit history, but that only happens the very first time this WorkItem runs on a new branch.

I thought about it too. As you said, it will make us call the method for each branch, so I put it outside of the for loop.

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

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


More information about the skara-dev mailing list