GitHub App that runs Agent-PR Reviewer on pull requests and posts findings as a sticky comment.
Project description
Agent-PR Reviewer — GitHub App (apr-app)
A FastAPI service that runs the
aprengine on every pull request and posts the verdict as a sticky comment.
Status
v0.0.1 alpha. Same overall shape as sts-app: HMAC-verified webhooks, GitHub App JWT auth, tempdir-based per-file review.
What it does
- Receives
pull_requestwebhook deliveries from GitHub. - Verifies the HMAC signature with
APR_APP_WEBHOOK_SECRET. - Calls the GitHub API to:
- Fetch the PR's title + body + head SHA (
GET /pulls/{n}) - List the PR's changed files (
GET /pulls/{n}/files) - Download each known-extension changed file's contents (
GET /contents/{path}?ref=SHA) into a temp directory
- Fetch the PR's title + body + head SHA (
- Runs
apr.engine.review()against the temp directory with the PR title + description. - Formats the
ReviewReportas Markdown and either creates a sticky comment on the PR or updates the existing one (identified by an HTML marker). - Cleans up the temp directory.
Configuration
All settings are read from environment variables prefixed APR_APP_. A .env file in the working directory is also loaded automatically.
| Variable | Default | Required for production |
|---|---|---|
APR_APP_HOST |
127.0.0.1 |
no |
APR_APP_PORT |
8000 |
no |
APR_APP_LOG_LEVEL |
info |
no |
APR_APP_RELOAD |
false |
no |
APR_APP_WEBHOOK_SECRET |
none | yes — without it, signature verification is skipped |
APR_APP_APP_ID |
none | yes for production — numeric GitHub App ID |
APR_APP_PRIVATE_KEY_PEM |
none | yes for production — App's RSA private key (paste PEM contents) |
APR_APP_GITHUB_TOKEN |
none | only for dev — Personal Access Token (ignored when App ID + key are set) |
APR_APP_GITHUB_API_URL |
https://api.github.com |
no — override for GHES |
APR_APP_MAX_CHANGED_FILES |
100 |
no — beyond this we run metadata-only |
APR_APP_MAX_FILE_BYTES |
512000 |
no — skip per-file rules on larger files |
APR_APP_REQUEST_TIMEOUT_SECONDS |
20 |
no |
Running locally
uv sync --all-packages --all-groups
export APR_APP_WEBHOOK_SECRET="something-long-and-random"
export APR_APP_GITHUB_TOKEN="ghp_..."
apr-app
# or
python -m apr_app
# Smoke check
curl http://127.0.0.1:8000/health
curl http://127.0.0.1:8000/version
Endpoints
| Method | Path | Purpose |
|---|---|---|
GET |
/ |
Service identity (name, version) |
GET |
/health |
Liveness probe |
GET |
/version |
App + engine versions |
POST |
/webhooks/github |
Webhook receiver — must have valid X-Hub-Signature-256 |
GET |
/docs |
OpenAPI spec |
Sticky comment format
The bot's comment includes:
- A hidden HTML marker so subsequent runs find and update it
- An emoji headline summarizing the worst severity (🛑 critical / ❌ error / ⚠️ warning / ℹ️ info / ✅ clean)
- Counts by severity
- A table of up to 30 findings with severity, file:line, rule_id, and message
- Footer with
aprengine version + schema version + changed-file count
Apache-2.0 license. See CHANGELOG.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file devtrust_apr_app-0.0.1.tar.gz.
File metadata
- Download URL: devtrust_apr_app-0.0.1.tar.gz
- Upload date:
- Size: 16.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b52ba173ae9b9d6cf8ab80740f5a82dbad07c970e47b1e759a36459786ce6b9a
|
|
| MD5 |
26727dc5f34dcfc681ca6d80c0ace996
|
|
| BLAKE2b-256 |
ca0cb94254ebb3d56d2e11590313a100ef66f7a46a813ff44dab8914f9fac091
|
Provenance
The following attestation bundles were made for devtrust_apr_app-0.0.1.tar.gz:
Publisher:
release.yml on AbdullahBakir97/DevTrust
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
devtrust_apr_app-0.0.1.tar.gz -
Subject digest:
b52ba173ae9b9d6cf8ab80740f5a82dbad07c970e47b1e759a36459786ce6b9a - Sigstore transparency entry: 1486551330
- Sigstore integration time:
-
Permalink:
AbdullahBakir97/DevTrust@c6fc601fa074dc0135f1b9a7b5e46360ec1d9d4e -
Branch / Tag:
refs/tags/devtrust-apr-app-v0.0.1 - Owner: https://github.com/AbdullahBakir97
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c6fc601fa074dc0135f1b9a7b5e46360ec1d9d4e -
Trigger Event:
push
-
Statement type:
File details
Details for the file devtrust_apr_app-0.0.1-py3-none-any.whl.
File metadata
- Download URL: devtrust_apr_app-0.0.1-py3-none-any.whl
- Upload date:
- Size: 14.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cdb69727e9e8ba7984b799a8fa3aa2d6b379656f6af054b4c996f2d18fe2d044
|
|
| MD5 |
0fc8d1ad3243abf0e87cfa891403dbbd
|
|
| BLAKE2b-256 |
3a066e2c1a4fc495fba702be678af8efffd10cf55c158b8573db2c7de47a49a2
|
Provenance
The following attestation bundles were made for devtrust_apr_app-0.0.1-py3-none-any.whl:
Publisher:
release.yml on AbdullahBakir97/DevTrust
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
devtrust_apr_app-0.0.1-py3-none-any.whl -
Subject digest:
cdb69727e9e8ba7984b799a8fa3aa2d6b379656f6af054b4c996f2d18fe2d044 - Sigstore transparency entry: 1486551488
- Sigstore integration time:
-
Permalink:
AbdullahBakir97/DevTrust@c6fc601fa074dc0135f1b9a7b5e46360ec1d9d4e -
Branch / Tag:
refs/tags/devtrust-apr-app-v0.0.1 - Owner: https://github.com/AbdullahBakir97
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c6fc601fa074dc0135f1b9a7b5e46360ec1d9d4e -
Trigger Event:
push
-
Statement type: