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
7 changes: 7 additions & 0 deletions .github/workflows/gh-aw-fragments/pr-context.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ steps:
jq -r '[.[] | {filename, size: ((.additions // 0) + (.deletions // 0))}] | sort_by(-.size) | .[].filename' /tmp/pr-context/files.json \
> /tmp/pr-context/file_order_largest.txt

# Compute PR size metrics for review fan-out decisions
FILE_COUNT=$(jq 'length' /tmp/pr-context/files.json)
DIFF_LINES=$(wc -l < /tmp/pr-context/pr.diff | tr -d ' ')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[MEDIUM] Diff-size fallback misclassifies PRs when full diff fetch fails

DIFF_LINES is derived only from /tmp/pr-context/pr.diff. In the failure path just above, gh pr diff can fail and the script intentionally creates an empty file (: > /tmp/pr-context/pr.diff), which forces DIFF_LINES=0 and classifies the PR as "small" even when the actual patch set is large. This defeats the fan-out logic introduced in this PR and can under-review large PRs; please fall back to counting lines from files.json patches when pr.diff is empty.

echo "${FILE_COUNT} files, ${DIFF_LINES} diff lines" > /tmp/pr-context/pr-size.txt
echo "PR size: ${FILE_COUNT} files, ${DIFF_LINES} diff lines"

# Existing reviews
gh api "repos/$GITHUB_REPOSITORY/pulls/$PR_NUMBER/reviews" --paginate \
| jq -s 'add // []' > /tmp/pr-context/reviews.json
Expand Down Expand Up @@ -132,6 +138,7 @@ steps:
| `threads/<path>.json` | Per-file review threads — one file per changed file with existing threads, mirroring the repo path under `threads/` |
| `comments.json` | PR discussion comments (not inline) |
| `issue-{N}.json` | Linked issue details (one file per linked issue, if any) |
| `pr-size.txt` | PR size metrics: `{N} files, {M} diff lines` — used by the agent to decide review fan-out |
| `agents.md` | Repository conventions from `generate_agents_md` (if written by agent) |
| `review-instructions.md` | Review instructions, criteria, and calibration examples (if written by review-process fragment) |
MANIFEST
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/gh-aw-mention-in-pr-by-id.lock.yml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions .github/workflows/gh-aw-mention-in-pr-no-sandbox.lock.yml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions .github/workflows/gh-aw-mention-in-pr.lock.yml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions .github/workflows/gh-aw-pr-review-addresser.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading