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

cli: add support for requesting custom lease name#763

Merged
bennyz merged 2 commits intojumpstarter-dev:mainfrom
bennyz:custom-lease-name
Dec 15, 2025
Merged

cli: add support for requesting custom lease name#763
bennyz merged 2 commits intojumpstarter-dev:mainfrom
bennyz:custom-lease-name

Conversation

@bennyz
Copy link
Copy Markdown
Member

@bennyz bennyz commented Dec 2, 2025

Summary by CodeRabbit

  • New Features

    • Added a --lease-id option to the lease creation command so users can supply a custom lease ID when creating leases.
  • Documentation

    • Command help text and usage examples updated to show the new --lease-id option.

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

@bennyz bennyz requested a review from mangelajo December 2, 2025 11:29
@netlify
Copy link
Copy Markdown

netlify Bot commented Dec 2, 2025

Deploy Preview for jumpstarter-docs ready!

Name Link
🔨 Latest commit 3b97a14
🔍 Latest deploy log https://app.netlify.com/projects/jumpstarter-docs/deploys/693ff5d7221e150008829052
😎 Deploy Preview https://deploy-preview-763--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 Dec 2, 2025

Walkthrough

Adds an optional lease_id parameter to lease creation and threads it from the CLI through the config layer into the gRPC CreateLease request and lease creation code; also includes minor code formatting and test adjustments.

Changes

Cohort / File(s) Change Summary
CLI & User API
packages/jumpstarter-cli/jumpstarter_cli/create.py
Adds --lease-id CLI option, updates create_lease signature to accept lease_id, forwards it to config layer, and updates help/example text.
Config → Service Call
packages/jumpstarter/jumpstarter/config/client.py
Adds `lease_id: str
gRPC Client Surface
packages/jumpstarter/jumpstarter/client/grpc.py
Extends ClientService.CreateLease signature to accept `lease_id: str
Lease Creation Logic
packages/jumpstarter/jumpstarter/client/lease.py
Passes lease_id=self.name into CreateLease during lease creation; minor consolidation of logging throttle expression.
Formatting / Style
packages/jumpstarter/jumpstarter/client/client.py, packages/jumpstarter/jumpstarter/client/decorators.py
Standardizes string quoting (single → double) and minor whitespace/one-line refactors; no behavior changes.
Tests
packages/jumpstarter/jumpstarter/client/grpc_test.py, packages/jumpstarter/jumpstarter/client/lease_test.py
Reformat Exporter constructions to single-line, add effective_end_time to test lease helpers, and standardize quoting/context-manager formatting; assertions/logic unchanged.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant CLI as CLI (create.py)
  participant Config as ClientConfigV1Alpha1
  participant Client as ClientService (grpc.py)
  participant Server as Backend Service
  Note over CLI,Server: Lease creation with optional lease_id
  CLI->>Config: create_lease(selector, duration, begin_time, lease_id)
  Config->>Client: CreateLease(selector, duration, begin_time, lease_id)
  Client->>Server: CreateLeaseRequest { selector, duration, begin_time, lease_id }
  Server-->>Client: CreateLeaseResponse (lease metadata)
  Client-->>Config: response
  Config-->>CLI: created lease info
  Note right of CLI: CLI prints/returns lease info
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Review focus areas:
    • Ensure lease_id defaults/None-handling and serialization (empty string vs omitted) are consistent across gRPC and server expectations.
    • Verify CLI help examples and argument parsing correctly map to None when not provided.
    • Confirm tests that construct leases account for the new effective_end_time and any lease_id-related behavior.

Possibly related PRs

Suggested reviewers

  • mangelajo
  • kirkbrauer

Poem

🐰
I hopped a flag down the pipeline lane,
A name for a lease, I softly gave—no strain.
From keys to grpc, it hopped and then sat,
A tiny ID, tidy and sprat 🥕
Cheers — a small hop, a tidy patch.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 65.91% 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 PR title 'cli: add support for requesting custom lease name' accurately describes the main change: adding CLI support for custom lease IDs through a new --lease-id option.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

