RFR: 1859: Add "tags only" option to MirrorBot
Zhao Song
zsong at openjdk.org
Tue Mar 28 22:09:43 UTC 2023
On Tue, 28 Mar 2023 09:34:32 GMT, Erik Helin <ehelin at openjdk.org> wrote:
> Hi all,
>
> please review this patch that adds an option to the `MirrorBot` to mirror only tags from one repository to another. I also added some additional logging to `MirrorBot` and cleaned up the logic a bit for selecting the "mode" (tags, mirror, selected branches) that the `MirrorBot` uses.
>
> ### Testing
> - [x] Added one additional unit test
>
> Thanks,
> Erik
bots/mirror/src/main/java/org/openjdk/skara/bots/mirror/MirrorBotFactory.java line 95:
> 93: if (onlyTags && !branchPatterns.isEmpty()) {
> 94: throw new IllegalStateException("Branches cannot be mirrored when only tags are mirrored");
> 95: }
Originally, if `branchPatterns.isEmpty()`, `includeTags` would always be true. But now, it is possible that when `branchPatterns.isEmpty()`, `includeTags` is false.
So I think we could also throw exception when `branchPatterns.isEmpty() && !includeTags`. It is illegal.
-------------
PR Review Comment: https://git.openjdk.org/skara/pull/1493#discussion_r1151197001
More information about the skara-dev
mailing list