GithubHelp home page GithubHelp logo

roccins / lookout Goto Github PK

View Code? Open in Web Editor NEW

This project forked from src-d/lookout

0.0 1.0 0.0 52.75 MB

Assisted Code Review

License: GNU Affero General Public License v3.0

Makefile 0.77% Go 97.47% Smarty 0.18% Dockerfile 0.07% PLpgSQL 1.51%

lookout's Introduction

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

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 it's 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.

lookout's People

Contributors

bzz avatar campoy avatar carlosms avatar dpordomingo avatar mcuadros avatar meyskens avatar smacker avatar smola avatar vmarkovtsev avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.