Skip to main content
Warning: You are using the test version of PyPI. This is a pre-production deployment of Warehouse. Changes made here affect the production instance of TestPyPI (testpypi.python.org).
Help us improve Python packaging - Donate today!

Simple cli and Flask web app for automatic GitHub issue tagging

Project Description
########
Githubot
########

A simple and little bit silly GitHub tagging script :)

Quickstart
==========

- Get your api key from GitHub
- Generate new :code:`auth.cfg` and :code:`rules.json` file with your github credentials
+ This is done by :code:`githubot genconfig` subcommand
+ By default config files are created and searched for in standard user
configuration directory specific for your OS (e.g. Linux - :code:`~/.config/githubot`)
- Create :code:`rules.json` file containing mapping rules :code:`regex` -> :code:`tag`
- Run :code:`githubot console` or :code:`githubot web` - see documentation below
+ For :code:`githubot web` you will need to setup a webhook in your repository
-Web server webhook endpoint is on :code:`/github_hook`


Usage
=====
::

Usage: githubot [OPTIONS] COMMAND [ARGS]...

Label issues on GitHub.com matching regexp in [rules] file

Options:
--help Show this message and exit.

Commands:
console Run the console app periodically checking GitHub
genconfig Generate new configuration (default in OS specific config directory)
web Run the web app reponding to GitHub webhooks


Genconfig subcomand
-------------------
::

Usage: githubot genconfig [OPTIONS]

Generate new configuration (default in OS specific config directory)

Options:
-t, --token TEXT GitHub API key
-s, --secret TEXT GitHub webhook shared secret
-d, --destination TEXT Specify alternative config destination path
--help Show this message and exit.


Web subcomand
-------------
::

Usage: githubot.py web [OPTIONS]

Run the web app reponding to GitHub webhooks

Options:
--debug Run flask in debug mode
--help Show this message and exit.

Console subcomand
-----------------
::

Usage: githubot.py console [OPTIONS] REPOSITORY

Run the console app periodically checking GitHub

Options:
-a, --auth PATH INI configuration file with GitHub API key
-r, --rules PATH JSON file with dictionary mapping regexp -> label
-p, --period INTEGER Update frequency
-d, --default-label TEXT Default tag when no rules apply
-v, --verbose Use -vv for maximal verbosity
--all-issues Include closed issues
--skip-body Do not match against issue body
--help Show this message and exit.

Configuration
=============

Auth format (defalut :code:`auth.cfg`)::

[github]
token = <YOUR_GITHUB_API_TOKEN>
secret = <YOUR_GITHUB_WEBHOOK_SHARED_SECRET>

Rules format is simple JSON dictionary (default :code:`rules.json`)::

{
"<REGEXP>": "<TAG>",
...
}


Tests
=====

Tests are only included in the pip archive but are not installed with the package sources.

Running tests:
--------------
::

python setup.py test --addopts -v


Re-recording betamax cassettes
------------------------------

1. You have to own a testing github repository with some issues.
2. You must setup correctly api key and webhook shared secret on GitHub
3. Delete all the provided cassettes in :code:`githubot/tests/fixtures/cassettes`
4. Run :code:`TOKEN=<YOUR_GITHUB_TOKEN> SECRET<YOUR_GITHUB_SECRET> python setup.py test --addopts -v`


Building documentation
======================

In the project directory (and possible with virtualenv_ activated)run::

pip install sphinx
cd docs
make html

The documentation is produced in :code:`docs/_build/html/index.html`.

.. _virtualenv: http://docs.python-guide.org/en/latest/dev/virtualenvs/
Release History

Release History

This version
History Node

0.5

History Node

0.4

History Node

0.3.15

History Node

0.3.14

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
githubot-0.5.tar.gz (23.9 kB) Copy SHA256 Checksum SHA256 Source Nov 8, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting