fix(cli): allow clone registration after failed install rollback#3462
Conversation
When a clone install fails after creating the directory, rollback deletes the clone folder but leaves the config entry behind. A retry then succeeds at git clone and binary install but RegisterClone throws because the stale path is already registered, which triggers another rollback. Prune stale registrations before deploy, use forceUpdate when registering from deploy flows, and unregister the clone path during post-install rollback cleanup. Co-authored-by: Jean-Marc Couffin <jmcouffin@users.noreply.github.com>
|
Unable to trigger custom agent "Code Reviewer". You have run out of credits 😔 |
There was a problem hiding this comment.
Pull request overview
This PR fixes a pyRevit CLI clone retry failure where a previous rollback left behind a clone registration, causing subsequent pyrevit clone attempts to fail during registration even after a successful re-clone.
Changes:
- Adjusts clone registration to support “update-in-place” behavior via
forceUpdate, removing existing registrations by name/path before re-adding. - Prunes stale clone registrations early in repo/image deployment flows (leveraging
GetRegisteredClones()’s existing validation/pruning behavior). - Ensures rollback cleanup also removes any registration for the failed clone path to avoid orphaned config entries.
UseTestPyRevitConfig was static but accessed the instance TestTempDir property from TempFileTestBase, causing CS0120 on net48 and net8.0-windows. Co-authored-by: Jean-Marc Couffin <jmcouffin@users.noreply.github.com>
|
📦 New work-in-progress (wip) builds are available for 6.5.4 |
|
📦 New work-in-progress (wip) builds are available for 6.5.4 |
|
📦 New work-in-progress (wip) builds are available for 6.5.4 |
|
📦 New work-in-progress (wip) builds are available for 6.5.4 |
|
📦 New work-in-progress (wip) builds are available for 6.5.4 |
|
📦 New work-in-progress (wip) builds are available for 6.5.4 |
|
📦 New work-in-progress (wip) builds are available for 6.5.4 |
|
📦 New work-in-progress (wip) builds are available for 6.5.4 |
Description
Fixes a CLI clone failure where a retried
pyrevit clonesucceeds at git clone and CI binary download, then fails at registration with:Clone with repo path "C:\pyRevit\main" already exists.The install rollback deletes the clone directory but leaves the config entry behind. On retry, the freshly created clone is valid, so
GetRegisteredClones()keeps the stale registration andRegisterClonerejects the duplicate path, which triggers another rollback.Changes:
forceUpdate: trueso redeploying to the same path updates the entry instead of failingChecklist
Related Issues
Additional Notes
After this fix, users with a stale
mainregistration from a previous failed attempt can retrypyrevit clone main ...without manually runningpyrevit clones forget mainfirst.