Skip to content

Detect and abort non-linear codeflows#5195

Merged
premun merged 4 commits intodotnet:mainfrom
premun:prvysoky/non-linear-flows
Aug 26, 2025
Merged

Detect and abort non-linear codeflows#5195
premun merged 4 commits intodotnet:mainfrom
premun:prvysoky/non-linear-flows

Conversation

@premun
Copy link
Copy Markdown
Member

@premun premun commented Aug 25, 2025

@premun premun changed the base branch from production to main August 25, 2025 14:49
Copilot AI review requested due to automatic review settings August 25, 2025 14:50
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 implements detection and prevention of non-linear codeflows in the VMR (Virtual Mono Repository) system to address issue #4973. The changes ensure that commits being flowed maintain a linear history relative to previously flown commits, preventing potential merge conflicts and repository inconsistencies.

Key changes include:

  • Addition of linearity verification logic for both forward and backward flows
  • Creation of a new NonLinearCodeflowException to handle violation cases
  • Comprehensive test coverage for both forward flow and backflow scenarios

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
GitOperationsHelper.cs Added CreateBranch helper method for test setup
ForwardFlowTests.cs Added test to verify detection of non-linear forward flows
BackflowTests.cs Added test to verify detection of double backflows into same branch
VmrForwardFlower.cs Implemented linearity verification for forward flows
VmrCodeflower.cs Added abstract method and call to verify codeflow linearity
VmrBackflower.cs Implemented linearity verification for backflows
Exceptions.cs Added NonLinearCodeflowException class

This comment was marked as outdated.

@adamzip adamzip requested a review from Copilot August 25, 2025 18:50
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 implements detection and prevention of non-linear codeflows in the VMR (Virtual Mono Repository) system to ensure code changes flow in a proper linear sequence.

  • Adds linearity verification to prevent flowing commits that are not descendants of previously flown commits
  • Introduces a new NonLinearCodeflowException to handle non-linear flow scenarios
  • Implements abstract method for linearity verification in both forward and backflow operations

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/Microsoft.DotNet.DarcLib.Codeflow.Tests/Helpers/GitOperationsHelper.cs Adds CreateBranch helper method for test scenarios
test/Microsoft.DotNet.DarcLib.Codeflow.Tests/ForwardFlowTests.cs Adds test for detecting non-linear forward flow scenarios
test/Microsoft.DotNet.DarcLib.Codeflow.Tests/BackflowTests.cs Adds test for detecting double backflow scenarios
src/Microsoft.DotNet.Darc/DarcLib/VirtualMonoRepo/VmrForwardFlower.cs Implements linearity verification for forward flows
src/Microsoft.DotNet.Darc/DarcLib/VirtualMonoRepo/VmrCodeflower.cs Adds abstract method and calls linearity verification
src/Microsoft.DotNet.Darc/DarcLib/VirtualMonoRepo/VmrBackflower.cs Implements linearity verification for backflows
src/Microsoft.DotNet.Darc/DarcLib/VirtualMonoRepo/Exceptions.cs Defines new exception for non-linear codeflow scenarios

adamzip
adamzip previously approved these changes Aug 26, 2025
@premun premun requested review from adamzip and dkurepa August 26, 2025 08:54
@premun premun enabled auto-merge (squash) August 26, 2025 08:57
@premun premun merged commit c090662 into dotnet:main Aug 26, 2025
8 of 9 checks passed
@premun premun deleted the prvysoky/non-linear-flows branch August 26, 2025 09:30
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.

4 participants