Skip to content
This repository was archived by the owner on Jan 23, 2026. It is now read-only.

ridesx: add timeouts and boot-to-fastboot#751

Merged
mangelajo merged 1 commit intomainfrom
ridesx-timeouts
Nov 27, 2025
Merged

ridesx: add timeouts and boot-to-fastboot#751
mangelajo merged 1 commit intomainfrom
ridesx-timeouts

Conversation

@mangelajo
Copy link
Copy Markdown
Member

@mangelajo mangelajo commented Nov 27, 2025

Summary by CodeRabbit

  • New Features

    • Added a boot_to_fastboot CLI command.
    • Exposed configurable timeouts for decompression, flashing, and continuation with sensible defaults.
  • Tests

    • Added a comprehensive test suite covering device detection, decompression, flashing workflows, boot-to-fastboot behavior, and power operations.
  • Chores

    • Updated project dependencies and test asyncio configuration.

✏️ Tip: You can customize this high-level summary in your review settings.

@netlify
Copy link
Copy Markdown

netlify Bot commented Nov 27, 2025

Deploy Preview for jumpstarter-docs ready!

Name Link
🔨 Latest commit 874f93e
🔍 Latest deploy log https://app.netlify.com/projects/jumpstarter-docs/deploys/69285ece7a999f0008adb07f
😎 Deploy Preview https://deploy-preview-751--jumpstarter-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Nov 27, 2025

Warning

Rate limit exceeded

@mangelajo has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 16 minutes and 52 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between d451824 and 874f93e.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (4)
  • packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/client.py (1 hunks)
  • packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/driver.py (4 hunks)
  • packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/driver_test.py (1 hunks)
  • packages/jumpstarter-driver-ridesx/pyproject.toml (2 hunks)

Walkthrough

Renames the RideSX client CLI inner group from storage to base, adds a boot_to_fastboot subcommand, introduces three configurable timeout fields on RideSXDriver replacing hardcoded timeouts, adds an extensive driver test suite, and updates pyproject dependencies and pytest asyncio config.

Changes

Cohort / File(s) Change Summary
CLI Updates
packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/client.py
Replaced inner CLI group storage with base; wired existing generic CLI commands into base; added new boot_to_fastboot subcommand that invokes RideSXClient.boot_to_fastboot.
Driver Timeout Configuration
packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/driver.py
Added public int fields decompression_timeout, flash_timeout, and continue_timeout (defaults 900, 1800, 1200); replaced hardcoded timeouts in _decompress_file and flash_with_fastboot with those fields.
Tests & Project Config
packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/driver_test.py, packages/jumpstarter-driver-ridesx/pyproject.toml
Added comprehensive tests covering fastboot detection, decompression, flashing flows, and power driver behavior; added dependencies jumpstarter-driver-composite and jumpstarter-driver-power; enabled asyncio_mode = "auto" and added pytest-asyncio to dev deps.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Inspect driver_test.py for accurate mocking of subprocess/async behavior and that tests assert intended command sequences and error translations.
  • Verify default timeout values and that all previous hardcoded timeouts were replaced correctly and consistently.
  • Confirm CLI rename (storage → base) and new boot_to_fastboot command do not break external usages or scripts.

Possibly related PRs

Suggested reviewers

  • bennyz

Poem

🐇 I hopped through code with careful paws,

Renamed a group and tuned time laws.
Tests now guard each flashing beat,
A boot-to-fastboot trick so neat,
Carrots, timeouts, and a tidy feat! 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 18.42% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'ridesx: add timeouts and boot-to-fastboot' directly and accurately reflects the two main changes: configurable timeouts for decompression/flash/continue operations and a new boot_to_fastboot CLI subcommand.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@mangelajo mangelajo requested review from bennyz and bkhizgiy November 27, 2025 13:10
@mangelajo mangelajo force-pushed the ridesx-timeouts branch 2 times, most recently from 78f9464 to 98f2907 Compare November 27, 2025 13:14
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (4)
packages/jumpstarter-driver-ridesx/pyproject.toml (1)

30-44: Tighten pytest‑asyncio version to match asyncio_mode = "auto"

Enabling asyncio_mode = "auto" while allowing any pytest-asyncio>=0.0.0 risks pulling in versions that don’t support this mode or interact poorly with newer pytest.

Consider raising the minimum pytest-asyncio version here to one that officially supports asyncio_mode = "auto" and your target pytest version, and documenting that constraint in the dev group.

packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/driver.py (1)

17-19: Configurable timeouts look good; confirm fastboot continue timeout semantics

The new timeout fields and wiring into decompression and flash calls are clear and make behaviour configurable.

