Skip to content

Add vmr submodule-reset command#6478

Open
dkurepa wants to merge 2 commits into
dotnet:mainfrom
dkurepa:dkurepa/VmrSubmoduleReset
Open

Add vmr submodule-reset command#6478
dkurepa wants to merge 2 commits into
dotnet:mainfrom
dkurepa:dkurepa/VmrSubmoduleReset

Conversation

@dkurepa

@dkurepa dkurepa commented Jul 7, 2026

Copy link
Copy Markdown
Member

Copilot AI review requested due to automatic review settings July 7, 2026 08:50

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.

Pull request overview

Adds a new DARC VMR CLI verb to reset a single VMR submodule’s inlined contents based on the current HEAD of a local clone of that submodule repository, and updates/stages source-manifest.json accordingly. This fits into the DARC VirtualMonoRepo toolset to support targeted local VMR content resets without doing a full mapping reset.

Changes:

  • Add darc vmr reset-submodule <submodulePath> command (options + operation) and register it in DARC.
  • Implement submodule content reset via git rm + patch generation/application, and update/stage source-manifest.json.
  • Update docs/Darc.md to document the new verb; improve GraphViz script “open in browser” behavior for long URLs.

Reviewed changes

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

Show a summary per file
File Description
src/Microsoft.DotNet.Darc/Darc/Program.cs Registers the new reset-submodule verb in the VMR command set.
src/Microsoft.DotNet.Darc/Darc/Options/VirtualMonoRepo/ResetSubmoduleCommandLineOptions.cs Defines CLI parsing/help for darc vmr reset-submodule.
src/Microsoft.DotNet.Darc/Darc/Operations/VirtualMonoRepo/ResetSubmoduleOperation.cs Implements the submodule reset behavior, manifest update, and staging.
eng/Create-CodeflowGraphVizGraph.ps1 Opens long edotor.net URLs via a temp redirect HTML to avoid Start-Process URL length limits.
docs/Darc.md Adds command index + reference section for reset-submodule.

Comment on lines +64 to +71
var localRepoPath = ResolveLocalRepositoryRoot();
var targetSha = await _localGitRepoFactory.Create(localRepoPath).GetShaForRefAsync();
_logger.LogInformation(
"Using local repository '{repo}' at commit '{sha}' as the submodule source",
localRepoPath, targetSha);

_vmrInfo.VmrPath = new NativePath(_options.VmrPath);
await _dependencyTracker.RefreshMetadataAsync();
/// </summary>
private async Task UpdateManifestAsync(ISourceComponent submodule, NativePath localRepoPath, string targetSha)
{
_dependencyTracker.UpdateSubmodules([new SubmoduleRecord(submodule.Path, localRepoPath, targetSha)]);
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