Skip to content

Handle forced missing cargo tools in packaging tests#1806

Merged
oferchen merged 2 commits into
masterfrom
fix-tests-for-missing-cargo-tools
Oct 31, 2025
Merged

Handle forced missing cargo tools in packaging tests#1806
oferchen merged 2 commits into
masterfrom
fix-tests-for-missing-cargo-tools

Conversation

@oferchen
Copy link
Copy Markdown
Owner

Summary

  • allow tests to simulate missing cargo subcommands via the OC_RSYNC_FORCE_MISSING_CARGO_TOOLS environment variable
  • update package command tests to scope multiple environment overrides safely while exercising the new hook
  • cover the forced-missing path with a dedicated unit test

Testing

  • cargo test -p xtask execute_reports_missing_cargo
  • cargo test -p xtask run_cargo_tool_honours_forced_missing_configuration
  • cargo fmt

https://chatgpt.com/codex/tasks/task_e_690546a2b1a083239cf1976917629a60

@oferchen oferchen merged commit f44d001 into master Oct 31, 2025
@oferchen oferchen deleted the fix-tests-for-missing-cargo-tools branch October 31, 2025 23:39
oferchen added a commit that referenced this pull request May 16, 2026
Expand the placeholder async migration plan into a comprehensive,
opinionated design covering: current synchronous threading model per
subsystem, per-subsystem cost/benefit, a phased incremental adoption
strategy, tokio runtime choice with rejected alternatives, sync/async
bridge patterns, backward-compat strategy, risk register, and open
questions.

Cross-references existing async-related tasks (#1367, #1411, #1591,
#1593, #1595, #1674, #1751, #1779, #1780, #1782, #1796, #1797, #1805,
#1806, #1889, #1890, #1891, #1892, #1934, #1935, #2136) and related
design notes so future planners have a single anchor.
oferchen added a commit that referenced this pull request May 16, 2026
Expand the placeholder async migration plan into a comprehensive,
opinionated design covering: current synchronous threading model per
subsystem, per-subsystem cost/benefit, a phased incremental adoption
strategy, tokio runtime choice with rejected alternatives, sync/async
bridge patterns, backward-compat strategy, risk register, and open
questions.

Cross-references existing async-related tasks (#1367, #1411, #1591,
#1593, #1595, #1674, #1751, #1779, #1780, #1782, #1796, #1797, #1805,
#1806, #1889, #1890, #1891, #1892, #1934, #1935, #2136) and related
design notes so future planners have a single anchor.
oferchen added a commit that referenced this pull request May 17, 2026
…e) (#1795) (#4266)

Introduce a structured connection primitive that wraps the existing
`SshCommand` builder behind explicit `SshConnectConfig` and
`KeepAliveConfig` structs. This is the first concrete step in the SSH
transport chain (#1795 -> #1796 -> #1797 -> #1805 -> #1806) and lets
upstream call sites compose connect, auth, and session-setup steps from
a single config value instead of a long sequence of builder setters.

The new `SshConnection::connect_with_config(remote, &config)` entry point
stays synchronous and reuses the existing watchdog + stderr-drain
plumbing. Defaults mirror the historical `SshCommand::new` behaviour
(30 s connect timeout, 20 s keepalive interval, 3 allowed failures); a
`None` field disables the corresponding `-o ConnectTimeout` or
`-o ServerAlive*` injection. The async variant is reserved for task
#1801 and intentionally not introduced here, so no new runtime
dependencies land in this PR.

Unit coverage exercises the config defaults, the builder-setter round
trip, the rendered argv (timeout, keepalive, remote command ordering),
keepalive disabled / custom-value cases, sub-second rounding, and
user/host splitting. A unix-gated, env-guarded smoke test
(`OC_RSYNC_SSH_NET=1`) confirms an unreachable host surfaces an
io::Error within ~2x the configured timeout.
oferchen added a commit that referenced this pull request May 17, 2026
…1805) (#4290)

Adds an async-ssh feature on the core crate that pulls in the tokio-backed
`rsync_io::ssh::AsyncSshTransport` (PR #4273) and bridges it into the
existing synchronous client transfer orchestration. A new
`async_ssh_transport` module spawns the async transport, copies bytes
between its `AsyncRead`/`AsyncWrite` halves and the sync handshake +
server-framing layer via the `ChannelReader`/`ChannelWriter` adapters,
and runs the sync server flow under `tokio::task::spawn_blocking`.

The client driver picks the async path when the `OC_RSYNC_ASYNC_SSH=1`
env var is set; the CLI flag is deferred to #1806. Progress observation
and remote-to-remote proxy transfers remain on the sync path for now.
oferchen added a commit that referenced this pull request May 17, 2026
…4295)

Adds the bridge primitives that let the existing synchronous multiplex
and transfer code drive an async russh channel without being ported to
async. Builds on PR #4290 (#1805) which wired the async SshTransport
into the client driver via the OC_RSYNC_ASYNC_SSH env var.

The new `ssh::embedded::sync_bridge` module is gated under
`embedded-ssh` and exposes:

- `SyncAsyncBridge<S>`: a generic facade that takes any
  `AsyncRead + AsyncWrite + Unpin + Send + 'static` stream (including
  russh's `ChannelStream`) and exposes `std::io::Read + std::io::Write`
  by driving an internal current-thread tokio runtime via `block_on`.
- `into_sync_halves(russh::Channel)` returning `(SyncReader, SyncWriter)`
  halves backed by a background pump task and bounded
  `std::sync::mpsc` / `tokio::sync::mpsc` queues - the inverse of the
  existing `ChannelReader`/`ChannelWriter` adapters in
  `channel_adapter.rs`.
- `into_sync_halves_with_capacity` for callers that need a different
  queue depth (used by the backpressure test).
oferchen added a commit that referenced this pull request May 18, 2026
Expand the placeholder async migration plan into a comprehensive,
opinionated design covering: current synchronous threading model per
subsystem, per-subsystem cost/benefit, a phased incremental adoption
strategy, tokio runtime choice with rejected alternatives, sync/async
bridge patterns, backward-compat strategy, risk register, and open
questions.

Cross-references existing async-related tasks (#1367, #1411, #1591,
#1593, #1595, #1674, #1751, #1779, #1780, #1782, #1796, #1797, #1805,
#1806, #1889, #1890, #1891, #1892, #1934, #1935, #2136) and related
design notes so future planners have a single anchor.
oferchen added a commit that referenced this pull request May 18, 2026
…e) (#1795) (#4266)

Introduce a structured connection primitive that wraps the existing
`SshCommand` builder behind explicit `SshConnectConfig` and
`KeepAliveConfig` structs. This is the first concrete step in the SSH
transport chain (#1795 -> #1796 -> #1797 -> #1805 -> #1806) and lets
upstream call sites compose connect, auth, and session-setup steps from
a single config value instead of a long sequence of builder setters.

The new `SshConnection::connect_with_config(remote, &config)` entry point
stays synchronous and reuses the existing watchdog + stderr-drain
plumbing. Defaults mirror the historical `SshCommand::new` behaviour
(30 s connect timeout, 20 s keepalive interval, 3 allowed failures); a
`None` field disables the corresponding `-o ConnectTimeout` or
`-o ServerAlive*` injection. The async variant is reserved for task
#1801 and intentionally not introduced here, so no new runtime
dependencies land in this PR.

Unit coverage exercises the config defaults, the builder-setter round
trip, the rendered argv (timeout, keepalive, remote command ordering),
keepalive disabled / custom-value cases, sub-second rounding, and
user/host splitting. A unix-gated, env-guarded smoke test
(`OC_RSYNC_SSH_NET=1`) confirms an unreachable host surfaces an
io::Error within ~2x the configured timeout.
oferchen added a commit that referenced this pull request May 18, 2026
…1805) (#4290)

Adds an async-ssh feature on the core crate that pulls in the tokio-backed
`rsync_io::ssh::AsyncSshTransport` (PR #4273) and bridges it into the
existing synchronous client transfer orchestration. A new
`async_ssh_transport` module spawns the async transport, copies bytes
between its `AsyncRead`/`AsyncWrite` halves and the sync handshake +
server-framing layer via the `ChannelReader`/`ChannelWriter` adapters,
and runs the sync server flow under `tokio::task::spawn_blocking`.

The client driver picks the async path when the `OC_RSYNC_ASYNC_SSH=1`
env var is set; the CLI flag is deferred to #1806. Progress observation
and remote-to-remote proxy transfers remain on the sync path for now.
oferchen added a commit that referenced this pull request May 18, 2026
…4295)

Adds the bridge primitives that let the existing synchronous multiplex
and transfer code drive an async russh channel without being ported to
async. Builds on PR #4290 (#1805) which wired the async SshTransport
into the client driver via the OC_RSYNC_ASYNC_SSH env var.

The new `ssh::embedded::sync_bridge` module is gated under
`embedded-ssh` and exposes:

- `SyncAsyncBridge<S>`: a generic facade that takes any
  `AsyncRead + AsyncWrite + Unpin + Send + 'static` stream (including
  russh's `ChannelStream`) and exposes `std::io::Read + std::io::Write`
  by driving an internal current-thread tokio runtime via `block_on`.
- `into_sync_halves(russh::Channel)` returning `(SyncReader, SyncWriter)`
  halves backed by a background pump task and bounded
  `std::sync::mpsc` / `tokio::sync::mpsc` queues - the inverse of the
  existing `ChannelReader`/`ChannelWriter` adapters in
  `channel_adapter.rs`.
- `into_sync_halves_with_capacity` for callers that need a different
  queue depth (used by the backpressure test).
oferchen added a commit that referenced this pull request May 18, 2026
Expand the placeholder async migration plan into a comprehensive,
opinionated design covering: current synchronous threading model per
subsystem, per-subsystem cost/benefit, a phased incremental adoption
strategy, tokio runtime choice with rejected alternatives, sync/async
bridge patterns, backward-compat strategy, risk register, and open
questions.

Cross-references existing async-related tasks (#1367, #1411, #1591,
#1593, #1595, #1674, #1751, #1779, #1780, #1782, #1796, #1797, #1805,
#1806, #1889, #1890, #1891, #1892, #1934, #1935, #2136) and related
design notes so future planners have a single anchor.
oferchen added a commit that referenced this pull request May 18, 2026
…e) (#1795) (#4266)

Introduce a structured connection primitive that wraps the existing
`SshCommand` builder behind explicit `SshConnectConfig` and
`KeepAliveConfig` structs. This is the first concrete step in the SSH
transport chain (#1795 -> #1796 -> #1797 -> #1805 -> #1806) and lets
upstream call sites compose connect, auth, and session-setup steps from
a single config value instead of a long sequence of builder setters.

The new `SshConnection::connect_with_config(remote, &config)` entry point
stays synchronous and reuses the existing watchdog + stderr-drain
plumbing. Defaults mirror the historical `SshCommand::new` behaviour
(30 s connect timeout, 20 s keepalive interval, 3 allowed failures); a
`None` field disables the corresponding `-o ConnectTimeout` or
`-o ServerAlive*` injection. The async variant is reserved for task
#1801 and intentionally not introduced here, so no new runtime
dependencies land in this PR.

Unit coverage exercises the config defaults, the builder-setter round
trip, the rendered argv (timeout, keepalive, remote command ordering),
keepalive disabled / custom-value cases, sub-second rounding, and
user/host splitting. A unix-gated, env-guarded smoke test
(`OC_RSYNC_SSH_NET=1`) confirms an unreachable host surfaces an
io::Error within ~2x the configured timeout.
oferchen added a commit that referenced this pull request May 18, 2026
…1805) (#4290)

Adds an async-ssh feature on the core crate that pulls in the tokio-backed
`rsync_io::ssh::AsyncSshTransport` (PR #4273) and bridges it into the
existing synchronous client transfer orchestration. A new
`async_ssh_transport` module spawns the async transport, copies bytes
between its `AsyncRead`/`AsyncWrite` halves and the sync handshake +
server-framing layer via the `ChannelReader`/`ChannelWriter` adapters,
and runs the sync server flow under `tokio::task::spawn_blocking`.

The client driver picks the async path when the `OC_RSYNC_ASYNC_SSH=1`
env var is set; the CLI flag is deferred to #1806. Progress observation
and remote-to-remote proxy transfers remain on the sync path for now.
oferchen added a commit that referenced this pull request May 18, 2026
…4295)

Adds the bridge primitives that let the existing synchronous multiplex
and transfer code drive an async russh channel without being ported to
async. Builds on PR #4290 (#1805) which wired the async SshTransport
into the client driver via the OC_RSYNC_ASYNC_SSH env var.

The new `ssh::embedded::sync_bridge` module is gated under
`embedded-ssh` and exposes:

- `SyncAsyncBridge<S>`: a generic facade that takes any
  `AsyncRead + AsyncWrite + Unpin + Send + 'static` stream (including
  russh's `ChannelStream`) and exposes `std::io::Read + std::io::Write`
  by driving an internal current-thread tokio runtime via `block_on`.
- `into_sync_halves(russh::Channel)` returning `(SyncReader, SyncWriter)`
  halves backed by a background pump task and bounded
  `std::sync::mpsc` / `tokio::sync::mpsc` queues - the inverse of the
  existing `ChannelReader`/`ChannelWriter` adapters in
  `channel_adapter.rs`.
- `into_sync_halves_with_capacity` for callers that need a different
  queue depth (used by the backpressure test).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant