Skip to content

Fix conflict message when flows are blocked#5473

Merged
dkurepa merged 3 commits intodotnet:mainfrom
dkurepa:dkurepa/ConflictMessageFix
Nov 13, 2025
Merged

Fix conflict message when flows are blocked#5473
dkurepa merged 3 commits intodotnet:mainfrom
dkurepa:dkurepa/ConflictMessageFix

Conversation

@dkurepa
Copy link
Copy Markdown
Member

@dkurepa dkurepa commented Nov 13, 2025

Copilot AI review requested due to automatic review settings November 13, 2025 13:23
@dkurepa
Copy link
Copy Markdown
Member Author

dkurepa commented Nov 13, 2025

Here's a PR showing correct behavior maestro-auth-test/dotnet#219

@dkurepa
Copy link
Copy Markdown
Member Author

dkurepa commented Nov 13, 2025

and also a backflow maestro-auth-test/maestro-test1#4280 (note that the repo link says not found because the file is deleted on one side to cause the conflict)

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 simplifies the ConflictInPrBranchException constructor by removing parameters that performed path transformations, and changes the ReproTool to force subscription triggers. The changes address issue #5471 related to fixing conflict messages when flows are blocked.

Key Changes

  • Simplified ConflictInPrBranchException constructor by removing mappingName and isForwardFlow parameters
  • Removed path transformation logic in ParseResult method that was converting VMR paths to repo paths for forward flows and vice versa for backflows
  • Changed TriggerSubscriptionAsync in ReproTool to use force: true instead of force: false

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
tools/ProductConstructionService.ReproTool/Operations/Operation.cs Changed subscription trigger to use force parameter set to true
src/Microsoft.DotNet.Darc/DarcLib/VirtualMonoRepo/VmrCodeflower.cs Updated ConflictInPrBranchException constructor call to match simplified signature
src/Microsoft.DotNet.Darc/DarcLib/VirtualMonoRepo/Exceptions.cs Removed mappingName and isForwardFlow parameters from constructor and simplified ParseResult to return raw file paths without transformation

Comment on lines 62 to +65
public ConflictInPrBranchException(
string failedMergeMessage,
string targetBranch,
string mappingName,
bool isForwardFlow)
: this(ParseResult(failedMergeMessage, mappingName, isForwardFlow), targetBranch)
string targetBranch)
: this(ParseResult(failedMergeMessage), targetBranch)
Copy link

Copilot AI Nov 13, 2025

Choose a reason for hiding this comment

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

The constructor signature for ConflictInPrBranchException was changed to remove the mappingName and isForwardFlow parameters, but there's a test file that still uses the old 4-parameter constructor: repo/test/ProductConstructionService.DependencyFlow.Tests/PullRequestUpdaterTests.cs at lines 587-591.

This will cause a compilation error:

new ConflictInPrBranchException(
    "error: patch failed: " + string.Join(Environment.NewLine + "error: patch failed: ", conflictedFiles),
    "branch",
    "repo",
    isForwardFlow: true)

The constructor call should be updated to match the new signature with only 2 parameters:

new ConflictInPrBranchException(
    "error: patch failed: " + string.Join(Environment.NewLine + "error: patch failed: ", conflictedFiles),
    "branch")

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member

@premun premun left a comment

Choose a reason for hiding this comment

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

Is the solution that the exception now strips the prefix correctly already?

@dkurepa
Copy link
Copy Markdown
Member Author

dkurepa commented Nov 13, 2025

Is the solution that the exception now strips the prefix correctly already?

No, the Comment Builder makes sure that the file paths are good, so e.g. if the conflict was on a ff, we get src/roslyn/file.cs, we strip the src/roslyn there and work with it

@dkurepa dkurepa merged commit a440083 into dotnet:main Nov 13, 2025
8 of 9 checks passed
@dkurepa dkurepa deleted the dkurepa/ConflictMessageFix branch November 13, 2025 14:52
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