-
Notifications
You must be signed in to change notification settings - Fork 79
Fix handling fully-reverted files during rebase codeflow #5622
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
base: main
Are you sure you want to change the base?
Conversation
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 fixes an issue where rebase codeflow encounters conflicts on reverted files when there are two flows in the same direction. The solution detects when previous flows are being recreated and treats the last same-direction flow as a crossing flow, enabling proper conflict resolution for reverted files.
Key Changes:
- Implements crossing flow detection for recreated flows in both forward and backward flow scenarios
- Adds file revert resolution logic for files that were added then removed during rebase
- Enhances conflict handling to commit changes when no conflicts exist during backflow
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
src/Microsoft.DotNet.Darc/DarcLib/VirtualMonoRepo/VmrForwardFlower.cs |
Adds crossing flow detection when previous flows are recreated |
src/Microsoft.DotNet.Darc/DarcLib/VirtualMonoRepo/VmrBackflower.cs |
Implements crossing flow detection and conditional commit logic for conflict-free backflows |
src/Microsoft.DotNet.Darc/DarcLib/VirtualMonoRepo/VmrCodeflower.cs |
Refactors reverted file handling with new FileToBeRemovedContent constant and commit logic |
src/Microsoft.DotNet.Darc/DarcLib/VirtualMonoRepo/CodeFlowConflictResolver.cs |
Adds TryRevertingAddedFile method and improves conflict abort logic |
src/Microsoft.DotNet.Darc/DarcLib/VirtualMonoRepo/ForwardFlowConflictResolver.cs |
Integrates file revert resolution for forward flows |
src/Microsoft.DotNet.Darc/DarcLib/VirtualMonoRepo/BackflowConflictResolver.cs |
Adds file revert resolution for backflows |
src/Microsoft.DotNet.Darc/DarcLib/Models/VirtualMonoRepo/CodeFlowResult.cs |
Adds RecreatedPreviousFlows property to track flow recreation |
test/Microsoft.DotNet.DarcLib.Codeflow.Tests/TwoWayCodeflowTests.cs |
Updates OutOfOrderMergesWithConflictsTest to test rebase-only scenarios with new flow verification |
test/Microsoft.DotNet.DarcLib.Codeflow.Tests/ForwardFlowTests.cs |
Removes test ignore and fixes assertion for file content expectations |
test/Microsoft.DotNet.DarcLib.Codeflow.Tests/BackflowTests.cs |
Adds comprehensive BackflowWithRevertsAndConflictsTest mirroring forward flow test |
test/Microsoft.DotNet.DarcLib.Codeflow.Tests/Helpers/GitOperationsHelper.cs |
Changes CreateBranch to use -B flag and removes --ff-only from merge |
eng/Create-CodeflowGraphVizGraph.ps1 |
Adds --first-parent flag to git blame commands |
src/Microsoft.DotNet.Darc/DarcLib/VirtualMonoRepo/VmrForwardFlower.cs
Outdated
Show resolved
Hide resolved
test/Microsoft.DotNet.DarcLib.Codeflow.Tests/Helpers/GitOperationsHelper.cs
Show resolved
Hide resolved
src/Microsoft.DotNet.Darc/DarcLib/VirtualMonoRepo/BackflowConflictResolver.cs
Outdated
Show resolved
Hide resolved
test/Microsoft.DotNet.DarcLib.Codeflow.Tests/Helpers/GitOperationsHelper.cs
Show resolved
Hide resolved
src/Microsoft.DotNet.Darc/DarcLib/VirtualMonoRepo/CodeFlowConflictResolver.cs
Show resolved
Hide resolved
…lictResolver.cs Co-authored-by: Copilot <[email protected]>
|
@dkurepa there is one failing test arcade-services/src/Microsoft.DotNet.Darc/DarcLib/VirtualMonoRepo/ForwardFlowConflictResolver.cs Line 128 in 297d9f9
Do you know what's the thinking behind that |
src/Microsoft.DotNet.Darc/DarcLib/VirtualMonoRepo/CodeFlowConflictResolver.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.DotNet.Darc/DarcLib/VirtualMonoRepo/VmrBackflower.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.DotNet.Darc/DarcLib/Models/VirtualMonoRepo/CodeFlowResult.cs
Show resolved
Hide resolved
src/Microsoft.DotNet.Darc/DarcLib/VirtualMonoRepo/VmrBackflower.cs
Outdated
Show resolved
Hide resolved
…lictResolver.cs Co-authored-by: Djuradj Kurepa <[email protected]>
Rebase conflicts on all reverted files and we are able to resolve them using the crossing flow.
lastFlows.CrossingFlowto the last flow in the same direction and the resolver of the gradual changes / reverted files then correctly fixes the files.#5541