GitXplorerGitXplorer
n

gitenforcer

public
16 stars
4 forks
3 issues

Commits

List of commits on branch master.
Unverified
b769214a299d136410301a4ba8407f86db70c91e

add the github client back to middleware options

nnlf committed 11 years ago
Unverified
594feacd9cb97d07ea4de3ef558c7bd0dbd4035d

bump version

nnlf committed 11 years ago
Unverified
c413f34884eecdbc763a99a1120c2483314654f8

total rewrite, makes more sense now

nnlf committed 11 years ago
Unverified
9f7b9119557ab6eb2e3397577e58d766130cf8a4

merged tweaks from old deploy

nnlf committed 12 years ago
Unverified
459bee21312c844ce9034242d437fc091f90f3bf

added an instance of github callback to middleware

nnlf committed 12 years ago
Unverified
191997164aa3d25e470b6627ed501a2b69565f28

change github urls

nnlf committed 12 years ago

README

The README file for this repository.

GitEnforcer

GitEnforcer is a small bot that you would run on your own server to monitor github pull requests. It comes with a very basic interface to allow you to watch or unwatch your repos. Any time a pull request is created, updated, or commented on, all defined middleware are run. If any middleware fails, the pull request status is set to failed with the reason returned by that failing middleware. If they all pass, the merge button remains green.

Configuration

Configuration is an object containing the following parameters

  • username - the username to authenticate as in github
  • password - the password associated with the username (it only uses basic auth)
  • organization (optional) - if you want to monitor an organization rather than a single user, specify one here
  • baseUrl - the base url (including hostname and port) of gitenforcer, i.e. http://enforcer.yourserver.com:8000
  • pollInterval (optional) - if specified, in seconds, how often to poll github for new repositories to add to the admin page. if not specified, polling will not take place.

Middleware

Middleware are functions defined as

function myMiddleware(pull_request, comments, next) { }

The pull_request object contains all the metadata github returns for a pull request as defined here

Comments is an array of comments on that pull request as defined here

Next is the callback function you should run when your check is complete. If you return no parameter, GitEnforcer will continue execution on the next middleware. If you specify a paramater (as a string) then execution of middleware stops, and that string is set as the reason for failure on the pull request's status.

Usage

var gitenforcer = require('gitenforcer'),
    app = gitenforcer(config);

app.listen(3000);

For basic usage, see example.js

To watch or unwatch a repo, visit the server in your browser.