Skip to content

jumpstarter-driver-ssh-mount: follow-up improvements #597

@ambient-code

Description

@ambient-code

Follow-up items identified during PR #434 review that are deferred to keep the initial merge focused:

Improvements

  • Test-mount-then-real-mount pattern optimization — the current strategy does a full daemon mount/unmount/remount cycle to validate sshfs connectivity before starting the foreground mount. Consider using sshfs --version or a dry-run approach to reduce connection overhead.
  • Polling loop with backoff for mount readiness — after starting foreground sshfs, a single 1-second sleep + os.path.ismount() check could be replaced with a polling loop (e.g., check every 0.5s up to 10s) for robustness on slow connections.
  • Extract shared SSH utility logic — direct/fallback TCP connection pattern, temp identity file creation, and cleanup logic are duplicated between SSHMountClient and SSHWrapperClient. Extract into a shared utility module.
  • allow_other security documentation — document in the README that allow_other is enabled by default and its security implications on multi-user systems.
  • LSP deviation: CompositeClient inheritanceSSHMountClient inherits from CompositeClient but overrides cli() to return a click.Command instead of a click.Group. Consider using DriverClient as the base class since mount is a single command.

Test improvements

  • Restructure tests so argument-construction is validated independently from mount workflow tests
  • Flatten deeply nested with patch(...) blocks using pytest fixtures or helper context managers
  • Add test coverage for _create_temp_identity_file exception handler
  • Add KeyboardInterrupt test for foreground mode
  • Use side_effect for _find_executable mocks to return correct paths per executable

Ref: #434

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions