- Python 89.8%
- HTML 7%
- CSS 2.9%
- Dockerfile 0.3%
| .github/workflows | ||
| alembic | ||
| docs/adr | ||
| temper | ||
| tests | ||
| .env.example | ||
| .gitignore | ||
| alembic.ini | ||
| CONTEXT.md | ||
| docker-compose.yml | ||
| Dockerfile | ||
| LICENSE | ||
| pyproject.toml | ||
| README.md | ||
Temper
Code, tempered.
Temper is a self-hosted AI pull request reviewer for Forgejo-first teams. It receives Forgejo webhooks, reviews pull request diffs with an OpenAI-compatible model, and posts one managed PR summary plus high-confidence inline findings.
MVP Features
- Forgejo webhook ingestion with HMAC signature validation and delivery de-duplication.
- Forgejo OAuth app connection flow for statuses, PR summaries, and inline review comments.
- Global OpenAI-compatible provider configuration.
- Editable reviewer profiles with rule-based selection.
- Local admin login, Jinja/HTMX-style admin UI, Postgres persistence, Redis/Celery worker.
- Secret redaction before prompting and encrypted credential storage.
- Advisory
temper/reviewcommit status. - Untrusted fork PRs require maintainer-triggered labels or slash commands.
Run With Docker Compose
cp .env.example .env
docker compose up --build
Open http://localhost:61055, log in with TEMPER_ADMIN_EMAIL and TEMPER_ADMIN_PASSWORD, configure the LLM provider, then connect a Forgejo OAuth app and repository.
Forgejo OAuth App
Create a Forgejo OAuth application on the Forgejo instance and set its redirect URI to:
{TEMPER_PUBLIC_BASE_URL}/admin/forgejo/oauth/callback
Use a dedicated Forgejo user, commonly named temper, to authorize the OAuth app. Temper stores OAuth access and refresh tokens encrypted at rest and uses them to:
- read repository pull request data,
- create statuses,
- create/edit issue comments,
- create pull reviews and inline review comments,
- create repository webhooks when API-assisted onboarding is enabled.
Forgejo OAuth scopes are not currently implemented, so OAuth is an onboarding convenience rather than a least-privilege security improvement over scoped Forgejo access tokens. Grant the dedicated Forgejo account access only to repositories Temper should review.
Webhook Events
Temper expects Forgejo JSON webhooks for pull request open/reopen/sync, labels, and PR comments. The endpoint is:
POST /webhooks/forgejo/{installation_id}
Slash commands:
/temper review/temper review <profile-slug>/temper rerun
Labels:
temper:reviewtemper:skiptemper:profile/<profile-slug>
Development
python3 -m venv .venv
.venv/bin/python -m pip install -e '.[dev]'
.venv/bin/python -m pytest
.venv/bin/python -m ruff check .
.venv/bin/python -m mypy temper