Repository navigation
v0.3.21 - Review formatted PR commits with local Git context (#897)
🌟 Summary
v0.3.21 makes pull request reviews more reliable and consistent by analyzing the exact committed PR version, even when formatting changes the local checkout.
📊 Key Changes
-
🔍 Reviews now use local Git objects at the PR’s commit
- Files, listings, and repository searches are read directly from the reviewed commit instead of the potentially modified working tree.
- Reviews remain accurate even when formatters create uncommitted changes or workflow files are excluded from the checkout.
-
📌 Diffs are pinned to a specific base and head commit
- The action fetches the live PR once and reuses a cached comparison for both summaries and reviews.
- This keeps review comments aligned with the same code snapshot.
-
⚡ More efficient repository searching
- Searches now use Git’s committed-file data, filter out excluded paths and oversized files, and process results in bounded batches.
- This reduces unnecessary API requests and avoids disabling search when the checkout is dirty.
-
🧹 Removed the snapshot retry helper
- The previous approach repeatedly fetched the PR head and diff to detect changes during review.
- The new cached, SHA-pinned workflow avoids duplicate fetches while retaining a final live-head check to prevent stale approvals.
-
🔄 Reordered GitHub Action steps
- Existing format, commit, and push operations now run before PR automation and review steps.
- As a result, automated reviews evaluate the formatted and committed code rather than an earlier version.
-
🧪 Expanded validation
- The full test suite passed with 169 tests, focused Ruff checks passed, and replayed Portal requests produced identical results.
🎯 Purpose & Impact
- ✅ More trustworthy reviews: Inline comments and summaries correspond to the actual committed PR code.
- 🛡️ Better resilience to formatting: Automated formatting no longer forces the review system to fall back to slower or less reliable REST-based file reads.
- 🚀 Improved performance: Shared caching and local Git access reduce repeated GitHub API calls and redundant PR fetches.
- 🔐 Safer stale-review handling: The final live-head check still prevents approvals from being issued against outdated code.
- 👩💻 Minimal user-facing change: Users benefit from more consistent PR automation without needing to change how the action is configured.
What's Changed
- Review formatted PR commits with local Git context by @glenn-jocher in #897
Full Changelog: v0.3.20...v0.3.21