From dd55fc8a3e8c5484f804418a448153559bf5d340 Mon Sep 17 00:00:00 2001 From: Steve Gontzes Date: Thu, 14 May 2026 13:11:00 -0400 Subject: [PATCH 1/4] Add review summary to PR review prompt --- .github/actions/pr-review/prompts/base-pr-review.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/actions/pr-review/prompts/base-pr-review.md b/.github/actions/pr-review/prompts/base-pr-review.md index 70edde7..63e5267 100644 --- a/.github/actions/pr-review/prompts/base-pr-review.md +++ b/.github/actions/pr-review/prompts/base-pr-review.md @@ -89,12 +89,25 @@ 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 a short review summary before the issue sections. Use 1-3 sentences. +For incremental reviews, explicitly say what the new commits changed and whether prior +bot feedback appears addressed. 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. + ``` **Blocking Issues: N** | **Suggestions: M** | **Threads Resolved: R** _Review mode: incremental since ``_ (or _Review mode: full_) +### 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 From 7944ed1370e78474dfe5a9b1d88506bd84d82b3f Mon Sep 17 00:00:00 2001 From: Steve Gontzes Date: Thu, 14 May 2026 13:48:47 -0400 Subject: [PATCH 2/4] Add run link and addressed feedback to review summary --- .../pr-review/prompts/base-pr-review.md | 20 ++++++++++++++++--- .../pr-review/scripts/fetch-pr-context.py | 4 ++++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/.github/actions/pr-review/prompts/base-pr-review.md b/.github/actions/pr-review/prompts/base-pr-review.md index 63e5267..0ccb981 100644 --- a/.github/actions/pr-review/prompts/base-pr-review.md +++ b/.github/actions/pr-review/prompts/base-pr-review.md @@ -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 @@ -89,7 +90,8 @@ 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 a short review summary before the issue sections. Use 1-3 sentences. +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 and whether prior bot feedback appears addressed. Use `existing_findings`, `comments`, and `.github/resolved-threads.json` as context, but verify against the current diff before @@ -97,17 +99,28 @@ claiming something was fixed. If there were no prior findings and no new finding what changed and that no new issues were found. Do not leave the summary as only counts plus "None found" sections. +For incremental reviews where prior bot feedback was addressed, also include an +`Addressed Feedback` section after `Review Summary`. Use concise bullets that identify +the previous concern and how the new commits addressed it. Omit `Addressed Feedback` +when there is no prior bot feedback or nothing appears addressed. + ``` **Blocking Issues: N** | **Suggestions: M** | **Threads Resolved: R** _Review mode: incremental since ``_ (or _Review mode: full_) +[View review run]() ### 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."> +### Addressed Feedback + + ### Security Issues @@ -120,8 +133,9 @@ addressed by passing the page token through the client call. No new issues found ``` -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 +`` 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 diff --git a/.github/actions/pr-review/scripts/fetch-pr-context.py b/.github/actions/pr-review/scripts/fetch-pr-context.py index bd5cb7b..78a3aa3 100644 --- a/.github/actions/pr-review/scripts/fetch-pr-context.py +++ b/.github/actions/pr-review/scripts/fetch-pr-context.py @@ -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, @@ -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, From 339f1edc671dd0f3cd9a7966b23330a31f4c2697 Mon Sep 17 00:00:00 2001 From: Steve Gontzes Date: Thu, 14 May 2026 14:03:05 -0400 Subject: [PATCH 3/4] Keep review summary prompt concise --- .../pr-review/prompts/base-pr-review.md | 22 +++++-------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/.github/actions/pr-review/prompts/base-pr-review.md b/.github/actions/pr-review/prompts/base-pr-review.md index 0ccb981..56a4024 100644 --- a/.github/actions/pr-review/prompts/base-pr-review.md +++ b/.github/actions/pr-review/prompts/base-pr-review.md @@ -92,17 +92,12 @@ 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 and whether prior -bot feedback appears addressed. 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. - -For incremental reviews where prior bot feedback was addressed, also include an -`Addressed Feedback` section after `Review Summary`. Use concise bullets that identify -the previous concern and how the new commits addressed it. Omit `Addressed Feedback` -when there is no prior bot feedback or nothing appears addressed. +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. ``` @@ -116,11 +111,6 @@ _Review mode: incremental since ``_ (or _Review mode: f 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."> -### Addressed Feedback - - ### Security Issues From d0b83e7d799515f366d586a95eb99a2ef5dbd7a2 Mon Sep 17 00:00:00 2001 From: Steve Gontzes Date: Thu, 14 May 2026 14:23:32 -0400 Subject: [PATCH 4/4] Increase PR review workflow timeout --- .github/workflows/general-pr-review.yaml | 2 +- .github/workflows/pr-review.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/general-pr-review.yaml b/.github/workflows/general-pr-review.yaml index 257d1be..3f7ba0e 100644 --- a/.github/workflows/general-pr-review.yaml +++ b/.github/workflows/general-pr-review.yaml @@ -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 diff --git a/.github/workflows/pr-review.yaml b/.github/workflows/pr-review.yaml index d732d24..f292971 100644 --- a/.github/workflows/pr-review.yaml +++ b/.github/workflows/pr-review.yaml @@ -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