• Stars
    star
    170
  • Rank 223,357 (Top 5 %)
  • Language
    Python
  • License
    MIT License
  • Created almost 4 years ago
  • Updated about 1 month ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A terminal UI dashboard to monitor requests for code review across Github and Gitlab repositories.

Reviews

Tests pypi versions

Simplify requests for code review with an all-in-one TUI dashboard providing an overview of open PRs requiring review!

Quick Start

If you want to get up and running with Reviews, you will first first need to create a personal access token. To create a Personal Access Token with the required permissions for reviews, you can generate a new token (classic) and enable the following full scopes for the following:

  • repo
  • admin:org

Note: Whilst reviews only requires read only access, providing only public_repo and read:org permissions is insufficent as it does encompass all types of read-only access for repositories.

To start using reviews, you can run the following:

export GITHUB_USER="your-github-username"
export GITHUB_TOKEN="your personal GitHub token used for interacting with the API"
export REVIEWS_GITHUB_REPOSITORY_CONFIGURATION="apoclyps/reviews"

pip install --upgrade reviews

reviews config --show

reviews dashboard

asciicast

Additional Support

View Configuration

If you wish to view the configuration used by reviews at any time, you can use the following command to show all configuration (with secrets hidden or shown):

reviews config --hide

reviews config --show

Gitlab

If you wish to use reviews with Gitlab, you will need to specify the configuration like so: product id:project name/repository and use the --provider=gitlab flag when running reviews:

export GITLAB_USER=user
export GITLAB_TOKEN=token
export REVIEWS_GITLAB_REPOSITORY_CONFIGURATION="27629846:apoclyps/reviews"

reviews dashboard --provider=gitlab

Getting started with local development

To build and run the CLI on your host, you will need Python 3.9, pip, and virtualenv to build and run review. If you wish to publish a PR with your changes, first create a fork on Github and clone that code.

$ gh repo clone apoclyps/reviews
$ cd reviews
$ python3 -m venv env
$ source env/bin/activate
(env)$ pip install -r requirements_dev.txt
(env)$ pip install -r requirements.txt
(env)$ python -m reviews dashboard

If you wish to keep a copy of Reviews on your host system, you can install and run it using:

$ export REVIEWS_GITHUB_REPOSITORY_CONFIGURATION="apoclyps/reviews"
$ python -m venv env
$ source env/bin/activate
$ python -m pip install -e .
$ reviews -h

You can run the Reviews within Docker:

docker-compose build cli && docker-compose run --rm cli python -m reviews dashboard

To build an image and run that image with all of the necessary dependencies using the following commands:

$ docker-compose build cli
$ docker-compose run --rm cli python -m reviews dashboard

For instructions on setting up a development environment outside of Docker, check out the wiki.

Configuration

Reviews supports both .ini and .env files. Reviews always searches for configuration in this order:

  • Environment variables;
  • Repository: ini or .env file;
  • Configuration Path
  • Review Defaults

The following steps are used to provide the configuration using a .env or .ini file. The configuration can be read from within the module/repository (default location set by decouple) using the .env file or via a location specified by an environmental variable that points to a .ini file located in the root of the project or in a location specified by PATH_TO_CONFIG.

Using an .env file within the repository

cd /home/<your-user>/workspace/apoclyps/reviews
touch .env

echo "REVIEWS_REPOSITORY_CONFIGURATION=apoclyps/micropython-by-example" >> .env
python -m reviews config

Using an .ini file within the repository

cd /home/<your-user>/workspace/apoclyps/reviews
touch settings.ini
echo "[settings]\nREVIEWS_REPOSITORY_CONFIGURATION=apoclyps/micropython-by-example" >> settings.ini

python -m reviews config

Providing a configuration path

If you wish to set the configuration path to use an ini or .env file when running the application, you can use the configuration of a specific file by supplying the path to the configuration like so:

cd /home/apoclyps/
touch settings.ini
echo "[settings]\nREVIEWS_REPOSITORY_CONFIGURATION=apoclyps/micropython-by-example" >> settings.ini

cd /home/<your-user>/workspace/apoclyps/reviews
export REVIEWS_PATH_TO_CONFIG=/home/<your-user>/

python -m reviews config

If at any time, you want to confirm your configuration reflects the file you have provided, you can use reviews config to view what current configuration of Reviews.

Testing

A test suite has been included to ensure Reviews functions correctly.

To run the entire test suite with verbose output, run the following:

$ pytest -vvv

Alternatively, to run a single set of tests.

$ pytest -vvv tests/test_config.py

All tests can be run within docker by using the following command:

$ docker-compose build pytest && docker-compose run --rm pytest

Linting

To run individual linting steps:

docker-compose build test
docker-compose run --rm --no-deps test isort .
docker-compose run --rm --no-deps test black --line-length 119 --check .
docker-compose run --rm --no-deps test mypy .
docker-compose run --rm --no-deps test flake8 .
docker-compose run --rm --no-deps test pylint --rcfile=.pylintrc reviews
docker-compose run --rm --no-deps test bandit reviews
docker-compose run --rm --no-deps test vulture --min-confidence 90 reviews
docker-compose run --rm --no-deps test codespell reviews
docker-compose run --rm --no-deps test find . -name '*.py' -exec pyupgrade {} +

You can also set up pre-commit to run the linting steps automatically during the commit phase, the pre-commit pipeline can be set up by running the following command on the project root:

pre-commit install

Contributions

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

More Repositories

1

my-dev-space

Contributions Welcome: A developer community for everyone with an interest in Technology & Meetups
Python
21
star
2

deps

deps: A terminal UI dashboard to monitor python dependencies across a Github organisation
Python
9
star
3

magic-home

A CLI and library written in Go for controlling Magic Home LED Strip Controllers.
Go
4
star
4

Comicvine-GrapeJuice

A java wrapper for the comic vine API.
JavaScript
2
star
5

knowledge-base

This knowledge base is a living document built with the sole purpose of sharing my development practices and preferences in a reproducible way.
2
star
6

PIM-Barcode-Util

A barcode encoder/decoder using Zxing for populating a database.
Java
1
star
7

python-package-publish

An example Python package published using an automated workflow to Gemfury
Python
1
star
8

kafka-by-example

An introduction to Kafka using examples
Python
1
star
9

ingestion

Converts CSV to JSON
Python
1
star
10

mergeforces

Need faster code reviews? Mergeforces can help!
Python
1
star
11

BBC-News-Hack-II

Dundee Universitys entry into the BBC News Hack
JavaScript
1
star
12

merged

A TUI to monitor the duration of time a pull request is opened between ready to review and merged/closed for a Github Repository.
Python
1
star
13

django-heroku-seed

A django heroku seed project containing postgres config & bootstrap.
HTML
1
star
14

SoC-Manchester-Baby

A assembler and baby writtein in c/c++.
1
star
15

SVIP-CodeTest

Silicon Valley Internship Program - HashMap Code Challenge
Java
1
star
16

Witlr-Doomed-Jobs

Witlr.com 6 hour hackathon
CSS
1
star
17

elasticsearch-by-example

A gentle introduction to Elasticsearch with examples using local user-group event data
Python
1
star