Skip to main content

Snooze button for Github issues

Project description

Projects with a lot of issue volume accumulate a lot of open issues which are not immediately actionable, usually because they’re waiting for a response from a contributor. There’s no easy way to hide those from the Github interface or signal to other maintainers that an open issue or PR isn’t actionable yet.

Enter github-snooze-button!

Add a “snooze” label to an issue, and github-snooze-button will remove the label whenever

  • an issue or pull request receives a comment,

  • a pull request receives a comment on a diff, or

  • a pull request branch is updated.

github-snooze-button can operate in two modes: deployed to AWS Lambda, or polling a Amazon SQS queue locally.

Configuration file

github-snooze-button uses .ini-style configuration files that look like:

[default]
github_username = your_username
github_token = your_token
aws_key = your_key
aws_secret = your_secret
snooze_label = snooze
# aws_region = us-west-2 # optional

[your_username/repo1]

[your_username/repo2]
snooze_label = response required

The AWS credentials in the config file are sent to Github and used to push notifications into SNS. The listener also uses them to consume events from SQS. They are not used to configure the Lambda deployment.

Option 1: AWS Lambda deployment

  1. Generate a Github authentication token with public_repo and admin:repo_hook scopes. (Note that public_repo gives write permission! These credentials will be embedded in the Lambda deployment package, so you should consider the contents of the deployment package sensitive.)

  2. Save AWS credentials with these permissions or better to a place boto can find them: either in the environment or in a configuration file.

  3. Install github-snooze-button: pip install git+https://github.com/tdsmith/github-snooze-button.git

  4. Launch with snooze_deploy /path/to/config.ini. snooze_deploy will:

    • Build deployment packages for each repository

    • Define or re-use a /tdsmith/github-snooze-button/snooze_lambda_role IAM role with the AWSLambdaBasicExecutionRole policy

    • Create or re-use SNS topics for each repository

    • Configure each Github repository to push notifications to SNS

    • Create or update a Lambda function for each repository

    • Give each SNS topic permission to invoke its matching Lambda function and create a subscription connecting them

And now you’re live.

Option 2: Polling mode

  1. Generate a Github authentication token with public_repo and admin:repo_hook scopes.

  2. In AWS IAM, create a Amazon AWS user with all the AmazonSQS* and AmazonSNS* policies (and possibly fewer?)

  3. Install github-snooze-button: pip install git+https://github.com/tdsmith/github-snooze-button.git

  4. Launch with snooze_listen /path/to/config.ini

Note that the queue will continue collecting events unless you disconnect the repository from SNS.

Teardown

The fastest way to disable github-snooze-button is by deleting the Amazon SNS service from your repository’s “Webhooks & services” configuration page. It will be automatically recreated the next time you run snooze in either mode.

Questions

  • Will this cost me lots of money? Probably not. Lambda, SNS and SQS are both free for the first million transactions a month. Homebrew uses a few hundred transactions a day. YMMV!

Contact

Tim D. Smith: snooze at tds.xyz, Freenode: tdsmith, @biotimylated

Project details


Download files

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

Source Distribution

github-snooze-button-0.1.0.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

github_snooze_button-0.1.0-py2.py3-none-any.whl (11.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file github-snooze-button-0.1.0.tar.gz.

File metadata

File hashes

Hashes for github-snooze-button-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d4496a895d02d6eaa68ed64c2a7100e12c3987a9dc560e8138260a1863990610
MD5 7b8dfbb561caf55c0c27f1bc62e79de1
BLAKE2b-256 caf92398ecd3959e43abd1ee57ef29441c34df8e8538a482d1a820b88a5ba44a

See more details on using hashes here.

File details

Details for the file github_snooze_button-0.1.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for github_snooze_button-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 48980671b8ab98c220557c30210b88be97bc8f0e58db3ccd63030226a94c5bd3
MD5 9caa074a0509118d794fa67685b37263
BLAKE2b-256 f7dbd5532ce5e03416d297fce03cd28bcb179ac796f19c75a9cbe4e0207b7c46

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page