Skip to content

Conversation

@adamzip
Copy link
Contributor

@adamzip adamzip commented Nov 20, 2025

#5406

Changes:

  • MergeJsonsAsync returns true only if any changes were made
  • Extract the update of global.json and dotnet-tools.json to a different method and return true if changes were made
  • Change top-level "hadUpdates" calculation to take into account global.json and dotnet-tools.json

Copilot AI review requested due to automatic review settings November 20, 2025 15:23
Copilot finished reviewing on behalf of adamzip November 20, 2025 15:24
@adamzip adamzip self-assigned this Nov 20, 2025
Copy link
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 JSON version file updates (global.json and dotnet-tools.json) were not being properly tracked in the hasUpdates flag during backflow operations. The changes ensure that toolset updates are correctly reported as changes.

Key changes:

  • Modified MergeJsonsAsync to return a boolean indicating whether changes were made
  • Extracted toolset update logic into a separate BackflowToolsets method that tracks changes
  • Updated VersionFileUpdateResult to include a HasToolsetUpdates field
  • Fixed a documentation comment that incorrectly described conflict resolution behavior

Reviewed Changes

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

Show a summary per file
File Description
VmrVersionFileMerger.cs Removed unused parameter and simplified deletion logic; corrected conflict resolution comment
VmrBackflower.cs Added HasToolsetUpdates to the hasChanges calculation
VersionFileUpdateResult.cs Added HasToolsetUpdates field to track toolset changes
JsonFileMerger.cs Changed return type to bool and added logic to detect and return whether changes were made
BackflowConflictResolver.cs Split toolset and dependency updates into separate methods to track toolset changes independently

Copy link
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.

LGTM

Can we add a test? There probably already are tests for this class so maybe AI can cook up one really fast?

Co-authored-by: Přemek Vysoký <[email protected]>
Comment on lines +73 to +78
if (jsonDeletedInTarget
|| (jsonDeletedInSource && targetRepoCurrentJson == EmptyJsonString))
{
// the target file is already deleted, nothing more to do
return false;
}
Copy link
Member

Choose a reason for hiding this comment

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

I like this much better

{
bool hasChanges = false;

//todo - could this be head branch instead of target?
Copy link
Member

Choose a reason for hiding this comment

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

A leftover?

var message =
$"""
There was a conflict when merging version properties. In file {fileTargetRepoPath}, property '{propertyNameTransformer(property)}'
was added in the target branch but removed in the source repo.
Copy link
Member

Choose a reason for hiding this comment

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

Here it also says source repo

premun
premun previously approved these changes Nov 21, 2025
premun
premun previously approved these changes Nov 21, 2025
premun
premun previously approved these changes Nov 21, 2025
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.

2 participants