Fix overwrites of PR changes in opposite forward flow#5080
Merged
premun merged 2 commits intodotnet:mainfrom Jul 28, 2025
Merged
Fix overwrites of PR changes in opposite forward flow#5080premun merged 2 commits intodotnet:mainfrom
premun merged 2 commits intodotnet:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a bug where manual changes made to PR branches were being overwritten during opposite-direction code flows. The fix implements a proper work branch mechanism that preserves existing PR changes when applying new updates.
Key changes:
- Removed temporary manual commit detection logic that was throwing exceptions
- Implemented proper work branch creation for forward flows to preserve PR changes
- Enhanced merge conflict handling with better error messages and exception types
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| VmrTestsBase.cs | Minor cleanup removing unused import and simplifying return statements |
| VmrCodeFlowUpdatingPRsTests.cs | New comprehensive test suite covering scenarios where PR changes could be overwritten |
| PullRequestUpdater.cs | Removed temporary exception handling for manual commits in flow |
| PcsVmrForwardFlower.cs | Added IWorkBranchFactory dependency to constructor |
| WorkBranch.cs | Enhanced merge conflict detection and added specific exception type |
| VmrForwardFlower.cs | Implemented work branch creation for PR updates and removed manual commit checking |
| VmrCodeflower.cs | Updated method signature to use LastFlows instead of single lastFlow |
| VmrBackflower.cs | Updated to use LastFlows and improved branch checkout logic |
| Exceptions.cs | Removed ManualCommitsInFlowException class |
Co-authored-by: Copilot <[email protected]>
dkurepa
reviewed
Jul 28, 2025
dkurepa
approved these changes
Jul 28, 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.
We create a work branch when applying new changes that we want to then merge into the PR branch
Resolves #5030