Next generation pull requests and issues 🦄
For questions, check out the GitHub discussions.
For documentation, check out this document and the official documentation.
Join our community on Discord!
To start using Reviewpad, check out our website.
Reviewpad is a service to automate pull requests and issues workflows.
The workflows are specified in a YML-based configuration language described in the official documentation.
In Reviewpad, you can automate actions over the pull requests and issues such as:
As an example, the following workflow:
labels:
ship:
description: Ship mode
color: "#76dbbe"
workflows:
- name: ship
description: Ship process - bypass the review and merge with rebase
run:
- if: $hasFileExtensions([".md"])
then:
- $addLabel("ship")
- $merge()
Automatically adds the label ship
and merges all pull requests that only change .md
files.
You can execute Reviewpad through the CLI or install Reviewpad GitHub App.
This repository generates two artifacts:
Conceptually, the packages are divided into four categories:
spec
property of the rules and also the actions of the workflows. The engine of Reviewpad is not specific to Aladino - this means that it is possible to add support for a new language such as Javascript
or Golang
in these specifications.plugins/aladino
, it contains the implementations of the built-ins.Before you begin, ensure you have met the following requirements:
go install golang.org/x/tools/cmd/goyacc@master
).INPUT_SEMANTIC_SERVICE
. You can do this by running the following command in your terminal: export INPUT_SEMANTIC_SERVICE="0.0.0.0:3006"
.INPUT_ROBIN_SERVICE
. You can do this by running the following command in your terminal: export INPUT_ROBIN_SERVICE="0.0.0.0:3011"
.INPUT_CODEHOST_SERVICE
. You can do this by running the following command in your terminal: export INPUT_CODEHOST_SERVICE="0.0.0.0:3004"
.We use Taskfile. To compile the packages simply run:
task build
To generate the CLI run:
task build-cli
This command generates the binary reviewpad-cli
which you can run to try Reviewpad directly.
The CLI has the following argument list:
./reviewpad-cli
reviewpad-cli is command line interface to run reviewpad commands.
Usage:
reviewpad-cli [command]
Available Commands:
check Check if input reviewpad file is valid
completion Generate the autocompletion script for the specified shell
help Help about any command
run Runs reviewpad
Flags:
-f, --file string input reviewpad file
-h, --help help for reviewpad-cli
Use "reviewpad-cli [command] --help" for more information about a command.
Run the tests with:
task test
If you get the error:
panic: httptest: failed to listen on a port: listen tcp6 [::1]:0: socket: too many open files [recovered]
panic: httptest: failed to listen on a port: listen tcp6 [::1]:0: socket: too many open files
You can solve with:
ulimit -Sn 500
To generate the coverage report run:
task test
To display the code coverage for every package run:
go tool cover -func coverage.out
To display the total code coverage percentage run:
go tool cover -func coverage.out | grep total:
The integration tests run Reviewpad on an actual repository and pull request. The repository where the integration tests run requires the following setup:
bug
, documentation
, wontfix
(GitHub adds these labels to every new repository by default);integration-test
with at least 3 members;[INTEGRATION TESTS] Reviewpad
with Todo
and In Progress
statuslog event
.GITHUB_INTEGRATION_TEST_TOKEN
: GitHub access token used to setup tests and run ReviewpadGITHUB_INTEGRATION_TEST_REPO_OWNER
: The owner of the repository used to run integration tests onGITHUB_INTEGRATION_TEST_REPO_NAME
: The name of the repository used to run integration tests onAfter setting these variables, you can run the integration tests with:
task integration-test
We strongly recommend using VSCode with the following extensions:
reviewpad.yml
JSON schema.Open the project in VSCode, open the command palette (Ctrl+Shift+P) and search for Preferences: Open Workspace Settings (JSON)
.
Paste the following configuration:
{
// Licenser configuration
"licenser.license": "Custom",
"licenser.author": "Explore.dev, Unipessoal Lda",
"licenser.customHeader": "Copyright (C) @YEAR@ @AUTHOR@ - All Rights Reserved\nUse of this source code is governed by a license that can be\nfound in the LICENSE file.",
// Associate Reviewpad schema to reviewpad.(yml|yaml) files
"yaml.schemas": {
"https://raw.githubusercontent.com/reviewpad/schemas/main/latest/schema.json": [
"reviewpad.yml",
]
},
// Go configuration
"go.testFlags": [
"integration"
],
"go.buildFlags": [
"-tags=integration"
],
}
Add the following to your .vscode/launch.json
.
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch CLI",
"type": "go",
"request": "launch",
"mode": "debug",
"args": [
"run",
// Flag to run on dry run (optional. Default is false)
"-d",
// Flag to run on safe mode (optional. Default is false)
"-s",
// Flag to define the log level (optional. Default is debug)
"-l=debug",
// GiHub personal access token.
// To generate a token, go to https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token.
"-t=<GIT_HUB_TOKEN>",
// Absolute path to reviewpad.yml file to run.
"-f=<PATH_TO_REVIEWPAD_FILE>",
// GitHub URL of the pull request / issue.
// The reviewpad.yml file provided with the -f flag will run against this pull request / issue.
// This URL should be same the URL of the pull request / issues in the GitHub event provided with the -e flag.
// For instance, if you are using a GitHub event of a comment on the pull request X, the -u flag should be the URL of the pull request X.
"-u=<GITHUB_URL>",
// Absolute path to JSON file with GitHub event.
// This GitHub event body defines the action that will run on the pull request / issue.
// To get the GitHub event body, follow the instructions on https://github.com/reviewpad/reviewpad#how-to-get-the-github-event-body-internal-use-only
"-e=<PATH_TO_GITHUB_EVENT_BODY>"
// The GitHub event type
// Determines how the events JSON file will be processed
// To get the GitHub event body, follow the instructions on https://github.com/reviewpad/reviewpad#how-to-get-the-github-event-type-internal-use-only
"-y=<GITHUB_EVENT_TYPE>"
],
"env": {
"INPUT_CODEHOST_SERVICE": "<CODEHOST_SERVICE_ENDPOINT>",
"INPUT_SEMANTIC_SERVICE": "<SEMANTIC_SERVICE_ENDPOINT>",
"INPUT_ROBIN_SERVICE": "<ROBIN_SERVICE_ENDPOINT>",
},
"program": "${workspaceFolder}/cli/main.go"
}
]
}
The -e
flag is mandatory to run the debugger.
It represents the GitHub event that you wish to run the reviewpad.yml file against.
To extract a GitHub event, please follow the steps below:
reviewpad
check under the Checks
tab.DETAILS
section of the check copy the Delivery ID
.{$.delivery_id="[Delivery ID]" && $.msg="request received"}
body
field.cli > debugdata
with a name that ends with .json
(e.g. my_event.json
) and paste the content inside the file.Ctrl+Shift+P
and searching for JSON: Parse Stringified JSON
.-e
to point to the full path of the file you just created.The -y
flag is mandatory to run the debugger.
It represents the type of GitHub event that you wish to run the reviewpad.yml file against.
To get the GitHub event type, please follow the steps below:
reviewpad
check under the Checks
tab.DETAILS
section of the check copy the Event Type
.-y
flag.If you wish to use the logs of the Entry Gate to the event type, please follow the steps below:
{$.delivery_id="[Delivery ID]" && $.msg="request received"}
headers.X-GitHub-Event
field.-y
flag.We welcome contributions to Reviewpad from the community!
See the Contributing Guide.
If you need any assistance, please join discord to reach the core contributors.
Reviewpad is available under the GNU Lesser General Public License v3.0 license.
See LICENSE for the full license text.