Skip to content

Conversation

@alan-agius4
Copy link
Contributor

Introduces a new conditional autosquash merge strategy. This strategy uses the autosquash merge strategy if the pull request contains fixup or squash commits, and the GitHub API merge strategy otherwise.

This allows pull requests that do not need to be squashed to be closed as "merged" on GitHub, rather than "closed".

@angular-robot angular-robot bot added the detected: feature PR contains a feature commit label Oct 22, 2025
@alan-agius4 alan-agius4 force-pushed the conditional-squash branch 2 times, most recently from 9400cf7 to 4528a64 Compare October 22, 2025 08:02
@alan-agius4 alan-agius4 added the action: merge The PR is ready for merge by the caretaker label Oct 22, 2025
@alan-agius4 alan-agius4 marked this pull request as ready for review October 22, 2025 13:05
@alan-agius4 alan-agius4 force-pushed the conditional-squash branch 3 times, most recently from bb5e914 to 30def70 Compare October 22, 2025 14:55
Introduces a new conditional autosquash merge strategy. This strategy uses the autosquash merge strategy if the pull request contains fixup or squash commits, and the GitHub API merge strategy otherwise.

This allows pull requests that do not need to be squashed to be closed as "merged" on GitHub, rather than "closed".
Copy link
Member

@josephperrott josephperrott left a comment

Choose a reason for hiding this comment

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

Overall its looking good, just want to make sure we are certain about the one if block.

Comment on lines +54 to +61
// Squash and Merge will create a single commit message and thus we can use the API to merge.
if (
method === 'rebase-with-fixup' &&
(pullRequest.needsCommitMessageFixup || (await this.hasFixupOrSquashCommits(pullRequest)))
) {
return super.merge(pullRequest);
}

Copy link
Member

Choose a reason for hiding this comment

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

I don't know why but I just cannot parse this block to save my life.

I think we don't want to perform the merge immediately if it needs commit message fixing right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The comit fixing is handled in

override async merge(pullRequest: PullRequest): Promise<void> {
which this class now extends from.

Copy link
Member

Choose a reason for hiding this comment

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

Oh I didn't realize/connect that it changed base classes.

Copy link
Member

@josephperrott josephperrott left a comment

Choose a reason for hiding this comment

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

LGTM

@alan-agius4
Copy link
Contributor Author

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

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Nov 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker detected: feature PR contains a feature commit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants