Skip to content

Avoid dismissing approvals on restacks alone#58

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

Avoid dismissing approvals on restacks alone#58
lunelson wants to merge 3 commits 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 approval-staleness logic in the GitHub Action, which can affect whether PR approvals are dismissed; mistakes could leave stale approvals or cause unnecessary dismissals. Workflow checkout logic also changes which code is tested/executed in PR vs reusable-workflow contexts.

Overview
Stops treating "approval commit is not an ancestor of HEAD" as automatic staleness in check-manual-merge-resolutions.sh; rewritten history (rebase/restack) now defers to the existing git range-diff check unless merge-base itself errors (which now propagates as non-zero).

Expands self-test.sh to cover the new rewritten-history behavior (safe restack vs changed patch series via range-diff) and to verify merge-base failures bubble up.

Updates preflight-stale-approvals.yml so pull_request events checkout the action from the PR head SHA, while other events continue checking out from the reusable workflow ref.

Reviewed by Cursor Bugbot for commit b780d2d. 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 refines the “dismiss stale approvals” composite action to avoid invalidating reviews due to restacks/rebases that rewrite commit SHAs.

Changes:

  • Updates check-manual-merge-resolutions.sh so “approval commit is not an ancestor of HEAD” no longer marks approvals stale by itself.
  • Defers rewritten-history situations to the existing git range-diff-based staleness check.
  • Expands self-test.sh coverage to validate that safe rewrites stay non-stale, while changed patch series are still detected as stale via range-diff.

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 👎

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.

TimDiekmann
TimDiekmann previously approved these changes May 13, 2026
@lunelson
Copy link
Copy Markdown
Author

augment review

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. 1 suggestion posted.

Fix All in Augment

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.

2 participants