Add additional_git_am_switches input to backport workflow for handling branch-specific files#16235
Merged
akoeplinger merged 2 commits intomainfrom Oct 22, 2025
Merged
Conversation
Co-authored-by: T-Gro <46543583+T-Gro@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix backport workflow for incompatible release notes
Add additional_git_am_switches input to backport workflow for handling branch-specific files
Oct 21, 2025
T-Gro
approved these changes
Oct 21, 2025
akoeplinger
approved these changes
Oct 22, 2025
Member
|
/ba-g GitHub workflow not tested by AzDO |
dkurepa
approved these changes
Oct 22, 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.
Problem
The backport workflow currently fails when patches contain files that don't exist or have incompatible structures between source and target branches. A common scenario is release notes files where:
mainbranch hasdocs/release-notes/11.0.0.mdfor an upcoming versionrelease/dev17.12branch doesn't have this file (it has10.4.0.mdinstead)Example failure from dotnet/fsharp:
Solution
This PR adds a new optional workflow input
additional_git_am_switchesthat allows repositories to pass custom flags to thegit amcommand. This enables:--exclude=docs/release-notes/*--whitespace=fix--ignore-space-change,--directory=, etc.Changes
Added new workflow input
additional_git_am_switcheswith:Modified git am command construction to:
Usage Example
Repositories like dotnet/fsharp can now use:
Benefits
git amoptions for their needsTesting
The implementation has been validated with:
This change will unblock backporting workflows for repositories with version-specific files that differ between branches, addressing recurring pain points across multiple dotnet repositories.
Alternative Approaches Considered
exclude_pathsinput: More restrictive, would require parsing and validationThe chosen approach provides maximum flexibility while maintaining simplicity and safety.
Original prompt
This pull request was created as a result of the following prompt from Copilot chat.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.