RFR: 340: Infer master for repos in the same org for merge style PRs

Erik Helin ehelin at openjdk.java.net
Tue Mar 31 09:09:09 UTC 2020


On Tue, 31 Mar 2020 08:21:50 GMT, Robin Westberg <rwestberg at openjdk.org> wrote:

> Hi all,
> 
> Please review this change that allows a shorter form when merging the master branch from a repo in the same org.
> 
> Best regards,
> Robin

Looks good, just two minor comments inline

bots/pr/src/main/java/org/openjdk/skara/bots/pr/CheckRun.java line 137:

> 136:                 // Assume the name refers to a sibling repository
> 137:                 var repoName = Path.of(pr.repository().name()).resolveSibling(branchMatcher.group(1)).toString();
> 138:                 return Optional.of(new MergeSource(repoName, "master"));

Perhaps check that the repo actually exists?

bots/pr/src/main/java/org/openjdk/skara/bots/pr/CheckRun.java line 131:

> 130:
> 131:             // Verify that the branch exists
> 132:             var isValidBranch = prInstance.remoteBranches().stream()

Suggestion:

            // Check if name refers to branch or repository

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

Marked as reviewed by ehelin (Reviewer).

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


More information about the skara-dev mailing list