Skip to content

Commit

Permalink
feat: reviewpad onboarding (#1904)
Browse files Browse the repository at this point in the history
* feat: add reviewpad.yml file

* chore: update reviewpad.yml configuration file

* chore: update reviewpad.yml configuration file

* chore: update reviewpad.yml configuration file

* chore: update reviewpad.yml configuration file

* chore: update reviewpad.yml configuration file

* Delete gitstream.cm

* Assign team-reviewer

* Delete gitstream.yml

* Simplify reviewer-assignment logic

---------

Co-authored-by: reviewpad[bot] <104832597+reviewpad[bot]@users.noreply.github.com>
Co-authored-by: Damian Ho <[email protected]>
  • Loading branch information
reviewpad[bot] and damianhxy authored May 21, 2023
1 parent 9a0fd87 commit fa6a5f8
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 123 deletions.
74 changes: 0 additions & 74 deletions .cm/gitstream.cm

This file was deleted.

49 changes: 0 additions & 49 deletions .github/workflows/gitstream.yml

This file was deleted.

62 changes: 62 additions & 0 deletions reviewpad.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# This file is used to configure Reviewpad.
# The configuration is a proposal to help you get started.
# You can use it as a starting point and customize it to your needs.
# For more details see https://docs.reviewpad.com/guides/syntax.

# Define the list of labels to be used by Reviewpad.
# For more details see https://docs.reviewpad.com/guides/syntax#label.
labels:
small:
description: Pull request is small
color: "#76dbbe"
medium:
description: Pull request is medium
color: "#2986cc"
large:
description: Pull request is large
color: "#c90076"

# Define the list of workflows to be run by Reviewpad.
# A workflow is a list of actions that will be executed based on the defined rules.
# For more details see https://docs.reviewpad.com/guides/syntax#workflow.
workflows:
# This workflow calls Reviewpad AI agent to summarize the pull request.
- name: summarize
description: Summarize the pull request
run:
# Summarize the pull request on pull request synchronization.
- if: ($eventType() == "synchronize" || $eventType() == "opened") && $state() == "open"
then: $summarize()

# This workflow assigns a random current developer as a reviewer
- name: reviewer-assignment
description: Assign a random reviewer to pull requests
run:
# Automatically assign reviewer when the pull request is ready for review;
- if: $isDraft() == false
then: $assignReviewer($team("developers-current"), 1, "reviewpad")

# This workflow labels pull requests based on the total number of lines changed.
# This helps pick pull requests based on their size and to incentivize small pull requests.
- name: size-labeling
description: Label pull request based on the number of lines changed
run:
- if: $size() < 100
then: $addLabel("small")
else: $removeLabel("small")
- if: $size() >= 100 && $size() < 300
then: $addLabel("medium")
else: $removeLabel("medium")
- if: $size() >= 300
then: $addLabel("large")
else: $removeLabel("large")

# This workflow signals pull requests waiting for reviews.
# This helps guarantee that pull requests are reviewed and approved by at least one person.
- name: check-approvals
description: Check that pull requests have the required number of approvals
run:
# Label pull requests with `waiting-for-review` if there are no approvals;
- if: $isDraft() == false && $approvalsCount() < 1
then: $addLabel("waiting-for-review")

0 comments on commit fa6a5f8

Please sign in to comment.