RFR: 1858: Make it possible to configure to require reviewers for "Merge" PRs

Erik Joelsson erikj at openjdk.org
Fri Mar 31 22:09:47 UTC 2023


On Thu, 30 Mar 2023 18:51:31 GMT, Zhao Song <zsong at openjdk.org> wrote:

> In this patch, PR bot has been added with the capability to control the requirement of reviews for merge pull requests.
> 
> By default, review is not necessary for merge pull requests.
> 
> However, if it is desired to enable the requirement of reviews for merge requests in a repo, the configuration can be added to the PR bot configuration as follows:
> 
> {
>   "pr": {
>       "repositories": {
>           "repo1": {
>                "reviewMergePullRequest": true
>           }
>        }
>   }
> }
> 
> 
> Currently, jcheck would run in two places in skara bot. One is in checkRun and one is in IntegrateCommand. The basic idea for us to ignore reviewersCheck for CleanBackport and Merge PullRequest is ignoring the error message.

bots/pr/src/test/java/org/openjdk/skara/bots/pr/PullRequestBotFactoryTest.java line 116:

> 114:                           ],
> 115:                           "reviewCleanBackport": true,
> 116:                           "reviewMergePullRequest": true,

I think `reviewMerge` is enough for the configuration option. The word "PullRequest" seems redundant in the context of pr bot.

jcheck/src/main/java/org/openjdk/skara/jcheck/ReviewersCheck.java line 70:

> 68:     @Override
> 69:     Iterator<Issue> check(Commit commit, CommitMessage message, JCheckConfiguration conf, Census census) {
> 70:         if (utils.addsHgTag(commit)) {

We can't just remove this default behavior in jcheck itself. Then the cli version of jcheck would always require reviewers for a merge commit. We are going to need a new setting in `.jcheck/conf` for this and the PR bot would override it when creating the jcheck instance.

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

PR Review Comment: https://git.openjdk.org/skara/pull/1495#discussion_r1154942745
PR Review Comment: https://git.openjdk.org/skara/pull/1495#discussion_r1154944247


More information about the skara-dev mailing list