-
Notifications
You must be signed in to change notification settings - Fork 378
Add conflict resolution extension point for PR backport workflow #16237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
/cc @nagilson for a review of the JavaScript. |
The 'Error:' string is automatically added by GitHub's workflow output.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
|
Ready for review again - updated the links to the examples as well. |
nagilson
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you mentioned this is not complete yet, but here are the thoughts I had so far.
|
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! :) |
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.