Git Reviews — User Guide
Audience: Data platform teams who want AI-assisted code review on GitHub PRs for SQL, dbt, PySpark, YAML, and data contracts—before bad changes merge.
In the docs sidebar this page appears as Git Reviews (AI on PRs). Route: /git-reviews (often under Build in the app).
Related: align review behaviour with org standards using Agent Intelligence & Skills (rules, lessons, SQL style skills).
Why Git Reviews matter
Pipeline Building Pipelines catches failures at run time. Git Reviews add shift-left feedback: every PR touching critical paths can get a structured review comment from a specialist or Super agent, aligned with your custom instructions (style, compliance, performance).
Where to find it
- Route:
/git-reviews - Navigation: commonly under Build → Git Reviews
- Requires connected repositories so configs can target a repo.
Configuration list
| UI element | Purpose |
|---|---|
| New Review Config | Start the create dialog |
| Row: status icon | Green = active, grey = paused |
| Row: name + subtitle | Human label; repo, events, total reviews |
| Pause / Activate | Flip is_active without deleting history |
| Delete | Removes config + history (confirm) |
| Click row | Opens detail: metadata, Webhook URL, review history |
Empty state: Explains the feature with CTA to create first config.
Create configuration (form)
| Field | Guidance |
|---|---|
| Name | Required; use team-readable id like “dbt-prod-review” |
| Repository | Pick from workspace-connected GitHub repos |
| Review agent | Super Agent (agent_team) for breadth; dbt, metadata_discovery, spark_developer, data_cleaner for focus |
| Target branches | Combobox; defaults often main, dev—add release branches |
| File patterns | Globs: *.sql, *.py, *.yml, *.yaml, etc. |
| Custom instructions | Free-text rules: naming, test coverage, PII, performance |
| Auto-post comment | If on, review text is posted to GitHub automatically |
On create, backend stores config and returns webhook id + secret → Webhook Info dialog immediately.
Webhook setup (GitHub)
- Repo Settings → Webhooks → Add webhook.
- Payload URL — copy from Dagen (must match generated id).
- Content type:
application/json. - Secret — copy from Dagen; GitHub sends
X-Hub-Signature-256HMAC-SHA256. - Events: Pull requests (and only what you need).
Dagen rejects bad signatures, stale replays, and filters by event action, branch, and file patterns before spawning work.
Review pipeline (what happens on each PR)
- GitHub POSTs to
/api/git-review/webhook/<webhook_id>. - Signature verified; event filtered.
- GitReview record created (
pending→running). - Background work: fetch PR diff + file list from GitHub API.
- Filter files by patterns.
- Build prompt: PR metadata + diff + custom instructions.
- Run
get_agent(agent_id).run(prompt). - Parse agent output → summary, issue count, body.
- Post PR comment via GitHub API (if auto-post enabled).
- UI history row updated; link to GitHub comment.
Review history table
| Column | Meaning |
|---|---|
| PR | #number + title (link out) |
| Author | GitHub login |
| Status | Chips: completed, running, pending, failed; GitHub icon if comment posted |
| Issues | Count agent reported |
| Files | Count reviewed after pattern filter |
| Duration | Seconds |
| Time | Relative |
Detail dialog: markdown-friendly body, View PR, metadata (branch flow, counts).
API surface (for operators)
| Method | Route | Auth | Role |
|---|---|---|---|
| POST | /api/git-review/webhook/<id> |
HMAC | GitHub only |
| GET/POST/PUT/DELETE | /api/git-review/configs |
UI session | CRUD configs |
| GET | /api/git-review/configs/:id/reviews |
UI session | Paginated history |
| GET | /api/git-review/configs/:id/secret |
UI session | Fetch URL + secret for GitHub UI |
These are not the same as External API keys—webhooks use HMAC, not X-API-Key.
Troubleshooting
| Symptom | Check |
|---|---|
| No deliveries | GitHub webhook Recent Deliveries; URL reachable from internet |
| 401/403 on webhook | Secret mismatch; rotate secret in GitHub + Dagen |
| Reviews wrong scope | Branches + file patterns |
| Agent timeout | Large diffs—tighten patterns or use focused agent |
| Comment not posted | Auto-post off? GitHub token scopes? |
Related
- Building Pipelines
- External API (separate auth path)
- Custom Agents & Tools