Skip to content

Fix overwrites of PR changes in opposite forward flow#5080

Merged
premun merged 2 commits intodotnet:mainfrom
premun:prvysoky/ff-work-branch
Jul 28, 2025
Merged

Fix overwrites of PR changes in opposite forward flow#5080
premun merged 2 commits intodotnet:mainfrom
premun:prvysoky/ff-work-branch

Conversation

@premun
Copy link
Copy Markdown
Member

@premun premun commented Jul 28, 2025

We create a work branch when applying new changes that we want to then merge into the PR branch

Resolves #5030

@premun premun requested review from Copilot and dkurepa and removed request for Copilot July 28, 2025 12:10
Copy link
Copy Markdown
Contributor

Copilot AI left a 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 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

Comment thread src/Microsoft.DotNet.Darc/DarcLib/VirtualMonoRepo/VmrForwardFlower.cs Outdated
@premun premun merged commit ccf68e2 into dotnet:main Jul 28, 2025
9 checks passed
@premun premun deleted the prvysoky/ff-work-branch branch July 28, 2025 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Forward flow PR dropped/reverted manual in PR change

3 participants