Avoid dismissing approvals on restacks alone#58
Conversation
Amp-Thread-ID: https://ampcode.com/threads/T-019e1ccc-c22a-75f9-ab0e-74883fd4963e Co-authored-by: Amp <amp@ampcode.com>
PR SummaryMedium Risk Overview Updates Reviewed by Cursor Bugbot for commit befef1c. Bugbot is set up for automated code reviews on this repo. Configure here. |
🤖 Augment PR SummarySummary: This PR refines the “dismiss stale approvals” composite action to avoid invalidating reviews due to restacks/rebases that rewrite commit SHAs. Changes:
Technical Notes: The action now treats “non-ancestor” as informational (common after rebases) and relies on range-diff output to decide whether the reviewed patch series materially changed. 🤖 Was this summary useful? React with 👍 or 👎 |
|
augment review |
| printf 'reason=Latest approval commit %s is not an ancestor of %s, indicating rewritten history after approval\n' "$approval_sha" "$head_sha" | ||
| # Rebases and restacks rewrite commit IDs. Non-ancestor alone does not prove | ||
| # that the reviewed patch series changed, so let range-diff decide that. | ||
| printf 'stale=false\nreason=\n' |
There was a problem hiding this comment.
git merge-base --is-ancestor can exit with an error status (e.g., missing history in a shallow fetch), and this block currently treats any nonzero exit as a harmless “non-ancestor” case. Consider distinguishing a real command failure from a true non-ancestor result so the action doesn’t silently skip the manual-merge-resolution check when it can’t be evaluated.
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
Summary
Tests
npm cinpx renovate-config-validator.github/actions/dismiss-stale-approvals/self-test.sh