Skip to content

fix(ng-dev): run autosquash dry-run in mergeability check#3717

Merged
josephperrott merged 2 commits into
angular:mainfrom
josephperrott:fix/branch-manager-mergeability-check
Jun 3, 2026
Merged

fix(ng-dev): run autosquash dry-run in mergeability check#3717
josephperrott merged 2 commits into
angular:mainfrom
josephperrott:fix/branch-manager-mergeability-check

Conversation

@josephperrott
Copy link
Copy Markdown
Member

To accurately determine if an autosquash merge will succeed, we must first dry-run the autosquash rebase during the mergeability check. The default check method relies on git cherry-pick, which applies fixups sequentially rather than squashing them, causing it to falsely pass even if there are squash-related conflicts.

@josephperrott josephperrott requested a review from alan-agius4 June 1, 2026 16:24
@josephperrott josephperrott added the action: merge The PR is ready for merge by the caretaker label Jun 1, 2026
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request overrides the check method in AutosquashMergeStrategy to dry-run an interactive autosquash rebase, ensuring that conflicts caused by the squashing process are caught before merging. Feedback points out that performing the rebase leaves the working tree dirty or checked out on a temporary branch, as git update-ref in the finally block only updates the ref pointer without restoring the working tree or index. It is recommended to capture the original checked-out branch or revision before the rebase and restore it using git checkout -f in the finally block.

Comment thread ng-dev/pr/merge/strategies/autosquash-merge.ts
@josephperrott josephperrott force-pushed the fix/branch-manager-mergeability-check branch from 157714d to 26e519a Compare June 1, 2026 16:37
To accurately determine if an autosquash merge will succeed, we must first dry-run the autosquash rebase during the mergeability check. The default check method relies on git cherry-pick, which applies fixups sequentially rather than squashing them, causing it to falsely pass even if there are squash-related conflicts.
@josephperrott josephperrott force-pushed the fix/branch-manager-mergeability-check branch from 26e519a to cd365a6 Compare June 3, 2026 20:55
@josephperrott josephperrott merged commit b64a291 into angular:main Jun 3, 2026
16 checks passed
@josephperrott
Copy link
Copy Markdown
Member Author

This PR was merged into the repository. The changes were merged into the following branches:

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

Labels

action: merge The PR is ready for merge by the caretaker

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants