Skip to content

Support diffing against last reverse-flow in darc vmr diff#5213

Merged
premun merged 4 commits intomainfrom
copilot/fix-5212
Aug 27, 2025
Merged

Support diffing against last reverse-flow in darc vmr diff#5213
premun merged 4 commits intomainfrom
copilot/fix-5212

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Aug 27, 2025

Implements support for diffing against the last backflow when darc vmr diff is called from a product repository (not a VMR).
The same way we added darc vmr diff called from VMR and diffing based on source-manifest.json, we can now call it from the repo and it will use the <Source> tag.

What this changes

Previously, darc vmr diff could only be used from within a VMR directory when no repository arguments were provided. This PR adds support for calling it from a product repository that contains eng/Version.Details.xml.

When called from a product repository:

  • The command reads the <Source> element from eng/Version.Details.xml
  • Extracts the VMR URI and SHA to diff against
  • Performs the diff between the current product repo and the specified VMR state

Examples

# From a product repository with eng/Version.Details.xml
cd /path/to/my-product-repo
darc vmr diff --name-only

# Output:
# Diffing against VMR https://github.com/dotnet/dotnet / abc123def456
# --------------------------------------------------------------------------------
# + NewFile.cs
# - RemovedFile.cs
# * ModifiedFile.cs

# Full diff mode also works
darc vmr diff

Error handling

The command provides clear error messages for various scenarios:

  • No git repo: "can only be used from within a git repository directory"
  • Not VMR and no Version.Details.xml: "can only be used from within a VMR directory or a product repository with eng/Version.Details.xml"
  • No Source element: "No element found in Version.Details.xml. Cannot determine VMR to diff against."

Backward compatibility

Existing VMR behavior is unchanged - when called from a VMR directory, it continues to diff against all repositories in source-manifest.json as before.

Fixes #5212.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: premun <7013027+premun@users.noreply.github.com>
Copilot AI changed the title [WIP] Support diffing against last reverse-flow in darc vmr diff Support diffing against last reverse-flow in darc vmr diff Aug 27, 2025
Copilot AI requested a review from premun August 27, 2025 15:08
@premun premun marked this pull request as ready for review August 27, 2025 15:29
Copilot AI review requested due to automatic review settings August 27, 2025 15:29
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 adds support for running darc vmr diff from product repositories by reading VMR information from eng/Version.Details.xml. Previously, the command only worked when executed from within a VMR directory.

Key changes:

  • Extended darc vmr diff to work from product repositories with eng/Version.Details.xml
  • Added parsing of the <Source> element to determine VMR URI and SHA for comparison
  • Enhanced help text to document the new usage patterns and auto-detection behavior

Reviewed Changes

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

File Description
VmrDiffOptions.cs Updated help text to document new auto-detection behavior and usage patterns
VmrDiffOperation.cs Added logic to detect product repos, parse Version.Details.xml, and execute diff against VMR

@premun premun merged commit 7298e9f into main Aug 27, 2025
9 checks passed
@premun premun deleted the copilot/fix-5212 branch August 27, 2025 15:54
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.

Support diffing against last reverse-flow in darc vmr diff

4 participants