Skip to content

feat(ng-dev): add conditional autosquash merge strategy#3169

Closed
alan-agius4 wants to merge 2 commits into
angular:mainfrom
alan-agius4:conditional-squash
Closed

feat(ng-dev): add conditional autosquash merge strategy#3169
alan-agius4 wants to merge 2 commits into
angular:mainfrom
alan-agius4:conditional-squash

Conversation

@alan-agius4

Copy link
Copy Markdown
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
Comment thread ng-dev/pr/config/index.ts Outdated
@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".

@josephperrott josephperrott left a comment

Copy link
Copy Markdown
Member

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 thread ng-dev/pr/config/index.ts Outdated
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

@josephperrott josephperrott left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
Contributor Author

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

@angular-automatic-lock-bot

Copy link
Copy Markdown

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