One thing to double‑check: in flash_with_fastboot, timeouts are handled asymmetrically:

  • Flash step: timeout=self.flash_timeout and you explicitly catch subprocess.TimeoutExpired, turning it into a RuntimeError("timeout while flashing …").
  • Continue step: timeout=self.continue_timeout, but only CalledProcessError is caught; a TimeoutExpired from fastboot continue will bubble up as an uncaught exception.

If fastboot continue failures are meant to be non‑fatal (as implied by only warning on CalledProcessError), you may want to also catch TimeoutExpired there and either just log a warning or convert it to a consistent RuntimeError. If the intention is for a hung continue to hard‑fail the operation, then this asymmetry is fine but should be deliberate.

Also applies to: 79-80, 172-199

packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/client.py (1)

120-137: CLI wiring for base and boot_to_fastboot looks good; consider updating help text

Wiring the generic flasher commands into a base group and exposing a boot_to_fastboot subcommand via self.boot_to_fastboot() is consistent with the rest of the driver stack.

Nit: the base group docstring still says "RideSX storage operations", but this group now also exposes boot‑to‑fastboot and generic flashing behaviour. You might want to reword it (e.g. “RideSX operations” or similar) so the CLI help better reflects what’s available.

packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/driver_test.py (1)

432-439: test_boot_to_fastboot_exported is currently a no‑op

This test body only does assert True, so it will always pass and does not verify that boot_to_fastboot is actually exported or callable through the client:

with serve(ridesx_driver):
    # ...
    assert True  # Method exists and is exported

Either replace this with a concrete assertion (e.g. checking that the method name appears in whatever registry serve exposes, or at least hasattr(ridesx_driver, "boot_to_fastboot")) or consider removing the test to avoid a false sense of coverage.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 09cb716 and 98f2907.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (4)
  • packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/client.py (1 hunks)
  • packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/driver.py (4 hunks)
  • packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/driver_test.py (1 hunks)
  • packages/jumpstarter-driver-ridesx/pyproject.toml (3 hunks)
🧰 Additional context used
📓 Path-based instructions (6)
packages/jumpstarter-driver-*/jumpstarter_driver_*/client.py

📄 CodeRabbit inference engine (.cursor/rules/creating-new-drivers.mdc)

Driver client CLIs should either implement known classes that provide a CLI interface, or implement their own CLI interface. Use CompositeClient from jumpstarter_driver_composite.client for composite drivers with child drivers.

Files:

  • packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/client.py
packages/jumpstarter-driver-**/jumpstarter_driver_**/*.py

📄 CodeRabbit inference engine (.cursor/rules/creating-new-drivers.mdc)

Driver implementations should follow existing code style validated with make lint (fix with make lint-fix), perform static type checking with make ty-pkg-${package_name}, add comprehensive tests, and verify all tests pass with make test-pkg-${package_name} or make test

Files:

  • packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/client.py
  • packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/driver_test.py
  • packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/driver.py
**/*.py

📄 CodeRabbit inference engine (.cursor/rules/project-structure.mdc)

Ruff should be used for code formatting and linting, excluding jumpstarter-protocol package

Files:

  • packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/client.py
  • packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/driver_test.py
  • packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/driver.py
packages/jumpstarter-driver-*/jumpstarter_driver_*/driver.py

📄 CodeRabbit inference engine (.cursor/rules/creating-new-drivers.mdc)

Driver class names should be in CamelCase and be descriptive with appropriate suffixes based on functionality: Power drivers should end with *Power, Network drivers with *Network, Flasher drivers with *Flasher, Console drivers with *Console, Server drivers with *Server

Files:

  • packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/driver.py
packages/jumpstarter-driver-*/pyproject.toml

📄 CodeRabbit inference engine (.cursor/rules/creating-new-drivers.mdc)

Driver package names should be lowercase with hyphens for multi-word names (e.g., my-driver, custom-power, device-controller)

packages/jumpstarter-driver-*/pyproject.toml: Driver packages must follow the naming pattern jumpstarter-driver-<name>
Driver packages must register via the jumpstarter.drivers entry point in pyproject.toml
Driver packages must depend on jumpstarter and specific hardware libraries in their pyproject.toml

Files:

  • packages/jumpstarter-driver-ridesx/pyproject.toml
