Skip to content

Conversation

@mangelajo
Copy link
Member

@mangelajo mangelajo commented Oct 10, 2025

Summary by CodeRabbit

  • New Features
    • Lease responses now include a read-only “time_left” value indicating the remaining duration of a lease. This enables clients to display countdowns, make renewal decisions, and improve UX around lease expiration without additional calculations. The addition is backward-compatible and does not require changes to existing requests.

@coderabbitai
Copy link

coderabbitai bot commented Oct 10, 2025

Walkthrough

Adds an OUTPUT_ONLY optional Duration field time_left (field 12) to the Lease message in proto/jumpstarter/client/v1/client.proto.

Changes

Cohort / File(s) Summary
Proto schema update
proto/jumpstarter/client/v1/client.proto
Added Lease.time_left: optional google.protobuf.Duration (field 12), annotated OUTPUT_ONLY, placed after end_time and before client. No other message or RPC changes noted.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant C as Client
  participant S as Lease Service
  note over S: Server computes remaining lease time

  C->>S: GetLease / WatchLease
  S->>S: Calculate time_left = end_time - now()
  S-->>C: Lease { id, start_time, end_time, time_left (OUTPUT_ONLY) }

  rect rgba(220,240,255,0.5)
    note right of C: time_left is read-only and not set by clients
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

A nibble of time in a proto field,
A tick-tock Duration, precisely revealed.
OUTPUT_ONLY, I won’t overwrite—
Just read the seconds in gentle light.
With ears up high, I stamp and cheer:
“Your lease has time left—clear!” 🐇⏳

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title clearly summarizes the addition of the time_left field to client.proto and accurately reflects the primary change in a concise manner.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch time-left-lease

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4f8035c and 33aef6f.

📒 Files selected for processing (1)
  • proto/jumpstarter/client/v1/client.proto (1 hunks)

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.

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.

2 participants