Assisted Code Review
Clone or download
Latest commit d340654 Nov 14, 2018
Permalink
Failed to load latest commit information.
cmd make timeouts configurable Nov 8, 2018
docker Use COPY instead of ADD in Dockerfile Nov 1, 2018
docs increase default timeouts Nov 13, 2018
dummy Update git storage init for new go-git version Oct 19, 2018
fixtures Refactor cmd/server-test to use go test Aug 27, 2018
mock enry and purge services Aug 13, 2018
provider increase default timeouts Nov 13, 2018
queue Add concurrent queue job processing Oct 18, 2018
sdk add new flag to sdk/README Oct 9, 2018
server make timeouts configurable Nov 8, 2018
service increase default timeouts Nov 13, 2018
store migration that removes old internal id Oct 9, 2018
util Refactor integration test grep utils Oct 31, 2018
vendor update logrus version to 1.1.1 Oct 26, 2018
.drone.yml Added missing namespace in helm config Nov 13, 2018
.gitignore remove code generation from proto files scripts Sep 4, 2018
.helm-staging.yml Added terraform analyzer Nov 13, 2018
.lookout.yml .lookout.yml configures dummy instead of gometalint Sep 19, 2018
.travis.yml Update docker-compose and travis to bblfshd 2.9 Oct 10, 2018
CONTRIBUTING.md Doc improvements: typos, style Sep 26, 2018
DCO Add LICENSE and README Jul 20, 2018
Gopkg.lock update logrus version to 1.1.1 Oct 26, 2018
Gopkg.toml Add golang-lru dependency Oct 17, 2018
LICENSE Add LICENSE and README Jul 20, 2018
MAINTAINERS Carlos is the maintainer Oct 10, 2018
Makefile Add -parallel 1 to integration tests Oct 31, 2018
Makefile.dummy makefile: move SDK packaging to separate file Sep 3, 2018
Makefile.sdk makefile: move SDK packaging to separate file Sep 3, 2018
README.md Fix flake8 description in README Nov 14, 2018
analysis.go change imports to sdk Sep 5, 2018
config.yml.tpl documentation for timeouts Nov 8, 2018
data.go change imports to sdk Sep 5, 2018
data_test.go change imports to sdk Sep 5, 2018
doc.go add more docs Jun 15, 2018
docker-compose.yml Update docker-compose and travis to bblfshd 2.9 Oct 10, 2018
event.go change imports to sdk Sep 5, 2018
poster.go Add a feedback footer to each GitHub comment Aug 2, 2018
watcher.go Add a mem cache to watcher job enqueuer Oct 17, 2018
watcher_test.go Add a mem cache to watcher job enqueuer Oct 17, 2018

README.md

lookout Build Status GoDoc Code Coverage Go Report Card development

A service for assisted code review, that allows running custom code Analyzers on pull requests.

Table of Contents

Configuring lookout

Please refer to the Configuring lookout guide for documentation for the config.yml file.

Usage

Running lookout with docker-compose

Using Docker Compose you can use the provided docker-compose.yml config file to start lookout, its dependencies (bblfsh and PostgreSQL) and the dummy analyzer which will add some stats to the watched pull requests.

To do so, clone this repository or download docker-compose.yml.

Create the config.yml file in the same directory where docker-compose.yml is, and run:

$ docker-compose pull
$ GITHUB_USER=<user> GITHUB_TOKEN=<token> docker-compose up --force-recreate

If you need to restart the database to a clean state, you can do so with:

$ docker rm lookout_postgres_1

Running lookout from Binaries

Installation

Go to the lookout releases page and download the latest lookoutd and dummy binaries from there.

Dependencies

lookout needs a running instance of:

You will also need to configure external Analyzers, that will perform the actual processing of the pull requests. You may use the included dummy Analyzer for testing purposes.

Quickstart

Following these steps you will be able to run separately the lookout dependencies, analyzers and the server itself.

  1. Run the dependencies manually or using docker-compose, executing:

    $ docker-compose up bblfsh postgres
  2. Initialize the database.
    This command will work for the PostgreSQL created by docker-compose, use -h to see other options.

    $ lookoutd migrate
  3. Start an analyzer before running lookout.
    You can use the dummy one as it is provided by this repository; to do so just run:

    $ dummy serve
  4. Copy the config.yml.tpl into config.yml and add the URLs of the repositories to be watched. Take a look at configuration and GitHub authentication for more details about lookout configuration.

  5. Start lookout server
    If you want to post the analysis results on GitHub, run:

    $ lookoutd serve --github-token <token> --github-user <user>

    If you want to avoid posting the analysis results on GitHub, and only print them, run:

    $ lookoutd serve --dry-run

Running in Distributed Mode

Note: This is a work in progress feature.

Please refer to the Running in Distributed Mode guide for documentation on the advanced distributed deployment.

Available Analyzers

This is a list of the available analyzers for lookout:

Name Description Maturity level
style-analyzer Code style analyzer development
gometalint Reports gometalinter results on pull requests testing and demo
sonarcheck An analyzer that uses bblfsh UAST and sonar-checks to process pull requests testing and demo
terraform An analyzer that checks if Terraform files are correctly formatted usable
flake8 Reports flake8 results on pull requests (for Python) testing and demo

SDK for Analyzer Developers

If you are developing an Analyzer, please check the SDK documentation.

Development

Build

You can separately build the binaries provided by lookout; the binaries will be stored under build/bin directory.

server:

$ make build

lookout-sdk:

$ make -f Makefile.sdk build

dummy analyzer:

$ make -f Makefile.dummy build

Code generation

To generate go code from kallax models, run:

$ go generate ./...

To update go-bindata with the new migration files:

$ kallax migrate --input ./store/models/ --out ./store/migrations --name <name>
$ make dependencies
$ make bindata

Testing

For unit-tests run:

$ make test

For lookout-sdk integration tests (-short will skip tests that require bblfsh):

$ make test-sdk
$ make test-sdk-short

For lookoutd serve integration tests:

$ make test-json

Dummy Analyzer Release

Dummy analyzer is a simple analyzer implementation example. It is part of the lookout codebase but its release cycle is managed independently from main one.

To release a new version and publish the dummy analyzer container you need to create a tag with the dummy prefix, e.g. dummy-v0.0.1. Please note this doesn't require to do a GitHub release, we just need the Git tag.

A normal release tag will not publish this container.

Contribute

Contributions are more than welcome, if you are interested please take a look at our Contributing Guidelines.

Code of Conduct

All activities under source{d} projects are governed by the source{d} code of conduct.

License

Affero GPL v3.0, see LICENSE.