@bennyz
Copy link
Copy Markdown
Member Author

bennyz commented Dec 2, 2025

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Dec 2, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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/jumpstarter/client/grpc_test.py (1)

63-126: Test helpers now cover broader lease shapes

create_test_exporter and create_test_lease provide clearer, keyword-based setup for exporter/lease mocks, including effective_begin_time, effective_duration, begin_time, duration, and effective_end_time. This makes the later tests easier to understand and keeps them aligned with the Lease model fields.

If you want closer realism with production semantics, consider defaulting effective_duration to a partial elapsed time when effective_begin_time is set, mirroring how it behaves in Lease.monitor_async. Based on learnings, effective_duration is “elapsed so far”, not total.

packages/jumpstarter/jumpstarter/client/lease.py (1)

65-75: Passing lease_id=self.name cleanly supports custom lease IDs

In _create, forwarding lease_id=self.name to CreateLease allows a pre-set name (from env flag or CLI-supplied ID) to drive the requested lease ID, while the existing “no name” path still results in lease_id="" and server-generated IDs. Combined with the fallback that resets self.name = None when selector mismatches, this looks correct and backward compatible.

You might consider logging the requested lease_id when it’s non-empty to aid debugging around custom lease-name collisions.

packages/jumpstarter-cli/jumpstarter_cli/create.py (1)

25-35: CLI wiring for --lease-id looks correct and backwards compatible

The new @click.option("--lease-id", ...) plus the updated create_lease signature order (config, selector, duration, begin_time, lease_id, output) match the decorator ordering and correctly forward lease_id into config.create_lease. When --lease-id is omitted, None propagates and the backend will generate an ID as before.

Consider adding a short CLI test that invokes jmp create lease ... --lease-id foo and asserts that the resulting lease name/id contains or equals foo, to lock in this new behavior.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 312a389 and e9a02db.

