Skip to content

feat(ng-dev/pr): allow merging multiple PRs in batch - #4049

Open
atscott wants to merge 4 commits into
angular:mainfrom
atscott:multi-pr-merge
Open

atscott wants to merge 4 commits into
angular:mainfrom
atscott:multi-pr-merge

Conversation

@atscott

@atscott atscott commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Updates ng-dev pr merge to accept multiple pull request numbers or URLs. PRs are validated upfront with target branches and caretaker notes displayed in an aggregated summary, followed by a single confirmation prompt. Merges are performed sequentially with conflict and failure isolation so that an error on a middle PR does not prevent remaining PRs from landing.

@angular-robot angular-robot Bot added the detected: feature PR contains a feature commit label Oct 19, 2026

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

Copy link
Copy Markdown

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 refactors the merge tool to support batch merging of multiple pull requests sequentially, updating the CLI to accept multiple PRs and introducing a multi-phase validation and execution process. The feedback highlights a critical bug where strategy.check is called before strategy.prepare, which will fail because the local branches are not yet set up. Additionally, non-401 GitHub API errors during the initial validation phase are not caught, which defeats the batch isolation design by aborting the entire process. Finally, calling the single merge method results in duplicate API requests due to redundant loading and validation of the pull request.

Comment thread ng-dev/pr/merge/merge-tool.ts Outdated
Comment thread ng-dev/pr/merge/merge-tool.ts
Comment thread ng-dev/pr/merge/merge-tool.ts Outdated
@atscott
atscott force-pushed the multi-pr-merge branch 5 times, most recently from f5a089d to 1098142 Compare October 19, 2026 20:23
@atscott
atscott marked this pull request as draft October 19, 2026 20:24
@atscott
atscott marked this pull request as ready for review October 19, 2026 20:35

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

Copy link
Copy Markdown

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 introduces batch merging capabilities to the merge tool, allowing multiple pull requests to be validated upfront and merged sequentially with a single confirmation prompt. Key changes include updating the CLI to accept multiple PRs, implementing a mergeMany method in MergeTool, and refactoring error handling and PR parsing to support batch operations. Feedback on the changes suggests capturing the original branch or revision outside of the merge loop to prevent capturing a temporary branch if a previous iteration fails to restore the repository state.

Comment thread ng-dev/pr/merge/merge-tool.ts Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

detected: feature PR contains a feature commit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant