How tdsmith/github-snooze-button works
Project type and purpose
• This is a Python-based, event-driven, serverless “wrapper” around GitHub issues/PRs: it watches for comments and PR updates on GitHub, and when you “snooze” an issue (by adding a label), it automatically unsnoozes (removes the label) once activity resumes.
• It ships as a CLI/packaged PyPI module and can run either in AWS Lambda (via SNS) or locally by polling an SQS queue.
File structure
• Top-level:
• setup.py / setup.cfg, tox.ini / .travis.yml → build, test, CI.
• snooze/
– deploy_lambda.py → CLI entrypoint snooze_deploy, builds AWS infra: IAM role, SNS topics, Lambda functions.
– lambda_handler.py → the AWS Lambda handler receiving SNS events.
– repository_listener.py → polling client for SQS in “listen” mode.
– callbacks.py → encapsulates the core logic that inspects events and calls GitHub to remove labels.
– config.py, constants.py, version.py → config loading and versioning.
– snooze.py → shared routines.
– test/ → unit tests for each component.
README for additional insights
• Two modes:
Option 1: AWS Lambda deployment.
Option 2: Local/SQS polling.
• Uses GitHub Webhooks → AWS SNS → AWS Lambda (or SQS) → Python handler → GitHub API.
• Configuration via an INI file: GitHub credentials, AWS credentials, label names per repo.
Detail
• Break out modules in the snooze/ directory and map them onto runtime components:
• deploy_lambda.py → “Infra Provisioner”
• lambda_handler.py + callbacks.py → “Event Processor”
• repository_listener.py → “SQS Poller”
• config.py → “Config Loader”
• AWS resources (IAM role, SNS topics, Lambda) and code boundaries.