Add vmr submodule-reset command#6478
Open
dkurepa wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
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/stagesource-manifest.json. - Update
docs/Darc.mdto 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)]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#6441