mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-09-17 23:52:34 +00:00
Fabro's Docker provider kind now maps onto the sandbox-driver Docker provider instead of its own bollard implementation. Fabro keeps what is its own: the clone decision and repository layout, the GitHub App push credentials embedded in origin, git retry classification, the managed labels that gate destructive operations, and the run-facing events. - `clone.rs` performs fabro's clone over the driver `Git` and `Exec` facets. An exact commit goes through the driver's pinned clone; a tag pin runs fabro's init/fetch/attach sequence through `Exec` so the fully qualified tag ref is the only revision consulted. Network failures retry through `git_retry`, which now classifies driver errors (exec output, provider retryability) and never replays an operation whose outcome is unknown. - `DriverSandbox` gains a pending-create state, a `RepoWorkspace` with push-credential state, path resolution against the cloned working directory, git lifecycle methods, image-pull progress mapped from driver events, and an embedded terminal over the driver `Pty` facet. - `docker.rs` builds the driver `SandboxSpec` (image, `/workspace`, fabro labels, env, cpu/memory, network policy, run name) and attaches by persisted container id, refusing containers without fabro's labels. - Inventory, details, diagnostics, terminal, and reconnect run over the driver: a `DriverInventoryProvider` lists by fabro's managed label and projects `SandboxStatus` into fabro's inventory and details shapes. - The bollard-based `docker.rs`, `provider/docker.rs`, Docker terminal, Docker error variants, the `docker` cargo feature, and the bollard and tar dependencies are gone. The Docker integration tests, the agent shell test, the workflow artifact test, and the driver benchmark run against the driver-backed sandbox. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
13 lines
470 B
Rust
13 lines
470 B
Rust
#[test]
|
|
fn context_error_preserves_source_cause() {
|
|
let source = std::io::Error::new(std::io::ErrorKind::PermissionDenied, "permission denied");
|
|
|
|
let error = fabro_sandbox::Error::context("Failed to read file", source);
|
|
|
|
assert_eq!(error.to_string(), "Failed to read file");
|
|
assert_eq!(error.causes(), vec!["permission denied"]);
|
|
assert_eq!(
|
|
error.display_with_causes(),
|
|
"Failed to read file\n caused by: permission denied"
|
|
);
|
|
}
|