Package: github-snooze-button
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 wheneveran issue or pull request receives a comment,a pull request receives a comment on a diff, ora 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 filegithub-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]
ignore_member_of = cool_organization  # ignore comments from members of an organization

[your_username/repo2]
snooze_label = response requiredThe 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 deploymentGenerate a Github authentication token withpublic_repo,admin:repo_hook, and (if you’re usingignore_member_of,org:read) scopes. (Note thatpublic_repogives write
permission! These credentials will be embedded in the Lambda
deployment package, so you should consider the contents of the
deployment package sensitive.)Save AWS credentials withthese permissions or
betterto a place boto can find them: eitherin the
environmentor in aconfiguration
file.Install github-snooze-button:pip installgit+https://github.com/tdsmith/github-snooze-button.gitLaunch withsnooze_deploy /path/to/config.ini.snooze_deploywill:Build deployment packages for each repositoryDefine or re-use a/tdsmith/github-snooze-button/snooze_lambda_roleIAM role with
theAWSLambdaBasicExecutionRolepolicyCreate or re-use SNS topics for each repositoryConfigure each Github repository to push notifications to SNSCreate or update a Lambda function for each repositoryGive each SNS topic permission to invoke its matching Lambda
function and create a subscription connecting themAnd now you’re live.Option 2: Polling modeGenerate a Github authentication token withpublic_repoandadmin:repo_hookscopes.In AWS IAM, create a Amazon AWS user with all the AmazonSQS* and
AmazonSNS* policies (and possibly fewer?)Install github-snooze-button:pip installgit+https://github.com/tdsmith/github-snooze-button.gitLaunch withsnooze_listen /path/to/config.iniNote that the queue will continue collecting events unless you
disconnect the repository from SNS.TeardownThe 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.QuestionsWill this cost me lots of money?Probably not. Lambda,SNSandSQSare both free for the
first million transactions a month. Homebrew uses a few hundred
transactions a day. YMMV!ContactTim D. Smith: snooze at tds.xyz, Freenode: tdsmith, @biotimylated