Add conflict resolution extension point for PR backport workflow#16237
Merged
mmitche merged 14 commits intodotnet:mainfrom Oct 24, 2025
Merged
Add conflict resolution extension point for PR backport workflow#16237mmitche merged 14 commits intodotnet:mainfrom
mmitche merged 14 commits intodotnet:mainfrom
Conversation
Member
Author
|
/cc @nagilson for a review of the JavaScript. |
lbussell
commented
Oct 23, 2025
The 'Error:' string is automatically added by GitHub's workflow output.
There was a problem hiding this comment.
Pull Request Overview
This PR adds an automated conflict resolution mechanism to the backport workflow, allowing consuming repos to specify a custom command that attempts to resolve merge conflicts during automated backports.
Key changes:
- Adds a
conflict_resolution_commandinput parameter that accepts a shell command to run when merge conflicts occur - Implements conflict detection and resolution flow that stages changes, verifies conflicts are resolved, and continues the git am process
- Refactors error handling to use helper functions with improved GitHub comment formatting
mthalman
reviewed
Oct 23, 2025
mthalman
previously approved these changes
Oct 23, 2025
Member
Author
|
Ready for review again - updated the links to the examples as well. |
nagilson
reviewed
Oct 23, 2025
Member
nagilson
left a comment
There was a problem hiding this comment.
I think you mentioned this is not complete yet, but here are the thoughts I had so far.
nagilson
reviewed
Oct 23, 2025
nagilson
reviewed
Oct 23, 2025
Member
|
Looked over it again - the JS looks good to me from what I saw, though I left some feedback. Definitely in favor of this idea! :) |
mthalman
approved these changes
Oct 24, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of dotnet/dotnet-docker#6653.
Background
We want automated backports in dotnet/dotnet-docker, but the repo has hundreds of checked-in files that are generated from templates. The templates often have different output depending on the branch. This means backports frequently create merge conflicts. Regenerating all of the templated files resolves most merge conflicts.
Changes
This PR adds an input to the backport workflow base that lets consuming workflows pass in a command that can be run to try and resolve merge conflicts. If there's a merge conflict, we run the custom conflict resolution command. If all of the merge conflicts/markers are resolved after the command is run, then we proceed with the pull request.