Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions .github/actions/pr-review/prompts/base-pr-review.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Read `.github/pr-context.json` — it contains pre-fetched PR data with these fi
- `current_sha`: the HEAD SHA (use this as `CURRENT_SHA`)
- `current_base_sha`: the PR base SHA (use this as `CURRENT_BASE_SHA`)
- `workflow_ref`: the workflow ref that owns this review state (use this as `CURRENT_WORKFLOW_REF`)
- `review_run_url`: link to this review workflow run
- `summary_heading`: the exact markdown heading for the summary comment
- `review_mode`: `"incremental"` or `"full"`
- `last_reviewed_sha`: the SHA from the previous review, used only for deduplication
Expand Down Expand Up @@ -89,11 +90,26 @@ Do not delete existing summary comments before the new review has been posted.
Use this template for the summary body. The heading must be exactly the `summary_heading`
value from `.github/pr-context.json`.

Always include the review run link and a short review summary before the issue sections.
Use 1-3 sentences for the review summary.
For incremental reviews, explicitly say what the new commits changed. If prior bot
feedback appears addressed, say that in the review summary. Use `existing_findings`,
`comments`, and `.github/resolved-threads.json` as context, but verify against the
current diff before claiming something was fixed. If there were no prior findings and
no new findings, say what changed and that no new issues were found. Do not leave the
summary as only counts plus "None found" sections.

```
<summary_heading> <PR title>

**Blocking Issues: N** | **Suggestions: M** | **Threads Resolved: R**
_Review mode: incremental since `<last_reviewed_sha short>`_ (or _Review mode: full_)
[View review run](<review_run_url>)

### Review Summary
<1-3 sentences describing what was reviewed. In incremental mode, include addressed
prior feedback when applicable, for example "The previous pagination suggestion is now
addressed by passing the page token through the client call. No new issues found.">

### Security Issues
<one-liner per finding with file:line, or "None found.">
Expand All @@ -107,8 +123,9 @@ _Review mode: incremental since `<last_reviewed_sha short>`_ (or _Review mode: f
<!-- review-state: {"last_reviewed_sha": "CURRENT_SHA", "base_sha": "CURRENT_BASE_SHA", "workflow_ref": "CURRENT_WORKFLOW_REF"} -->
```

Replace `CURRENT_SHA`, `CURRENT_BASE_SHA`, and `CURRENT_WORKFLOW_REF` with the values
from `.github/pr-context.json`.
Replace `CURRENT_SHA`, `CURRENT_BASE_SHA`, `CURRENT_WORKFLOW_REF`, and
`<review_run_url>` with the values from `.github/pr-context.json`. If `review_run_url`
is empty, omit the review run link line.

After the summary table, include a collapsible section with a single fenced code block
that lists every finding as a concise, actionable description a developer can follow
Expand Down
4 changes: 4 additions & 0 deletions .github/actions/pr-review/scripts/fetch-pr-context.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ def main():
repo = os.environ.get("GITHUB_REPOSITORY", "")
pr_number = os.environ.get("PR_NUMBER", "")
workflow_ref = os.environ.get("GITHUB_WORKFLOW_REF", "")
run_id = os.environ.get("GITHUB_RUN_ID", "")
server_url = os.environ.get("GITHUB_SERVER_URL", "https://github.com").rstrip("/")
review_run_url = f"{server_url}/{repo}/actions/runs/{run_id}" if repo and run_id else None
summary_heading = os.environ.get(
"REVIEW_SUMMARY_HEADING",
DEFAULT_REVIEW_SUMMARY_HEADING,
Expand Down Expand Up @@ -236,6 +239,7 @@ def main():
"current_sha": current_sha,
"current_base_sha": current_base_sha,
"workflow_ref": workflow_ref,
"review_run_url": review_run_url,
"summary_heading": summary_heading,
"review_mode": review_mode,
"last_reviewed_sha": last_reviewed_sha,
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/general-pr-review.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
pr_number: ${{ github.event.pull_request.number }}
review_prompt: general
timeout-minutes: 10
timeout-minutes: 15
2 changes: 1 addition & 1 deletion .github/workflows/pr-review.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
pr_number: ${{ github.event.pull_request.number }}
review_prompt: ${{ inputs.review_prompt || 'connector' }}
timeout-minutes: 10
timeout-minutes: 15