Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ifokeev/github-codequality-service
Micro server that watches Github pull requests and comments on code violations
https://github.com/ifokeev/github-codequality-service
heroku nodejs pronto rubocop ruby
Last synced: 3 days ago
JSON representation
Micro server that watches Github pull requests and comments on code violations
- Host: GitHub
- URL: https://github.com/ifokeev/github-codequality-service
- Owner: ifokeev
- Created: 2017-04-10T11:58:16.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-04-10T12:48:09.000Z (almost 8 years ago)
- Last Synced: 2024-12-14T19:36:29.083Z (about 2 months ago)
- Topics: heroku, nodejs, pronto, rubocop, ruby
- Language: Ruby
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Micro server that watches Github pull requests and comments on code violations.
Based on [Watchdog](https://github.com/GratifyCommerce/watchdog)
- Free alternative to [Hound](https://houndci.com): deploy it on a free Heroku dyno.
- No need to configure a CI server: useful if your CI server has limitations, or if you want to introduce automated code checks in a team with minimal effort.
- Based on [Pronto](https://github.com/mmozuras/pronto) and [Sinatra](http://www.sinatrarb.com).## Deploying to Heroku
0. Choose a Github user (or create a [dedicated one](https://github.com/vicidog)) that will be linked to watchdog when commenting pull requests. Make sure the user has access to any private repository you want to analyze.
0. [Create a Github access token](https://github.com/settings/tokens) for this user and make sure the `read:repo_hook` scope is ticked. Note that token down for later.
0. Install the [Heroku Toolbelt](https://toolbelt.heroku.com) CLI. If on OSX:
```
brew install heroku-toolbelt
```0. Login to Heroku if it is not already the case:
```
heroku login
```0. Go to the watchdog directory and deploy:
```
heroku create your_app_nameheroku config:set GITHUB_USERNAME=your_github_username \
GITHUB_PASSWORD=your_github_password \
GITHUB_ACCESS_TOKEN=your_github_access_token# The commands below may take a while to execute
heroku buildpacks:add https://github.com/heroku/heroku-buildpack-apt
heroku buildpacks:add heroku/nodejs
heroku buildpacks:add heroku/rubygit push heroku master
```0. https://your_app_name.herokuapp.com should display "{success: true}".
0. Go to the Github project(s) you want to analyze, add the https://your_app_name.herokuapp.com/pull_request_events webhook, and make it trigger only for Pull Request events.
You can also do this organization-wide for all your projects by going to https://github.com/organizations/your_organization/settings/hooks.
0. Profit.
## Contributing
To run the server on your local machine, you will need to install [Ruby](https://www.ruby-lang.org) with the version indicated in [this file](https://raw.githubusercontent.com/VicinityCommerce/watchdog/master/.ruby-version) and install bundler.
Then:
0. Install CMake. If on OS X:
```
brew install cmake
```0. Install dependencies:
```
bundle
```0. Copy `.env.example` to `.env` and fill in the variables with real values.
0. Run the server:
```
bundle exec rackup
```0. [http://localhost:9292](http://localhost:9292) should display "{success: true}".
0. If you want to test the `POST` [http://localhost:9292/pull_request_events](http://localhost:9292/pull_request_events) webhook with real Github data, you will need to use a tool like [ngrok](https://ngrok.com) to make your server publicly reachable. For ngrok, the command would be `ngrok http 9292`.