-
Notifications
You must be signed in to change notification settings - Fork 2.5k
fix(restore-snapshot): report failures and honor the pinned commit in the git fallback #3210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -3479,13 +3479,24 @@ async def restore_snapshot(snapshot_path, git_helper_extras=None): | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| if x in git_info: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| del git_info[x] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| for repo_url in git_info.keys(): | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| for repo_url, repo_info in git_info.items(): | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| repo_name = os.path.basename(repo_url) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if repo_name.endswith('.git'): | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| repo_name = repo_name[:-4] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| to_path = os.path.join(get_default_custom_nodes_path(), repo_name) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| unified_manager.repo_install(repo_url, to_path, instant_execution=True, no_deps=False, return_postinstall=False) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| res = unified_manager.repo_install(repo_url, to_path, instant_execution=True, no_deps=False, return_postinstall=False) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if not res.result: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| print(f"[ComfyUI-Manager] Failed to restore '{repo_url}': {res.msg}") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| failed.append(repo_name) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| continue | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| commit_hash = repo_info.get('hash') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if commit_hash and repo_switch_commit(to_path, commit_hash) is None: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+3488
to
+3495
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win Defer post-installation until after the snapshot checkout.
Suggested fix- res = unified_manager.repo_install(repo_url, to_path, instant_execution=True, no_deps=False, return_postinstall=False)
+ res = unified_manager.repo_install(repo_url, to_path, instant_execution=True, no_deps=False, return_postinstall=True)
if not res.result:
print(f"[ComfyUI-Manager] Failed to restore '{repo_url}': {res.msg}")
failed.append(repo_name)
continue
commit_hash = repo_info.get('hash')
if commit_hash and repo_switch_commit(to_path, commit_hash) is None:
print(f"[ComfyUI-Manager] Failed to check out '{commit_hash}' for '{repo_url}'")
failed.append(f"{repo_name}@{commit_hash}")
continue
+ if not res.postinstall():
+ print(f"[ComfyUI-Manager] Failed to install '{repo_url}' after checkout")
+ failed.append(repo_name)
+ continue
+
cloned_repos.append(repo_name)📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| print(f"[ComfyUI-Manager] Failed to check out '{commit_hash}' for '{repo_url}'") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| failed.append(f"{repo_name}@{commit_hash}") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| continue | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cloned_repos.append(repo_name) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| manager_util.restore_pip_snapshot(pips, git_helper_extras) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Include the clone error in the
failedlist.Line [3490] prints
res.msg, but Line [3491] appends onlyrepo_name. The final failure summary therefore omits the actual clone error. Append the message to the failure entry, or store a structured failure record, to satisfy the snapshot restoration contract.📝 Committable suggestion
🤖 Prompt for AI Agents