📒 Files selected for processing (8)
  • packages/jumpstarter-cli/jumpstarter_cli/create.py (2 hunks)
  • packages/jumpstarter/jumpstarter/client/client.py (1 hunks)
  • packages/jumpstarter/jumpstarter/client/decorators.py (3 hunks)
  • packages/jumpstarter/jumpstarter/client/grpc.py (4 hunks)
  • packages/jumpstarter/jumpstarter/client/grpc_test.py (12 hunks)
  • packages/jumpstarter/jumpstarter/client/lease.py (2 hunks)
  • packages/jumpstarter/jumpstarter/client/lease_test.py (15 hunks)
  • packages/jumpstarter/jumpstarter/config/client.py (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.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/jumpstarter/client/client.py
  • packages/jumpstarter/jumpstarter/client/decorators.py
  • packages/jumpstarter/jumpstarter/client/lease.py
  • packages/jumpstarter/jumpstarter/client/grpc.py
  • packages/jumpstarter-cli/jumpstarter_cli/create.py
  • packages/jumpstarter/jumpstarter/client/grpc_test.py
  • packages/jumpstarter/jumpstarter/client/lease_test.py
  • packages/jumpstarter/jumpstarter/config/client.py
🧠 Learnings (3)
📚 Learning: 2025-11-27T09:58:55.346Z
Learnt from: CR
Repo: jumpstarter-dev/jumpstarter PR: 0
File: .cursor/rules/project-structure.mdc:0-0
Timestamp: 2025-11-27T09:58:55.346Z
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/jumpstarter/client/client.py
📚 Learning: 2025-10-14T17:43:07.788Z
Learnt from: michalskrivanek
Repo: jumpstarter-dev/jumpstarter PR: 704
File: packages/jumpstarter/jumpstarter/client/grpc.py:100-107
Timestamp: 2025-10-14T17:43:07.788Z
Learning: In the Jumpstarter client lease model (packages/jumpstarter/jumpstarter/client/grpc.py), `effective_duration` represents the elapsed time for an active lease so far, not the total duration. To calculate expected release time, use `effective_begin_time + duration` (where `duration` is the configured/requested duration), not `effective_begin_time + effective_duration`.

Applied to files:

  • packages/jumpstarter/jumpstarter/client/lease.py
  • packages/jumpstarter/jumpstarter/client/grpc.py
  • packages/jumpstarter/jumpstarter/client/grpc_test.py
  • packages/jumpstarter/jumpstarter/config/client.py
📚 Learning: 2025-11-27T09:58:41.875Z
Learnt from: CR
Repo: jumpstarter-dev/jumpstarter PR: 0
File: .cursor/rules/creating-new-drivers.mdc:0-0
Timestamp: 2025-11-27T09:58:41.875Z
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/jumpstarter/client/lease_test.py
🧬 Code graph analysis (6)
packages/jumpstarter/jumpstarter/client/client.py (2)
packages/jumpstarter-driver-composite/jumpstarter_driver_composite/driver.py (1)
  • report (42-45)
packages/jumpstarter/jumpstarter/driver/base.py (1)
  • report (198-213)
packages/jumpstarter/jumpstarter/client/lease.py (1)
packages/jumpstarter/jumpstarter/common/metadata.py (1)
  • name (13-14)
packages/jumpstarter-cli/jumpstarter_cli/create.py (2)
packages/jumpstarter/jumpstarter/config/client.py (2)
  • create_lease (199-212)
  • lease (135-143)
packages/jumpstarter-cli/jumpstarter_cli/config.py (1)
  • config (8-12)
packages/jumpstarter/jumpstarter/client/grpc_test.py (5)
packages/jumpstarter/jumpstarter/client/grpc.py (1)
  • Exporter (79-118)
packages/jumpstarter/jumpstarter/common/metadata.py (1)
  • name (13-14)
packages/jumpstarter-cli/jumpstarter_cli/get_test.py (1)
  • create_test_lease (248-263)
packages/jumpstarter/jumpstarter/exporter/exporter.py (1)
  • status (167-186)
packages/jumpstarter/jumpstarter/config/client.py (1)
  • lease (135-143)
packages/jumpstarter/jumpstarter/client/lease_test.py (1)
packages/jumpstarter/jumpstarter/client/lease.py (2)
  • LeaseAcquisitionSpinner (326-396)
  • _is_terminal_available (343-350)
packages/jumpstarter/jumpstarter/config/client.py (1)
packages/jumpstarter/jumpstarter/client/grpc.py (1)
  • CreateLease (380-409)
⏰ 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: pytest-matrix (macos-15, 3.12)
  • GitHub Check: pytest-matrix (macos-15, 3.13)
  • GitHub Check: pytest-matrix (macos-15, 3.11)
  • GitHub Check: pytest-matrix (ubuntu-24.04, 3.13)
  • GitHub Check: pytest-matrix (ubuntu-24.04, 3.11)
  • GitHub Check: pytest-matrix (ubuntu-24.04, 3.12)
  • GitHub Check: e2e
🔇 Additional comments (17)
packages/jumpstarter/jumpstarter/client/client.py (1)

62-63: Field access remains safe and backward compatible

Using getattr with defaults for description and methods_description keeps the client resilient to older reports that may not define these fields and normalizes empty values to None/{} as before. The change to double-quoted attribute names is style-only and consistent with Ruff/formatter usage.

packages/jumpstarter/jumpstarter/client/decorators.py (3)

38-52: Help text resolution and click param transfer remain correct

Logic for deriving help from kwargs, docstring, and client.description, plus copying __click_params__, is unchanged apart from style; behavior looks correct and backwards compatible.


77-81: Single-command decorator description override is intact

driver_click_command still correctly lets client.description override Click’s default help; style-only change.


91-101: Command name normalization and server help override unchanged

The group command decorator still normalizes names via lower().replace("_", "-") and overrides help from methods_description when present; this remains consistent and safe.

packages/jumpstarter/jumpstarter/client/grpc.py (2)

268-289: ExporterList dump helpers still apply excludes correctly

The comprehension-based construction for "exporters" still honors exclude_fields for lease/online and preserves the JSON and dict shapes; this is a safe readability improvement.


380-407: lease_id propagation into CreateLeaseRequest looks correct

Adding lease_id: str | None = None and forwarding it as lease_id=lease_id or "" ensures the field is always a string and remains optional. This aligns with the config and Lease._create callers, and keeps the API backward compatible when lease_id is omitted. Verify there are no legacy direct stub usages of CreateLease() elsewhere in the codebase.

packages/jumpstarter/jumpstarter/client/grpc_test.py (4)

137-207: Exporter lease table tests remain consistent with display behavior

The refactored Exporter constructions and assertions (with and without lease, and with show_leases=True/False) still validate column counts and basic content, including the “Available” fallback when no lease is attached. These tests continue to exercise the key branches in Exporter.rich_add_rows.


210-283: Online status and combined-feature tests match rich_add_rows output

Tests around online/offline exporters and the “all features” scenario now use concise Exporter(...) calls and verify presence of yes/no, labels, and lease-related fields. This gives good coverage of the show_online and show_leases options together.


285-321: Ended lease info extraction aligns with exporter display logic

test_exporter_lease_info_extraction mirrors the logic in Exporter.rich_add_rows for choosing effective_end_time when present, and checks that the resulting lease_info tuple contains the expected client, status, and "2023-01-01 11:00:00" end time. This correctly exercises the “Ended” path.


323-376: Scheduled and no-lease scenarios correctly exercise expected release computation

The tests for no-lease exporters and scheduled leases validate that “Available” status is used when lease is None, and that scheduled leases display begin_time + duration as the expected release time. This matches the intended semantics of using configured duration rather than effective_duration for future end times (consistent with earlier learnings).

packages/jumpstarter/jumpstarter/client/lease.py (1)

371-388: Spinner log throttling condition remains equivalent and clearer

The consolidated should_log expression preserves the previous behavior: always log when force=True, on the first message, or when the throttle interval has elapsed. Tests in lease_test.py cover first/within/after-interval and forced cases, so this refactor looks safe.

packages/jumpstarter/jumpstarter/client/lease_test.py (4)

33-59: TTY detection tests unchanged apart from formatting

The multi-line with contexts patching sys.stdout.isatty / sys.stderr.isatty are just style changes; the tests still correctly cover all TTY combinations (True/True, False/False, mixed) for _is_terminal_available().


60-88: Context manager tests still validate spinner start/stop behavior

Refactored with patch.object(...) blocks around _is_terminal_available and console.status maintain the same assertions: spinner starts/stops only when a terminal is available, and start_time is set in both console and non-console paths. Behavior is preserved.


90-205: Console vs non-console status and tick behavior remain well covered

All tests that patch _is_terminal_available for update_status, tick, elapsed time formatting, async integration, and message preservation still match the implementation branches (spinner path vs logging path). The expectations around _current_message and spinner.update call counts look consistent with the current LeaseAcquisitionSpinner logic.


238-336: Throttling tests align with new should_log condition

The throttling suite—first update logged, within-interval suppressed, after-interval logged, forced updates, multiple rapid updates, and “no throttling when console is available”—all exercise the new should_log logic in the logging branch. This gives strong regression protection for the refactor in update_status.

packages/jumpstarter-cli/jumpstarter_cli/create.py (1)

59-64: Documentation clearly introduces custom lease ID usage

The added example for --lease-id my-custom-lease-id integrates well into the existing help text and accurately reflects the new option.

packages/jumpstarter/jumpstarter/config/client.py (1)

197-212: Unable to verify create_lease signature extension without repository access

The review approves threading lease_id: str | None = None through to ClientService.CreateLease with proper decorator handling. However, verification of call sites, signature compatibility, and code style adherence could not be completed due to repository access failure. Manual verification is needed to confirm all callers handle the new optional parameter correctly and that the code meets Ruff formatting standards.

Signed-off-by: Benny Zlotnik <bzlotnik@redhat.com>
@bennyz bennyz force-pushed the custom-lease-name branch from e9a02db to 6d6c9fc Compare December 2, 2025 13:24
@bennyz bennyz marked this pull request as ready for review December 15, 2025 11:49
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 (1)
packages/jumpstarter-cli/jumpstarter_cli/create.py (1)

25-35: --lease-id CLI wiring and docs look correct; consider documenting constraints if any

The new --lease-id option, extended create_lease signature, doc snippet, and forwarding lease_id into config.create_lease are all consistent and keep the default behavior (server‑generated IDs) when the flag is omitted. If the server enforces any particular format/length/charset for lease IDs, it might be worth hinting at that in the help= text or docs to avoid users hitting opaque server errors.

Also applies to: 59-64, 67-68

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e9a02db and 3b97a14.

📒 Files selected for processing (8)
  • packages/jumpstarter-cli/jumpstarter_cli/create.py (2 hunks)
  • packages/jumpstarter/jumpstarter/client/client.py (1 hunks)
  • packages/jumpstarter/jumpstarter/client/decorators.py (3 hunks)
  • packages/jumpstarter/jumpstarter/client/grpc.py (4 hunks)
  • packages/jumpstarter/jumpstarter/client/grpc_test.py (12 hunks)
  • packages/jumpstarter/jumpstarter/client/lease.py (2 hunks)
  • packages/jumpstarter/jumpstarter/client/lease_test.py (15 hunks)
  • packages/jumpstarter/jumpstarter/config/client.py (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • packages/jumpstarter/jumpstarter/client/lease_test.py
  • packages/jumpstarter/jumpstarter/client/lease.py
  • packages/jumpstarter/jumpstarter/client/decorators.py
🧰 Additional context used
📓 Path-based instructions (1)
**/*.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/jumpstarter/client/client.py
  • packages/jumpstarter/jumpstarter/config/client.py
  • packages/jumpstarter/jumpstarter/client/grpc.py
  • packages/jumpstarter/jumpstarter/client/grpc_test.py
  • packages/jumpstarter-cli/jumpstarter_cli/create.py
🧠 Learnings (2)
📚 Learning: 2025-11-27T09:58:55.346Z
Learnt from: CR
Repo: jumpstarter-dev/jumpstarter PR: 0
File: .cursor/rules/project-structure.mdc:0-0
Timestamp: 2025-11-27T09:58:55.346Z
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/jumpstarter/client/client.py
📚 Learning: 2025-10-14T17:43:07.788Z
Learnt from: michalskrivanek
Repo: jumpstarter-dev/jumpstarter PR: 704
File: packages/jumpstarter/jumpstarter/client/grpc.py:100-107
Timestamp: 2025-10-14T17:43:07.788Z
Learning: In the Jumpstarter client lease model (packages/jumpstarter/jumpstarter/client/grpc.py), `effective_duration` represents the elapsed time for an active lease so far, not the total duration. To calculate expected release time, use `effective_begin_time + duration` (where `duration` is the configured/requested duration), not `effective_begin_time + effective_duration`.

Applied to files:

  • packages/jumpstarter/jumpstarter/config/client.py
  • packages/jumpstarter/jumpstarter/client/grpc.py
  • packages/jumpstarter/jumpstarter/client/grpc_test.py
🧬 Code graph analysis (4)
packages/jumpstarter/jumpstarter/client/client.py (2)
packages/jumpstarter/jumpstarter/driver/base.py (1)
  • report (199-214)
packages/jumpstarter-driver-composite/jumpstarter_driver_composite/driver.py (1)
  • report (42-45)
packages/jumpstarter/jumpstarter/config/client.py (1)
packages/jumpstarter/jumpstarter/client/grpc.py (2)
  • ClientService (316-457)
  • CreateLease (380-409)
packages/jumpstarter/jumpstarter/client/grpc_test.py (1)
packages/jumpstarter/jumpstarter/client/grpc.py (1)
  • Exporter (79-118)
packages/jumpstarter-cli/jumpstarter_cli/create.py (3)
packages/jumpstarter-cli-common/jumpstarter_cli_common/exceptions.py (1)
  • handle_exceptions_with_reauthentication (89-106)
packages/jumpstarter-cli/jumpstarter_cli/login.py (1)
  • relogin_client (141-155)
packages/jumpstarter/jumpstarter/config/client.py (2)
  • create_lease (199-212)
  • lease (135-143)
⏰ 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: pytest-matrix (macos-15, 3.11)
  • GitHub Check: pytest-matrix (ubuntu-24.04, 3.12)
  • GitHub Check: pytest-matrix (macos-15, 3.12)
  • GitHub Check: pytest-matrix (ubuntu-24.04, 3.13)
  • GitHub Check: pytest-matrix (macos-15, 3.13)
  • GitHub Check: pytest-matrix (ubuntu-24.04, 3.11)
  • GitHub Check: e2e
🔇 Additional comments (7)
packages/jumpstarter/jumpstarter/client/client.py (1)

55-64: Backwards-compatible handling of description and methods_description looks good

Using getattr(report, "description", None) or None / getattr(report, "methods_description", {}) or {} safely copes with older reports missing these fields while normalizing empty values. This keeps client initialization robust without changing semantics.

Based on relevant code snippets.

packages/jumpstarter/jumpstarter/client/grpc.py (2)

268-289: ExporterList model_dump_json / model_dump remain consistent while simplifying structure

The new single-expression construction of {"exporters": [...]} keeps the previous behavior (respecting include_leases / include_online via exclude_fields) and still uses mode="json" for exporter dumps, which matches existing YAML/JSON usage patterns. No issues from a correctness or API-shape standpoint.


380-407: lease_id propagation in ClientService.CreateLease is well-shaped; all call sites verified

Adding lease_id: str | None = None as a kw-only, last parameter and sending lease_id=lease_id or "" in CreateLeaseRequest cleanly supports optional custom IDs while preserving backwards compatibility for existing callers and servers that treat empty string as "no requested ID". All in-repo usages rely on keyword arguments:

  • packages/jumpstarter/jumpstarter/config/client.py:207 passes selector=, duration=, begin_time=, lease_id=
  • packages/jumpstarter/jumpstarter/client/lease.py:72 passes selector=, duration=, lease_id=

No positional parameter dependencies detected.

packages/jumpstarter/jumpstarter/client/grpc_test.py (3)

63-67: Test helper create_test_exporter is clear and side‑effect free

Returning an Exporter built with explicit keyword arguments keeps the helper straightforward and makes test fixtures easy to reason about. No change requested.


116-135: Lease test helper and release‑time assertions align with lease semantics

Extending create_test_lease with effective_end_time and wiring it into tests that cover ended, active, and scheduled leases correctly reflects the display logic (prefer effective_end_time, otherwise effective_begin_time + duration or begin_time + duration). The assertions for "2023-01-01 11:00:00" in the various tests match that contract and guard against regressions around effective_duration misuse.

Based on learnings.

Also applies to: 285-376


137-283: Exporter display tests give good coverage of columns, online status, and lease visibility

The updated tests constructing Exporter instances inline, checking column counts, and verifying rendered content ("Available", "yes", "no", lease client/status, etc.) provide solid regression coverage for the Rich table rendering paths with different WithOptions combinations. The new explicit online flags and string checks make the expectations very clear.

packages/jumpstarter/jumpstarter/config/client.py (1)

199-212: Config client create_lease correctly threads lease_id to the service

Adding lease_id: str | None = None as the final parameter and passing it through to svc.CreateLease keeps the config API in sync with the underlying gRPC client while preserving backwards compatibility. The existing call site in the CLI (create.py:67) uses keyword arguments, confirming no positional argument dependencies exist.

@bennyz bennyz merged commit 6e523a3 into jumpstarter-dev:main Dec 15, 2025
18 checks passed
@bennyz bennyz deleted the custom-lease-name branch December 15, 2025 12:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants