Fix re-use of existing clones#5315
Merged
premun merged 5 commits intodotnet:mainfrom Sep 29, 2025
Merged
Conversation
When a clone already exists (e.g. during `darc` commands), we incorrectly cloned the repository again to `tmp/`. The `PcsVmrBackflower` also duplicated some logic from the base class.
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes the issue where existing repository clones were not properly reused during darc commands, causing the system to incorrectly create new clones in temporary directories. The fix ensures that the folder path passed to the CloneManager is always used when available.
Key changes:
- Modified the
VmrBackflowerbase class to accept a target repository path parameter and use it when preparing clones - Removed duplicated logic from
PcsVmrBackflowerby leveraging the base class implementation - Added a new method to
CloneManagerto support using existing clone paths
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| PcsVmrBackFlower.cs | Simplified by removing duplicated PrepareVmrAndRepo method and using base class implementation |
| MaestroAuthTestRepositoryExtensions.cs | Refactored to eliminate code duplication and added new PrepareCloneAsync overload |
| VmrBackflower.cs | Enhanced PrepareVmrAndRepo to accept targetRepoPath parameter and use existing clones when available |
| RepositoryCloneManager.cs | Added new interface method and implementation for preparing clones with existing paths |
| CloneManager.cs | Added protected method to handle clone preparation with existing paths |
Member
Author
|
I should add unit tests |
adamzip
previously approved these changes
Sep 29, 2025
adamzip
approved these changes
Sep 29, 2025
premun
added a commit
to premun/arcade-services
that referenced
this pull request
Sep 29, 2025
Introduced in dotnet#5315
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.
I found 2 problems in how we handle cloning:
PcsVmrBackflowerhas its ownPrepareRepoAndVmrwhich is almost the same asVmrBackflowerexcept it does not check out the SHA of the last flow correctly. I guess we do check it out later somewhere because otherwise I don't know how this would work.darc vmr backflow, we might end up cloning the repo into TMP instead of properly using the one the user is targeting with the command. Then we fetch the needed commits into the TMP one and fail to find the commits later in the one the user specified.#5312