A custom issue tracker for GitHub with issue ranking/scoring, and bot templated responses
Switch branches/tags
Nothing to show
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
config DO_NOT_CLOSE_MIN_COMMENTS w/ 0 Dec 30, 2015
static updates Dec 30, 2015
tasks add collection repeat Mar 4, 2016
templates afsd Dec 30, 2015
tests update labels Feb 19, 2016
.gitignore updates Jan 18, 2015
LICENSE Create LICENSE Jan 18, 2016
Procfile use redis queue instead of threads Jan 5, 2015
decorators.py Handle crossdomain request Jan 3, 2015
github_api.py import os Jan 20, 2016
main.py fix GH webhook Jan 20, 2016
models.py references/milestone Feb 9, 2015
readme.md Update readme.md Jan 19, 2016
requirements.txt update Dec 30, 2015
util.py updates Dec 30, 2015
worker.py use redis queue instead of threads Jan 5, 2015

readme.md

ionitron-issues

Ionic's proof-of-concept utility for automatically ranking and responding to GitHub Issues

IMPORTANT: This is not a supported project. We will not be able to respond to issues or PRs. Feel free to fork and customize for your project

Overview:

ionitron-github is a github bot that watches the Ionic repo, and will take action when certain webhook events are received. Ionitron also performs a number of repo maintenance tasks that are triggered by daily cronjobs. All actions can be customized by changing the variables in config.py. See config.py for a full list of options. Below is a checklist outlining current and future features.

Requires

  • python
  • pip
  • virtualenv
  • postgres brew install postgresql
  • redis-server

Running Locally / Development:

1) Install/create Virtual Environments:

pip install virtualenv
cd ionitron-issues
virtualenv venv

2) Start virtualenv

source venv/bin/activate

3) Install the Python (2.7.3) dependencies:

pip install -r requirements.txt

4) Add the same environmental variables that are assigned in the Heroku app

The template variables can be changed to point to a local file to test messages on a test repo. This is useful to test repo webhooks, and the responses that should be returned.

5) Install redis-server. This is used as a task queue for cron jobs such as removing old issues, updating issue scores, etc. It is also used as a cache; issue data is persisted and updated daily, or when the issue receives an update event. Finally, redis stores common data about the repo, organization, contributors, etc. Redis-server needs to be started in the background before the app can be run:

redis-server

4) Start the app server:

python main.py

Test Github API Access

Run the app server, then visit `/api/test`

Run Unit Tests

python -m unittest discover

Debug Mode:

If debug=True, all of the cronjob tasks below will run, but won't take action to close/warn the issues. Instead, the issues that would have been closed/warned are printed out to the console. This is useful if you want to tweak the configurations, and see how the changes impact what should be closed/warned, without actually doing it.

API Testing

  • Manually run one issue's maintenance: https://ionitron-issues.herokuapp.com/api/driftyco/ionic/200/maintenance
  • Manually run all maintenance: https://ionitron-issues.herokuapp.com/api/maintenance
  • Issue scores: https://ionitron-issues.herokuapp.com/api/driftyco/ionic/issue-scores

Deploying:

heroku git:remote -a ionitron-issues && git push heroku master

Check out this article for more info. The redis-to-go addon must be configured if starting from a new Heroku app.

Tasks:

  • Close github issues older than $CLOSE_INACTIVE_AFTER days. Adds a comment based on the remote markdown template defined in $CLOSING_TEMPLATE.
  • Remove the 'needs reply' label if the user replied since the label was added.
  • Close github issues that haven't received a reply after $CLOSE_NOREPLY_AFTER days after the needs reply label has been added. Adds a comment based on the remote markdown template defined in $CLOSING_NOREPLY_TEMPLATE.
  • Add a comment to all issues not submitted through Ionic's issue submit form containing a link to resubmit the issue. Also adds the ionitron: please resubmit label to the issue.
  • Remove the ionitron: please resubmit label if the user updated their issue through the custom form.
  • Delete any issues labeld with ionitron: please resubmit after 7 days
  • Score each issue daily and when updated.
  • Get a list of all open issue scores.
  • Run maintenance tasks on all open issues daily.
  • Manually add templated comments and ability to close issues from the issues app, as Ionitron