Sign inSign up

bivas/rivi

By bivas

•Updated about 6 years ago

Automate your review process with Rivi the review bot

Image
0

2.0K

bivas/rivi repository overview

README.md from https://github.com/bivas/rivi⁠

⁠rivi

Automate your review process with Rivi the review bot

⁠Usage

Usage of rivi:
  -config string
    	Bot configuration file
  -port int
    	Bot listening port (default 8080)
  -uri string
    	Bot URI path (default "/")
⁠Example
$ rivi -port 9000 -config repo-x.yaml

⁠Requirements

  • Create a token with repo persmissions

  • Create a webhook and make sure the following are configured:

    • Select content type as application/json
    • Optionally, set a secret (this will be used by the bot to validate webhook content)
    • Register the following events
      • Pull request
      • Pull request review
      • Pull request review comment

⁠Configuration File Structure

⁠Config Section

Configure the Git client for repository access and webhook validation

config:
  provider: github
  token: my-very-secret-token
  secret: my-hook-secret-shhhhh 
  • token (required) - the client OAuth token the bot will connect with (and assign issues, add comments and lables)
  • provider (optional) - which client to use for git connection - the bot tries to figure out which client to use automatically (currently only github is supported but others are on the way)
  • secret (optional) - webhook secret to be used for content validation (recommended)

⁠Roles Section

List of roles for selecting (login) users for assignment.

roles:
  admins:
      - user1
      - user2
  reviewers:
      - user3
      - user4
  testers:
      - user2
      - user4

⁠Rules Section

Configure rules to be processed by the bot on each issue event. Each rule may have several actions.

⁠Structure
rules:
  rule-name1:
    <condition>
    <action-name>
    <action-name>
    <action-name>
    ...
  rule-name2:
    <condition>
    <action-name>
...
⁠Example
rules:
  rule-name:
      condition:
        if-labeled:
          - label1
          - label2
        skip-if-labeled:
          - label3
        filter:
          patterns: 
            - "docs/.*"
          extension: 
            - ".go"
      commenter:
        comment: "We have a match!"
      labeler:
        label: ready-for-review
⁠Condition

The entire condition section is optional - you can run all rules all the time and see if it helps :smile:

  • if-labeled - apply the rule if the issue has any of the provided labels
  • skip-if-labeled - skip rule processing if issue has any of the provided labels
  • filter
    • patterns - pattern⁠ matching the pull request file list (any of the patterns)
    • extensions - which file extension to match on pull request file list (must start with a dot [.])
⁠Available Actions

⁠Example Configuration

config:
  provider: github
  token: my-very-secret-token
  secret: my-hook-secret-shhhhh

roles:
  admins:
      - user1
      - user2
  reviewers:
      - user3
      - user4
  testers:
      - user2
      - user4

rules:
  pr-size:
        sizing:
          xs:
            label: size/xs
            changed-files-threshold: 5
          s:
            label: size/s
            changed-files-threshold: 15
          default:
            label: pending-approval
            comment: "Your pull-request is too large for review"

  docs:
        condition:
          filter:
            patterns: 
              - "docs/.*"
        labeler:
          label: documentation

  assignment:
        condition:
          skip-if-labeled:
            - pending-approval
        autoassign:
          from-roles:
            - admins
            - reviewers

Tag summary

Content type

Image

Digest

Size

32.3 MB

Last updated

over 7 years ago

docker pull bivas/rivi