packages/*/pyproject.toml

📄 CodeRabbit inference engine (.cursor/rules/project-structure.mdc)

Each package's pyproject.toml must include project metadata with Apache-2.0 license only

Files:

  • packages/jumpstarter-driver-ridesx/pyproject.toml
🧠 Learnings (16)
📓 Common learnings
Learnt from: mangelajo
Repo: jumpstarter-dev/jumpstarter PR: 610
File: packages/jumpstarter-driver-flashers/jumpstarter_driver_flashers/client.py:488-491
Timestamp: 2025-09-15T08:18:48.571Z
Learning: In the jumpstarter project, code review suggestions should stay focused on the specific scope of the PR. Suggestions about general improvements like timeout handling or error handling that are unrelated to the core changes being made should be avoided, even if they apply to modified code lines.
📚 Learning: 2025-11-27T09:58:41.865Z
Learnt from: CR
Repo: jumpstarter-dev/jumpstarter PR: 0
File: .cursor/rules/creating-new-drivers.mdc:0-0
Timestamp: 2025-11-27T09:58:41.865Z
Learning: Applies to packages/jumpstarter-driver-*/jumpstarter_driver_*/client.py : Driver client CLIs should either implement known classes that provide a CLI interface, or implement their own CLI interface. Use `CompositeClient` from `jumpstarter_driver_composite.client` for composite drivers with child drivers.

Applied to files:

  • packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/client.py
📚 Learning: 2025-11-27T09:58:55.336Z
Learnt from: CR
Repo: jumpstarter-dev/jumpstarter PR: 0
File: .cursor/rules/project-structure.mdc:0-0
Timestamp: 2025-11-27T09:58:55.336Z
Learning: Applies to packages/jumpstarter-driver-*/jumpstarter_driver_*/ : Driver packages must implement a `client.py` file containing the client implementation

Applied to files:

  • packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/client.py
  • packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/driver_test.py
  • packages/jumpstarter-driver-ridesx/pyproject.toml
📚 Learning: 2025-11-27T09:58:41.865Z
Learnt from: CR
Repo: jumpstarter-dev/jumpstarter PR: 0
File: .cursor/rules/creating-new-drivers.mdc:0-0
Timestamp: 2025-11-27T09:58:41.865Z
Learning: Applies to packages/jumpstarter-driver-**/jumpstarter_driver_**/*.py : Driver implementations should follow existing code style validated with `make lint` (fix with `make lint-fix`), perform static type checking with `make ty-pkg-${package_name}`, add comprehensive tests, and verify all tests pass with `make test-pkg-${package_name}` or `make test`

Applied to files:

  • packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/driver_test.py
  • packages/jumpstarter-driver-ridesx/pyproject.toml
📚 Learning: 2025-11-27T09:58:55.336Z
Learnt from: CR
Repo: jumpstarter-dev/jumpstarter PR: 0
File: .cursor/rules/project-structure.mdc:0-0
Timestamp: 2025-11-27T09:58:55.336Z
Learning: Applies to packages/jumpstarter-driver-*/jumpstarter_driver_*/ : Driver packages must implement a `driver.py` file containing the driver implementation

Applied to files:

  • packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/driver_test.py
  • packages/jumpstarter-driver-ridesx/pyproject.toml
📚 Learning: 2025-11-27T09:58:41.865Z
Learnt from: CR
Repo: jumpstarter-dev/jumpstarter PR: 0
File: .cursor/rules/creating-new-drivers.mdc:0-0
Timestamp: 2025-11-27T09:58:41.865Z
Learning: After driver creation, implement driver logic in `driver.py`, add tests in `driver_test.py`, update README.md with specific documentation, and test the driver

Applied to files:

  • packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/driver_test.py
📚 Learning: 2025-11-27T09:58:41.865Z
Learnt from: CR
Repo: jumpstarter-dev/jumpstarter PR: 0
File: .cursor/rules/creating-new-drivers.mdc:0-0
Timestamp: 2025-11-27T09:58:41.865Z
Learning: Applies to packages/jumpstarter-driver-*/jumpstarter_driver_*/driver.py : Driver class names should be in CamelCase and be descriptive with appropriate suffixes based on functionality: Power drivers should end with `*Power`, Network drivers with `*Network`, Flasher drivers with `*Flasher`, Console drivers with `*Console`, Server drivers with `*Server`

Applied to files:

  • packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/driver_test.py
📚 Learning: 2025-11-27T09:58:55.336Z
Learnt from: CR
Repo: jumpstarter-dev/jumpstarter PR: 0
File: .cursor/rules/project-structure.mdc:0-0
Timestamp: 2025-11-27T09:58:55.336Z
Learning: Applies to packages/jumpstarter-driver-*/pyproject.toml : Driver packages must register via the `jumpstarter.drivers` entry point in `pyproject.toml`

Applied to files:

  • packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/driver_test.py
  • packages/jumpstarter-driver-ridesx/pyproject.toml
📚 Learning: 2025-11-27T09:58:55.336Z
Learnt from: CR
Repo: jumpstarter-dev/jumpstarter PR: 0
File: .cursor/rules/project-structure.mdc:0-0
Timestamp: 2025-11-27T09:58:55.336Z
Learning: Applies to packages/jumpstarter-driver-*/pyproject.toml : Driver packages must follow the naming pattern `jumpstarter-driver-<name>`

