Skip to content

Fix version file codeflow PR reverts - #6883

Merged
dkurepa merged 3 commits into
dotnet:mainfrom
dkurepa:dev/dkurepa/flow-version-file-reverts
Nov 16, 2026
Merged

dkurepa merged 3 commits into
dotnet:mainfrom
dkurepa:dev/dkurepa/flow-version-file-reverts

Conversation

@dkurepa

@dkurepa dkurepa commented Nov 12, 2026

Copy link
Copy Markdown
Member

Copilot AI balanced review requested due to automatic review settings November 12, 2026 12:45
@dkurepa

dkurepa commented Nov 12, 2026

Copy link
Copy Markdown
Member Author

If previous flow was opposite direction, we need to check if a version file change got reverted in that PR. We do this by comparing the files at the commit we're flowing with the last flow target repo sha.
So we're comparing files in two different repos because the source repo never got the change we're trying to flow

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Active issues leave first-backflow version-file reverts unpropagated and can cause backflow to fail with KeyNotFoundException when a forward-flow PR removes a pinned dependency.

2 open issues
What changed in this PR

Updates DARC’s two-way codeflow to propagate version-file changes reverted in a PR back between a repository and the virtual monorepo (VMR), addressing #6882.

Changes:

  • Adds a common-base comparison option to JSON and dependency-file mergers.
  • Enables that option for new flows following an opposite-direction flow.
  • Adds revert-propagation regressions and updates resolver test expectations.

Codeflow tests could not be run in this review environment. Please run dotnet test test/Darc/Microsoft.DotNet.DarcLib.Codeflow.Tests.

File Description
test/​Darc/​Microsoft.DotNet.DarcLib.Tests/​VirtualMonoRepo/​VersionDetailsFileMergerTests.cs Tests common-base dependency reversions and removals.
test/​Darc/​Microsoft.DotNet.DarcLib.Tests/​VirtualMonoRepo/​JsonFileMergerTests.cs Tests propagation of reverted JSON sections.
test/​Darc/​Microsoft.DotNet.DarcLib.Tests/​VirtualMonoRepo/​ForwardFlowConflictResolverTests.cs Updates mocks and assertions for common-base parameters.
test/​Darc/​Microsoft.DotNet.DarcLib.Tests/​VirtualMonoRepo/​BackflowConflictResolverTests.cs Updates backflow merger expectations.
test/​Darc/​Microsoft.DotNet.DarcLib.Codeflow.Tests/​TwoWayCodeflowTests.cs Adds a two-way regression for version-file PR reverts.
src/​Microsoft.DotNet.Darc/​DarcLib/​VirtualMonoRepo/​VersionDetailsFileMerger.cs Adds common-base dependency comparison.
src/​Microsoft.DotNet.Darc/​DarcLib/​VirtualMonoRepo/​JsonFileMerger.cs Adds common-base JSON comparison.
src/​Microsoft.DotNet.Darc/​DarcLib/​VirtualMonoRepo/​ForwardFlowConflictResolver.cs Selects and passes the common base after backflow.
src/​Microsoft.DotNet.Darc/​DarcLib/​VirtualMonoRepo/​BackflowConflictResolver.cs Selects and passes the common base after forward flow.

Review effort: Balanced

Comment on lines +138 to +142
string? commonMergeBaseSha = !headBranchExisted
&& lastFlows.LastBackFlow != null
&& lastFlows.LastFlow is ForwardFlow lastForwardFlow
? lastForwardFlow.RepoSha
: null;
repoComparisonSha,
vmrComparisonSha);
vmrComparisonSha,
commonMergeBaseSha);
@dkurepa

dkurepa commented Nov 12, 2026

Copy link
Copy Markdown
Member Author
image

@dkurepa
dkurepa merged commit e0b29c5 into dotnet:main Nov 16, 2026
11 checks passed
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.

3 participants