pholleran / get-consensus

A Probot app to require consensus from one or more teams

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Status

Note: This application is no longer maintained. If you're looking for a more robust solution to complex PR approval rules, with a robust community of users, please take a look at palantir/policy-bot.

Get-Consensus

A Probot app that lets repo admins require multiple reviewers from the same team by defining what constitutes consensus.

image

Usage

  1. Install the app
  2. Create a .github/consensus.yml file in your repository
# these are the teams that will have a consensus enfored

teams:

  # the slug of a team as defined in https://developer.github.com/v3/teams/#response
  # this is also the team as defined in the url structure https://<gitHubHost>/<org/<teams>/<slug>
  - slug: myTeam

  # the consensus is the minimum number of approved reviews that constitue a consensus
  # acceptable values are:
  #   * an integer
  #   * majority (conensus will calculate a simple majority for the team)
  #   * all (all team members)
    consensus: majority

When a review is requested from a team (either via CODEOWNERS, the UI, or the API) Get-Consensus will create review requests for each team member. With each state change of the Pull Request the app will check to see if consensus was reached for each configured team.

Note: committers to a Pull Request cannot submit reviews with an approved/request changes action. As such, committers to a Pull Request are removed when calculating majority or all.

For example: team-a has four members, of which mona is one. A majority of team-a would be 3. If mona is a committer to the Pull Request, she cannot provide an approved review, so the new majority (for the Pull Request in question) is 2 since, without her, there are 3 remaining team members who can review.

Deploying

Get-Consensus can be deployed to your own environment following the probot deployment documentation.

If deploying to GitHub Enterprise Server:

  • you must be running version 2.15 or later, as Get-Consensus makes use of the checks API
  • be sure to set the GHE_HOST environment variable per the probot documentation

License

ISC © 2019 Philip Holleran pholleran@github.com

About

A Probot app to require consensus from one or more teams

License:ISC License


Languages

Language:JavaScript 100.0%