feat(snapshot): finalize artifacts and direct archives - #1487
Open
appcypher wants to merge 2 commits into
Open
Conversation
Separate stable snapshot identity from descriptor integrity and represent file state as an ordered layer closure. Preserve adjacent-release compatibility with automatic forward migration and explicit representable downgrade paths.\n\nAdd direct stopped-sandbox archive capture and archive-backed sandbox restore across the CLI and all SDKs without materializing an installed snapshot directory. Keep mutable labels in an owner-bound metadata sidecar and document the new artifact and API contracts.
Clean up incomplete archive-to-child staging and defer pinned image resolution to the single-pass local restore path while rejecting unsupported cloud conversion. Use portable archive member names across hosts and expose the root upper.ext4 binding before publishing v0.6.6 downgrade descriptors. Document archive inputs consistently across SDKs.
|
Comment on lines
+231
to
+239
| if let Some(archive_path) = args.archive.as_ref() { | ||
| let archive = builder.create_archive(archive_path, args.plain_tar).await?; | ||
| spinner.finish_success("Snapshotted"); | ||
| if !args.quiet { | ||
| println!("{}", archive.id()); | ||
| println!("{}", archive.path().display()); | ||
| } | ||
| return Ok(()); | ||
| } |
There was a problem hiding this comment.
Archive errors leave spinner active
When direct archive creation fails, ? returns without clearing the active spinner, leaving stale or malformed terminal output instead of following the adjacent snapshot-creation error path.
Suggested change
| if let Some(archive_path) = args.archive.as_ref() { | |
| let archive = builder.create_archive(archive_path, args.plain_tar).await?; | |
| spinner.finish_success("Snapshotted"); | |
| if !args.quiet { | |
| println!("{}", archive.id()); | |
| println!("{}", archive.path().display()); | |
| } | |
| return Ok(()); | |
| } | |
| if let Some(archive_path) = args.archive.as_ref() { | |
| return match builder.create_archive(archive_path, args.plain_tar).await { | |
| Ok(archive) => { | |
| spinner.finish_success("Snapshotted"); | |
| if !args.quiet { | |
| println!("{}", archive.id()); | |
| println!("{}", archive.path().display()); | |
| } | |
| Ok(()) | |
| } | |
| Err(e) => { | |
| spinner.finish_clear(); | |
| Err(e.into()) | |
| } | |
| }; | |
| } |
Prompt To Fix With AI
This is a comment left during a code review.
Path: crates/cli/lib/commands/snapshot.rs
Line: 231-239
Comment:
**Archive errors leave spinner active**
When direct archive creation fails, `?` returns without clearing the active spinner, leaving stale or malformed terminal output instead of following the adjacent snapshot-creation error path.
```suggestion
if let Some(archive_path) = args.archive.as_ref() {
return match builder.create_archive(archive_path, args.plain_tar).await {
Ok(archive) => {
spinner.finish_success("Snapshotted");
if !args.quiet {
println!("{}", archive.id());
println!("{}", archive.path().display());
}
Ok(())
}
Err(e) => {
spinner.finish_clear();
Err(e.into())
}
};
}
```
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.|
|
||
| /// Result of direct sandbox-to-archive capture. | ||
| #[napi(js_name = "SnapshotArchive")] | ||
| pub struct JsSnapshotArchive { |
7 tasks
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.
TL;DR
Finalize schema-1 snapshot artifacts and add direct stopped-sandbox archive capture and archive-to-child creation without installing an intermediate snapshot directory.
Description
Test Plan
cargo fmt --all -- --checkcargo test --locked --offline -p microsandbox-image --lib(211 passed, 4 ignored)cargo test --locked --offline -p microsandbox --test snapshot_artifact(43 passed)