Skip to content

fix(action): don't flag stacked PRs as outdated when their base PR merges - #817

Open
danadajian wants to merge 1 commit into
mainfrom
fix/stacked-pr-rebase-flag
Open

danadajian wants to merge 1 commit into
mainfrom
fix/stacked-pr-rebase-flag

Conversation

@danadajian

@danadajian danadajian commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • In manifest mode, when PR #1 merges, manifest-merge flags every open PR whose changeset disagrees with the merged changeset with "Visual comparison outdated — please rebase." A PR stacked on PR #1 (its base branch is PR #1's branch) that also changes the same screenshot was wrongly flagged: it legitimately holds a different hash because it changed the screenshot again on top of PR #1, and it is already rebased on PR #1.
  • The flagging step now resolves the baseline manifest each open PR was compared against (via the _headSha its changeset already records) and only flags a path when that baseline disagrees with what actually merged. A stacked PR's baseline already contains PR #1's screenshots, so its overlapping paths are recognized as stacked and skipped.
  • Staleness is still detected where it matters: if PR #1 changes the screenshot again after the stacked PR's last visual run, the stacked PR's baseline holds the older hash and it is still flagged. PRs targeting main directly behave exactly as before. Changesets without _headSha fall back to the previous behavior.
  • The extra manifest lookup only runs for PRs that actually disagree on an overlapping path, so cost is negligible.
  • Documents the stacked-PR exemption in the "updating base images" usage docs.

Test plan

  • bunx nx test action — 236 pass, including six new stacked-PR cases (stacked path skipped, deletion re-added on top skipped, re-pushed base PR still flagged, mixed stacked/stale paths reports only stale ones, no _headSha fallback, no lookup when nothing disagrees)
  • bun lint, bun tsc, bun format-check
  • bunx nx build action and committed action/dist

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>

This branch has not been deployed

No deployments
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