Skip to main content

Slack and GitHub integration for automating code review requests

Project description

review-request

A Slack bot and GitHub integration for automating code review requests. Engineers use a Slack slash command to broadcast a PR review request to their channel; a scheduled script scans GitHub for open PRs and reminds teams daily; a Jira webhook posts sprint completion summaries.

Features

  • Slash command/review [PR URL] [@reviewer or #channel] [--scheduled=YYYY/MM/DD HH:MM:SS]
  • Daily PR reminder — scans configured GitHub repositories, finds open PRs assigned to a team, and posts a Slack digest
  • Jira sprint webhook — posts a summary when a Jira sprint closes
  • Jira overdue reminder — alerts a team about Jira issues that are in-progress past their due date

Setup

Requirements: Python 3.11+

python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"

Create a .env file:

GITHUB_TOKEN=...
BOT_TOKEN=xoxb-...
CHANNEL_ID=C...
SLACK_SIGNING_SECRET=...
ROLLBAR_ACCESS_TOKEN=...
JIRA_SITE=https://yourorg.atlassian.net
JIRA_EMAIL=you@example.com
JIRA_API_TOKEN=...
APP_URL=https://your-deployment-url    # optional, for bot icon
MAX_AGE_PR_DAYS=60                     # optional, default 60

Running

# Web server (Slack slash command + Jira webhooks)
uvicorn main:app --reload

# Scheduled scripts (typically run via cron)
pr-reminder [--dry-run]
jira-overdue-reminder

Slash Command Usage

The bot accepts a slash command payload with the following format in the text field:

<PR_URL> [@user or #channel or @group] [--scheduled=2025/12/01 09:00:00]

Examples:

  • https://github.com/org/repo/pull/123 @alice #code-review — post immediately to #code-review tagging @alice
  • https://github.com/org/repo/pull/123 @squad-eternals — post to the invoking channel tagging the usergroup
  • https://github.com/org/repo/pull/123 --scheduled=2025/12/01 09:00:00 — schedule delivery (GMT+7)

If no reviewer is specified, the bot falls back to the team(s) already requested on the GitHub PR. Up to 2 PR URLs can be submitted in a single command.

Configuration

Team-to-channel mappings, the list of GitHub repositories to scan, and reminder schedules are all hardcoded in src/review_request/config/settings.py:

  • GITHUB_REPOSITORIES — repos scanned by pr-reminder
  • GITHUB_TEAM_REMINDER_MAPPING — maps a GitHub team slug to a Slack channel and usergroup, with the days reminders should fire
  • JIRA_TEAM_REMINDER_MAPPING — JQL query + channel mapping for the Jira overdue reminder
  • SLACK_TEAM_MAPPINGS — overrides for Slack @handle → group ID when a reviewer handle appears in GitHub PR reviewer lists

API Endpoints

Method Path Description
POST /conversation/ Slack slash command handler
POST /jira/sprint/webhook?channel_id=... Jira sprint-closed webhook
POST /jira/sprint/notify Manual sprint completion notification

Development

pytest                          # run all tests
pytest tests/path/test.py::fn   # run a single test
ruff check src/ && black src/   # lint and format
mypy src/                        # type check
pre-commit run --all-files       # run all pre-commit hooks

Publishing

Merging to main automatically publishes to PyPI via GitHub Actions using OIDC trusted publishing (no stored token required).

Before merging, bump the version so PyPI doesn't reject a duplicate:

./scripts/bump_version.sh          # patch bump (0.1.0 → 0.1.1)
./scripts/bump_version.sh minor    # minor bump (0.1.0 → 0.2.0)
./scripts/bump_version.sh major    # major bump (0.1.0 → 1.0.0)

This updates pyproject.toml and src/review_request/__init__.py in one step.

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

review_request-0.1.2.tar.gz (32.2 kB view details)

Uploaded Source

Built Distribution

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

review_request-0.1.2-py3-none-any.whl (42.3 kB view details)

Uploaded Python 3

File details

Details for the file review_request-0.1.2.tar.gz.

File metadata

  • Download URL: review_request-0.1.2.tar.gz
  • Upload date:
  • Size: 32.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for review_request-0.1.2.tar.gz
Algorithm Hash digest
SHA256 b4a6f3afab37a679fa0c41f94351552b87e1c492b6e24b9d5079673da1b17f29
MD5 fbd4635f381d21df0a97c9fca37a08e4
BLAKE2b-256 486ca022dc1bda212d648aa7dcb1e9d62a0ceab07ea62f893accaf5f8a6c96d9

See more details on using hashes here.

Provenance

The following attestation bundles were made for review_request-0.1.2.tar.gz:

Publisher: publish.yml on kingkong0905/review-request

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file review_request-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: review_request-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 42.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for review_request-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 12a0882fea80750648ee505ad9b3bc156b2306e20e95c8436862631e13bc87ee
MD5 26439b2ee07dfabcb3b68ff15510e0a3
BLAKE2b-256 ce97acd71abde00dade3d03969b09ff68f33ad036f4f2dcf66e162707ba1bbe2

See more details on using hashes here.

Provenance

The following attestation bundles were made for review_request-0.1.2-py3-none-any.whl:

Publisher: publish.yml on kingkong0905/review-request

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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