RFR: pr: update all local branches for commit comments

Robin Westberg rwestberg at openjdk.java.net
Mon Mar 1 14:34:27 UTC 2021

On Sun, 28 Feb 2021 20:05:22 GMT, Erik Helin <ehelin at openjdk.org> wrote:

> Hi all,
> please review this patch that makes `CommitCommentsWorkItem` properly update all local branches prior to calling `ReadOnlyRepository.commitMetdata`. `ReadOnlyRepository.commitMetadata` is essentially `rev-list —all` for Git and all local refs need to be updated for this to work. In order to make as few networks call as possible I manually merge each local branch with its remote counterpart (instead of doing `pull`).
> Testing:
> - [x] `make test` passes on Linux x64
> Thanks,
> Erik

bots/pr/src/main/java/org/openjdk/skara/bots/pr/CommitCommentsWorkItem.java line 70:

> 68:             var localRepoPath = scratchPath.resolve("pr").resolve("commit-comments").resolve(bot.repo().name());
> 69:             var localRepo = hostedRepositoryPool.materialize(bot.repo(), localRepoPath);
> 70:             localRepo.fetchAllRemotes(false);

Not sure this is needed? The materialize call should have done a fetchAll as well..


PR: https://git.openjdk.java.net/skara/pull/1041

More information about the skara-dev mailing list