Applied to files:

  • packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/driver_test.py
  • packages/jumpstarter-driver-ridesx/pyproject.toml
📚 Learning: 2025-11-27T09:58:55.336Z
Learnt from: CR
Repo: jumpstarter-dev/jumpstarter PR: 0
File: .cursor/rules/project-structure.mdc:0-0
Timestamp: 2025-11-27T09:58:55.336Z
Learning: Applies to packages/jumpstarter-driver-*/pyproject.toml : Driver packages must depend on `jumpstarter` and specific hardware libraries in their `pyproject.toml`

Applied to files:

  • packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/driver_test.py
  • packages/jumpstarter-driver-ridesx/pyproject.toml
📚 Learning: 2025-11-27T09:58:41.865Z
Learnt from: CR
Repo: jumpstarter-dev/jumpstarter PR: 0
File: .cursor/rules/creating-new-drivers.mdc:0-0
Timestamp: 2025-11-27T09:58:41.865Z
Learning: Applies to packages/jumpstarter-driver-composite/pyproject.toml : Composite drivers that have child drivers should inherit from `CompositeClient` in `jumpstarter_driver_composite.client` and have a dependency on `jumpstarter-driver-composite` in `pyproject.toml`

Applied to files:

  • packages/jumpstarter-driver-ridesx/pyproject.toml
📚 Learning: 2025-11-27T09:58:55.336Z
Learnt from: CR
Repo: jumpstarter-dev/jumpstarter PR: 0
File: .cursor/rules/project-structure.mdc:0-0
Timestamp: 2025-11-27T09:58:55.336Z
Learning: Applies to packages/jumpstarter-cli-*/pyproject.toml : CLI packages must depend on `jumpstarter` and `jumpstarter-cli-common` in their `pyproject.toml`

Applied to files:

  • packages/jumpstarter-driver-ridesx/pyproject.toml
📚 Learning: 2025-11-27T09:58:55.336Z
Learnt from: CR
Repo: jumpstarter-dev/jumpstarter PR: 0
File: .cursor/rules/project-structure.mdc:0-0
Timestamp: 2025-11-27T09:58:55.336Z
Learning: Applies to examples/*/pyproject.toml : Example packages should depend on relevant driver packages in their `pyproject.toml`

Applied to files:

  • packages/jumpstarter-driver-ridesx/pyproject.toml
📚 Learning: 2025-11-27T09:58:41.865Z
Learnt from: CR
Repo: jumpstarter-dev/jumpstarter PR: 0
File: .cursor/rules/creating-new-drivers.mdc:0-0
Timestamp: 2025-11-27T09:58:41.865Z
Learning: Applies to packages/jumpstarter-driver-*/pyproject.toml : Driver package names should be lowercase with hyphens for multi-word names (e.g., `my-driver`, `custom-power`, `device-controller`)

Applied to files:

  • packages/jumpstarter-driver-ridesx/pyproject.toml
📚 Learning: 2025-11-05T13:45:58.271Z
Learnt from: mangelajo
Repo: jumpstarter-dev/jumpstarter PR: 735
File: packages/jumpstarter-driver-flashers/jumpstarter_driver_flashers/client.py:15-15
Timestamp: 2025-11-05T13:45:58.271Z
Learning: In packages/jumpstarter-driver-flashers/jumpstarter_driver_flashers/client.py, pexpect is intentionally used as a transitive dependency through the jumpstarter-driver-pyserial package. The flashers package does not declare pexpect as a direct dependency because the pyserial driver package is intended to control the pexpect version.

Applied to files:

  • packages/jumpstarter-driver-ridesx/pyproject.toml
📚 Learning: 2025-11-27T09:58:55.336Z
Learnt from: CR
Repo: jumpstarter-dev/jumpstarter PR: 0
File: .cursor/rules/project-structure.mdc:0-0
Timestamp: 2025-11-27T09:58:55.336Z
Learning: Core packages must depend on `jumpstarter-protocol`

Applied to files:

  • packages/jumpstarter-driver-ridesx/pyproject.toml
🧬 Code graph analysis (2)
packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/client.py (11)
packages/jumpstarter-driver-flashers/jumpstarter_driver_flashers/client.py (1)
  • base (1123-1125)
packages/jumpstarter-driver-shell/jumpstarter_driver_shell/client.py (1)
  • base (46-48)
packages/jumpstarter-driver-composite/jumpstarter_driver_composite/client.py (1)
  • base (47-49)
packages/jumpstarter-driver-network/jumpstarter_driver_network/client.py (1)
  • base (25-27)
packages/jumpstarter-driver-power/jumpstarter_driver_power/client.py (1)
  • base (40-42)
packages/jumpstarter-driver-pyserial/jumpstarter_driver_pyserial/client.py (1)
  • base (41-43)
packages/jumpstarter-driver-probe-rs/jumpstarter_driver_probe_rs/client.py (1)
  • base (65-67)
packages/jumpstarter-driver-opendal/jumpstarter_driver_opendal/client.py (3)
  • base (418-420)
  • base (554-556)
  • base (722-724)
packages/jumpstarter/jumpstarter/common/metadata.py (1)
  • name (13-14)
packages/jumpstarter-driver-ssh/jumpstarter_driver_ssh/client.py (1)
  • command (98-100)
packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/driver.py (1)
  • boot_to_fastboot (201-237)
packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/driver_test.py (3)
packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/driver.py (11)
  • RideSXDriver (15-237)
  • RideSXPowerDriver (241-288)
  • client (37-38)
  • client (252-253)
  • _needs_decompression (48-49)
  • _get_decompression_command (40-46)
  • _decompress_file (51-98)
  • boot_to_fastboot (201-237)
  • on (256-264)
  • off (267-275)
  • cycle (278-283)
packages/jumpstarter/jumpstarter/client/core.py (1)
  • DriverError (33-36)
packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/client.py (5)
  • boot_to_fastboot (22-23)
  • boot_to_fastboot (132-134)
  • on (150-152)
  • off (154-156)
  • cycle (158-160)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: Redirect rules - jumpstarter-docs
  • GitHub Check: Header rules - jumpstarter-docs
  • GitHub Check: Pages changed - jumpstarter-docs
  • GitHub Check: pytest-matrix (ubuntu-24.04, 3.12)
  • GitHub Check: e2e
  • GitHub Check: pytest-matrix (ubuntu-24.04, 3.11)
  • GitHub Check: pytest-matrix (ubuntu-24.04, 3.13)

Comment thread packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/driver_test.py Outdated
@mangelajo mangelajo force-pushed the ridesx-timeouts branch 2 times, most recently from 96b8097 to d451824 Compare November 27, 2025 14:07
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (3)
packages/jumpstarter-driver-ridesx/pyproject.toml (1)

32-33: Remove stale commented-out configuration.

Line 33 contains #asyncio_mode = "auto" under [tool.uv.sources], which appears to be a leftover from moving the setting to [tool.pytest.ini_options]. This commented line under the wrong section adds confusion.

 [tool.uv.sources]
-#asyncio_mode = "auto"
packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/driver_test.py (2)

150-172: Remove unused Path object creation.

Line 153 creates a Path object that is never assigned to a variable or used:

Path(temp_storage_dir) / "test"  # This does nothing
     compressed_file = Path(temp_storage_dir) / "test.gz"
     compressed_file.write_bytes(b"compressed data")
-    Path(temp_storage_dir) / "test"

174-196: Same unused Path object issue in xz test.

Line 177 has the same dead code pattern.

     compressed_file = Path(temp_storage_dir) / "test.xz"
     compressed_file.write_bytes(b"compressed data")
-    Path(temp_storage_dir) / "test"
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 96b8097 and d451824.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (4)
  • packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/client.py (1 hunks)
  • packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/driver.py (4 hunks)
  • packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/driver_test.py (1 hunks)
  • packages/jumpstarter-driver-ridesx/pyproject.toml (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/client.py
  • packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/driver.py
🧰 Additional context used
📓 Path-based instructions (4)
packages/jumpstarter-driver-*/pyproject.toml

📄 CodeRabbit inference engine (.cursor/rules/creating-new-drivers.mdc)

Driver package names should be lowercase with hyphens for multi-word names (e.g., my-driver, custom-power, device-controller)

packages/jumpstarter-driver-*/pyproject.toml: Driver packages must follow the naming pattern jumpstarter-driver-<name>
Driver packages must register via the jumpstarter.drivers entry point in pyproject.toml
Driver packages must depend on jumpstarter and specific hardware libraries in their pyproject.toml

Files:

  • packages/jumpstarter-driver-ridesx/pyproject.toml
packages/*/pyproject.toml

📄 CodeRabbit inference engine (.cursor/rules/project-structure.mdc)

Each package's pyproject.toml must include project metadata with Apache-2.0 license only

Files:

  • packages/jumpstarter-driver-ridesx/pyproject.toml
packages/jumpstarter-driver-**/jumpstarter_driver_**/*.py

📄 CodeRabbit inference engine (.cursor/rules/creating-new-drivers.mdc)

Driver implementations should follow existing code style validated with make lint (fix with make lint-fix), perform static type checking with make ty-pkg-${package_name}, add comprehensive tests, and verify all tests pass with make test-pkg-${package_name} or make test

Files:

  • packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/driver_test.py
**/*.py

📄 CodeRabbit inference engine (.cursor/rules/project-structure.mdc)

Ruff should be used for code formatting and linting, excluding jumpstarter-protocol package

Files:

  • packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/driver_test.py
🧠 Learnings (17)
📓 Common learnings
Learnt from: mangelajo
Repo: jumpstarter-dev/jumpstarter PR: 610
File: packages/jumpstarter-driver-flashers/jumpstarter_driver_flashers/client.py:488-491
Timestamp: 2025-09-15T08:18:48.571Z
Learning: In the jumpstarter project, code review suggestions should stay focused on the specific scope of the PR. Suggestions about general improvements like timeout handling or error handling that are unrelated to the core changes being made should be avoided, even if they apply to modified code lines.
📚 Learning: 2025-11-27T09:58:55.336Z
Learnt from: CR
Repo: jumpstarter-dev/jumpstarter PR: 0
File: .cursor/rules/project-structure.mdc:0-0
Timestamp: 2025-11-27T09:58:55.336Z
Learning: Applies to packages/jumpstarter-driver-*/pyproject.toml : Driver packages must depend on `jumpstarter` and specific hardware libraries in their `pyproject.toml`

Applied to files:

  • packages/jumpstarter-driver-ridesx/pyproject.toml
📚 Learning: 2025-11-27T09:58:41.865Z
Learnt from: CR
Repo: jumpstarter-dev/jumpstarter PR: 0
File: .cursor/rules/creating-new-drivers.mdc:0-0
Timestamp: 2025-11-27T09:58:41.865Z
Learning: Applies to packages/jumpstarter-driver-composite/pyproject.toml : Composite drivers that have child drivers should inherit from `CompositeClient` in `jumpstarter_driver_composite.client` and have a dependency on `jumpstarter-driver-composite` in `pyproject.toml`

Applied to files:

  • packages/jumpstarter-driver-ridesx/pyproject.toml
📚 Learning: 2025-11-27T09:58:55.336Z
Learnt from: CR
Repo: jumpstarter-dev/jumpstarter PR: 0
File: .cursor/rules/project-structure.mdc:0-0
Timestamp: 2025-11-27T09:58:55.336Z
Learning: Applies to packages/jumpstarter-driver-*/pyproject.toml : Driver packages must register via the `jumpstarter.drivers` entry point in `pyproject.toml`

Applied to files:

  • packages/jumpstarter-driver-ridesx/pyproject.toml
  • packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/driver_test.py
📚 Learning: 2025-11-27T09:58:55.336Z
Learnt from: CR
Repo: jumpstarter-dev/jumpstarter PR: 0
File: .cursor/rules/project-structure.mdc:0-0
Timestamp: 2025-11-27T09:58:55.336Z
Learning: Applies to packages/jumpstarter-driver-*/pyproject.toml : Driver packages must follow the naming pattern `jumpstarter-driver-<name>`

Applied to files:

  • packages/jumpstarter-driver-ridesx/pyproject.toml
📚 Learning: 2025-11-27T09:58:55.336Z
Learnt from: CR
Repo: jumpstarter-dev/jumpstarter PR: 0
File: .cursor/rules/project-structure.mdc:0-0
Timestamp: 2025-11-27T09:58:55.336Z
Learning: Applies to packages/jumpstarter-cli-*/pyproject.toml : CLI packages must depend on `jumpstarter` and `jumpstarter-cli-common` in their `pyproject.toml`

Applied to files:

  • packages/jumpstarter-driver-ridesx/pyproject.toml
📚 Learning: 2025-11-27T09:58:41.865Z
Learnt from: CR
Repo: jumpstarter-dev/jumpstarter PR: 0
File: .cursor/rules/creating-new-drivers.mdc:0-0
Timestamp: 2025-11-27T09:58:41.865Z
Learning: Applies to packages/jumpstarter-driver-*/pyproject.toml : Driver package names should be lowercase with hyphens for multi-word names (e.g., `my-driver`, `custom-power`, `device-controller`)

Applied to files:

  • packages/jumpstarter-driver-ridesx/pyproject.toml
📚 Learning: 2025-11-27T09:58:55.336Z
Learnt from: CR
Repo: jumpstarter-dev/jumpstarter PR: 0
File: .cursor/rules/project-structure.mdc:0-0
Timestamp: 2025-11-27T09:58:55.336Z
Learning: Applies to examples/*/pyproject.toml : Example packages should depend on relevant driver packages in their `pyproject.toml`

Applied to files:

  • packages/jumpstarter-driver-ridesx/pyproject.toml
📚 Learning: 2025-11-27T09:58:41.865Z
Learnt from: CR
Repo: jumpstarter-dev/jumpstarter PR: 0
File: .cursor/rules/creating-new-drivers.mdc:0-0
Timestamp: 2025-11-27T09:58:41.865Z
Learning: Applies to packages/jumpstarter-driver-**/jumpstarter_driver_**/*.py : Driver implementations should follow existing code style validated with `make lint` (fix with `make lint-fix`), perform static type checking with `make ty-pkg-${package_name}`, add comprehensive tests, and verify all tests pass with `make test-pkg-${package_name}` or `make test`

Applied to files:

  • packages/jumpstarter-driver-ridesx/pyproject.toml
  • packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/driver_test.py
📚 Learning: 2025-11-27T09:58:55.336Z
Learnt from: CR
Repo: jumpstarter-dev/jumpstarter PR: 0
File: .cursor/rules/project-structure.mdc:0-0
Timestamp: 2025-11-27T09:58:55.336Z
Learning: Applies to packages/jumpstarter-driver-*/jumpstarter_driver_*/ : Driver packages must implement a `driver.py` file containing the driver implementation

Applied to files:

  • packages/jumpstarter-driver-ridesx/pyproject.toml
  • packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/driver_test.py
📚 Learning: 2025-11-05T13:45:58.271Z
Learnt from: mangelajo
Repo: jumpstarter-dev/jumpstarter PR: 735
File: packages/jumpstarter-driver-flashers/jumpstarter_driver_flashers/client.py:15-15
Timestamp: 2025-11-05T13:45:58.271Z
Learning: In packages/jumpstarter-driver-flashers/jumpstarter_driver_flashers/client.py, pexpect is intentionally used as a transitive dependency through the jumpstarter-driver-pyserial package. The flashers package does not declare pexpect as a direct dependency because the pyserial driver package is intended to control the pexpect version.

Applied to files:

  • packages/jumpstarter-driver-ridesx/pyproject.toml
📚 Learning: 2025-11-27T09:58:55.336Z
Learnt from: CR
Repo: jumpstarter-dev/jumpstarter PR: 0
File: .cursor/rules/project-structure.mdc:0-0
Timestamp: 2025-11-27T09:58:55.336Z
Learning: Core packages must depend on `jumpstarter-protocol`

Applied to files:

  • packages/jumpstarter-driver-ridesx/pyproject.toml
📚 Learning: 2025-11-27T09:58:55.336Z
Learnt from: CR
Repo: jumpstarter-dev/jumpstarter PR: 0
File: .cursor/rules/project-structure.mdc:0-0
Timestamp: 2025-11-27T09:58:55.336Z
Learning: Applies to packages/jumpstarter-driver-*/jumpstarter_driver_*/ : Driver packages must implement a `client.py` file containing the client implementation

Applied to files:

  • packages/jumpstarter-driver-ridesx/pyproject.toml
  • packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/driver_test.py
📚 Learning: 2025-11-27T09:58:41.865Z
Learnt from: CR
Repo: jumpstarter-dev/jumpstarter PR: 0
File: .cursor/rules/creating-new-drivers.mdc:0-0
Timestamp: 2025-11-27T09:58:41.865Z
Learning: After driver creation, implement driver logic in `driver.py`, add tests in `driver_test.py`, update README.md with specific documentation, and test the driver

Applied to files:

  • packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/driver_test.py
📚 Learning: 2025-11-27T09:58:41.865Z
Learnt from: CR
Repo: jumpstarter-dev/jumpstarter PR: 0
File: .cursor/rules/creating-new-drivers.mdc:0-0
Timestamp: 2025-11-27T09:58:41.865Z
Learning: Applies to packages/jumpstarter-driver-*/jumpstarter_driver_*/driver.py : Driver class names should be in CamelCase and be descriptive with appropriate suffixes based on functionality: Power drivers should end with `*Power`, Network drivers with `*Network`, Flasher drivers with `*Flasher`, Console drivers with `*Console`, Server drivers with `*Server`

Applied to files:

  • packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/driver_test.py
📚 Learning: 2025-01-29T11:52:43.554Z
Learnt from: bennyz
Repo: jumpstarter-dev/jumpstarter PR: 241
File: packages/jumpstarter-driver-tftp/jumpstarter_driver_tftp/client.py:52-60
Timestamp: 2025-01-29T11:52:43.554Z
Learning: The TFTP driver (packages/jumpstarter-driver-tftp/jumpstarter_driver_tftp/driver.py) handles all low-level concerns like path validation, error handling, and checksum computation. The client (packages/jumpstarter-driver-tftp/jumpstarter_driver_tftp/client.py) should remain simple as it delegates these responsibilities to the driver.

Applied to files:

  • packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/driver_test.py
📚 Learning: 2025-09-15T08:18:48.571Z
Learnt from: mangelajo
Repo: jumpstarter-dev/jumpstarter PR: 610
File: packages/jumpstarter-driver-flashers/jumpstarter_driver_flashers/client.py:488-491
Timestamp: 2025-09-15T08:18:48.571Z
Learning: In the jumpstarter project, code review suggestions should stay focused on the specific scope of the PR. Suggestions about general improvements like timeout handling or error handling that are unrelated to the core changes being made should be avoided, even if they apply to modified code lines.

Applied to files:

  • packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/driver_test.py
🧬 Code graph analysis (1)
packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/driver_test.py (1)
packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/driver.py (6)
  • _needs_decompression (48-49)
  • _get_decompression_command (40-46)
  • _decompress_file (51-98)
  • on (256-264)
  • off (267-275)
  • cycle (278-283)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: pytest-matrix (ubuntu-24.04, 3.12)
  • GitHub Check: pytest-matrix (macos-15, 3.13)
  • GitHub Check: pytest-matrix (ubuntu-24.04, 3.13)
  • GitHub Check: pytest-matrix (macos-15, 3.12)
  • GitHub Check: e2e
🔇 Additional comments (13)
packages/jumpstarter-driver-ridesx/pyproject.toml (2)

9-15: Dependencies align with driver package requirements.

The added jumpstarter-driver-composite and jumpstarter-driver-power dependencies support the composite and power driver functionality introduced in this PR. As per coding guidelines, driver packages must depend on jumpstarter and specific hardware libraries.


25-30: Pytest asyncio configuration looks good.

The asyncio_mode = "auto" setting combined with pytest-asyncio in dev dependencies enables proper async test execution for the new driver tests.

Also applies to: 40-44

packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/driver_test.py (11)

14-37: Fixtures are well-structured for driver testing.

Session-scoped fixtures with loop:// serial URL appropriately enable testing without real hardware. The temporary directory context manager correctly maintains the directory for the session duration.


39-45: Configuration validation test is appropriate.

Tests the expected ConfigurationError when required serial child is missing.


50-118: Fastboot detection tests provide good coverage.

Tests cover success, not-found, timeout, file-not-found, and retry logic scenarios. The mocking approach correctly simulates subprocess behavior.


123-148: Decompression helper tests are thorough.

Good coverage of _needs_decompression and _get_decompression_command for various file extensions.


198-218: Decompression failure and timeout tests are correct.

Properly tests RuntimeError raised on CalledProcessError and TimeoutExpired.


388-410: Continue failure test correctly implemented.

The fix from the past review is properly applied - subprocess.CalledProcessError is now directly in the side_effect list, ensuring the exception is raised on the continue step.


223-283: Flash tests cover single and multiple partition scenarios well.

Tests verify correct fastboot command construction and execution order.


285-316: Compressed file flash test correctly verifies decompression integration.

Mocking _decompress_file and verifying it's called with the compressed file path is a good approach.


412-456: Power driver tests are well-structured.

Tests cover configuration validation, method exports, async cycle behavior with AsyncMock, and the NotImplementedError for rescue mode. The AsyncMock usage for off, on, and asyncio.sleep is correct.


1-11: Imports are appropriate for the test module.

All necessary modules for mocking, subprocess simulation, and driver testing are imported.


327-331: The review comment is incorrect. The test is properly designed and will work as intended.

The concern about ValueError becoming DriverError misunderstands the exception handling flow:

  1. Driver side (packages/jumpstarter/jumpstarter/driver/base.py, line 129-130): ValueError is caught and mapped to StatusCode.INVALID_ARGUMENT via context.abort()
  2. Client side (packages/jumpstarter/jumpstarter/client/core.py, line 96-97): INVALID_ARGUMENT status code is specifically mapped to DriverInvalidArgument, not DriverError
  3. Class definition (packages/jumpstarter/jumpstarter/client/core.py, line 45): DriverInvalidArgument(DriverError, ValueError) uses multiple inheritance, making it a ValueError subclass
  4. Test assertion (line 329-330): pytest.raises(ValueError, ...) will successfully catch DriverInvalidArgument because it IS a ValueError

The error message "At least one partition must be provided" is preserved through the gRPC layer via the str(e) parameter in context.abort().

The test is correct and requires no changes.

@mangelajo mangelajo enabled auto-merge November 27, 2025 14:31
@mangelajo mangelajo merged commit bf8aa0d into main Nov 27, 2025
19 checks passed
@mangelajo mangelajo deleted the ridesx-timeouts branch November 27, 2025 14:38
@jumpstarter-backport-bot
Copy link
Copy Markdown

Successfully created backport PR for release-0.7:

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants