Skip to content

v0.15.1: ARCH-1 step 1 — extract RcloneClient collaborator#42

Merged
NathanNeurotic merged 1 commit into
mainfrom
feature/v0.15.1-rclone-client
May 29, 2026
Merged

v0.15.1: ARCH-1 step 1 — extract RcloneClient collaborator#42
NathanNeurotic merged 1 commit into
mainfrom
feature/v0.15.1-rclone-client

Conversation

@NathanNeurotic
Copy link
Copy Markdown
Owner

Summary

First incremental step toward the audit's ARCH-1 ("`TrayContext` is a ~6 k-line god object"). Pulls all rclone process invocation behind a single `RcloneClient` class so future code can take it as a dependency without dragging in the rest of `TrayContext`.

No user-visible behavior changes — public API unchanged, every existing caller still works.

Changed

  • New `src/RcloneClient.cs` owns the "invoke rclone, return `ProcessResult`" surface:
    • `Run(arguments, timeoutMs)` and `Run(arguments, timeoutMs, envOverrides)` — replaces the inline `new ProcessStartInfo { ... }` boilerplate
    • `RunWithStdin(arguments, timeoutMs, stdin)` — for SEC-1's `rclone obscure -` pipe
    • Constructor takes a `Func` path provider so the client always sees the current `rclonePath` (which mutates over the app's lifetime as the user downloads / installs rclone)
  • `TrayContext.RunRcloneCapture` wrappers delegate to a lazy `RcloneInvoker` field.* Public API unchanged; existing callers don't need to change. New code should take `RcloneClient` directly for testability.
  • SEC-1 stdin path (`ObscureSecretViaStdin`) uses `RcloneInvoker.RunWithStdin` — no longer reaches into `RunCaptureCore` directly.

The remaining ARCH-1 sub-extractions (`SettingsStore`, `DependencyProbe`, `MountManager`) are intentionally not done here. The audit calls this work "incremental"; the rest can land in later releases as the natural shape of each collaborator emerges.

This closes the last finding from the audit — 17 of 17 audit items resolved or explicitly deferred-by-incremental-design.

Test plan

  • `scripts/run-tests.ps1` — 53/53 green
  • FileVersion 0.15.1.0
  • Real-world: install v0.15.1, do anything that touches rclone (mount, refresh, configure a new remote) — should work identically to v0.15.0

🤖 Generated with Claude Code

First incremental step toward the audit's ARCH-1. No user-visible
changes.

Changed:
- New src/RcloneClient.cs owns "invoke rclone, return ProcessResult".
  Methods: Run(args, timeoutMs), Run with envOverrides, RunWithStdin.
  Constructor takes Func<string> path provider so it always reads
  the latest rclonePath value (which mutates over app lifetime).
- TrayContext.RunRcloneCapture* wrappers delegate to RcloneInvoker
  (lazy RcloneClient field). Public API unchanged; existing callers
  unchanged. New code should take RcloneClient as a dependency.
- SEC-1 stdin path uses RcloneInvoker.RunWithStdin instead of
  reaching into RunCaptureCore.

The remaining ARCH-1 sub-extractions (SettingsStore, DependencyProbe,
MountManager) are intentionally NOT done here — the audit calls this
work incremental and the rest can land as needed.

53/53 tests green, FileVersion 0.15.1.0.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@gemini-code-assist
Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@NathanNeurotic NathanNeurotic merged commit 063b55c into main May 29, 2026
1 check passed
@NathanNeurotic NathanNeurotic deleted the feature/v0.15.1-rclone-client branch May 29, 2026 06:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant