Skip to content

Avoid dismissing approvals on restacks alone#58

Open
lunelson wants to merge 1 commit into
hashintel:mainfrom
lunelson:fix/graphite-restack-stale-approvals
Open

Avoid dismissing approvals on restacks alone#58
lunelson wants to merge 1 commit into
hashintel:mainfrom
lunelson:fix/graphite-restack-stale-approvals

Conversation

@lunelson
Copy link
Copy Markdown

Summary

  • Avoid dismissing approvals solely because restacking/rebasing rewrote commit IDs
  • Defer rewritten-history cases to the existing range-diff stale-check logic
  • Add self-test coverage for safe restacks and changed patch series

Tests

  • npm ci
  • npx renovate-config-validator
  • .github/actions/dismiss-stale-approvals/self-test.sh

@cursor
Copy link
Copy Markdown

cursor Bot commented May 12, 2026

PR Summary

Medium Risk
Changes the stale-approval decision logic in the GitHub Action, which can affect whether PR approvals are dismissed; mistakes could leave stale approvals in place or dismiss valid ones. Scope is small and covered by expanded self-tests.

Overview
Stops treating “approval commit is not an ancestor of HEAD” as automatically stale in check-manual-merge-resolutions.sh, so simple rebases/restacks no longer dismiss approvals and the decision is deferred to the existing git range-diff check.

Updates self-test.sh to reflect the new behavior and adds coverage to ensure rewritten history only becomes stale when range-diff detects a changed patch series (and that the final decision output points reviewers to the range-diff output).

Reviewed by Cursor Bugbot for commit befef1c. Bugbot is set up for automated code reviews on this repo. Configure here.

@augmentcode
Copy link
Copy Markdown

augmentcode Bot commented May 12, 2026

🤖 Augment PR Summary

Summary: This PR adjusts the “dismiss stale approvals” action to avoid dismissing approvals just because a rebase/restack rewrote commit SHAs.

Changes:

  • Updates the manual merge-resolution check to no longer mark approvals stale solely when the approval commit is no longer an ancestor of the PR head.
  • Relies on the existing git range-diff-based stale check to detect whether the reviewed patch series actually changed after history rewrites.
  • Extends the self-test suite to cover “rewritten history defers to range-diff” and “rewritten + changed patch series becomes stale via range-diff”.

Technical Notes: The ancestry check now acts as a gate: non-ancestor cases return non-stale and let the range-diff step determine staleness.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode Bot left a comment

Choose a reason for hiding this comment

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

Review completed. No suggestions at this time.

Comment augment review to trigger a new review at any time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant