Conversation
✅ Deploy Preview for jumpstarter-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
WalkthroughAdds throttled, non-spinner logging to LeaseAcquisitionSpinner so status messages are logged at most every 5 minutes when no spinner is present; adds a force flag to Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/jumpstarter/jumpstarter/client/lease.py (1)
364-389: Throttling logic is correct and well-implemented.The throttling implementation properly handles all scenarios:
- Forces logs when
force=True(e.g., success messages)- Always logs the first update (
_last_log_time is None)- Throttles subsequent updates to once per 5-minute interval
- Only applies throttling when no spinner is available
The logic is sound and achieves the PR objective of preventing excessively long logs during lease acquisition.
Optional: Extract elapsed time calculation to reduce duplication.
The elapsed time calculation appears twice (lines 372-373 and 386-387). Consider extracting to a helper method:
def _get_elapsed_str(self) -> str: """Get formatted elapsed time string without microseconds.""" elapsed = datetime.now() - self.start_time return str(elapsed).split(".")[0]Then use it in both paths:
if self.spinner and self._should_show_spinner: self._current_message = f"[blue]{message}[/blue]" - elapsed = datetime.now() - self.start_time - elapsed_str = str(elapsed).split(".")[0] + elapsed_str = self._get_elapsed_str() self.spinner.update(f"{self._current_message} [dim]({elapsed_str})[/dim]") else: # ... if should_log: - elapsed = now - self.start_time - elapsed_str = str(elapsed).split(".")[0] + elapsed_str = self._get_elapsed_str() logger.info(f"{message} ({elapsed_str})")
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/jumpstarter/jumpstarter/client/lease.py(3 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-protocolpackage
Files:
packages/jumpstarter/jumpstarter/client/lease.py
⏰ 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). (10)
- GitHub Check: Redirect rules - jumpstarter-docs
- GitHub Check: Header rules - jumpstarter-docs
- GitHub Check: Pages changed - jumpstarter-docs
- GitHub Check: build
- GitHub Check: pytest-matrix (ubuntu-24.04, 3.11)
- GitHub Check: pytest-matrix (ubuntu-24.04, 3.12)
- GitHub Check: pytest-matrix (ubuntu-24.04, 3.13)
- GitHub Check: pytest-matrix (macos-15, 3.12)
- GitHub Check: pytest-matrix (macos-15, 3.13)
- GitHub Check: e2e
🔇 Additional comments (2)
packages/jumpstarter/jumpstarter/client/lease.py (2)
162-162: LGTM! Success message correctly bypasses throttling.Forcing the success message ensures users always see when lease acquisition completes, which is good UX for an important state transition.
335-336: LGTM! Throttle state properly initialized.The throttle tracking fields are correctly initialized with
Nonefor the first log to pass through and a reasonable 5-minute interval for long-running acquisitions.
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin release-0.7
git worktree add -d .worktree/backport-760-to-release-0.7 origin/release-0.7
cd .worktree/backport-760-to-release-0.7
git switch --create backport-760-to-release-0.7
git cherry-pick -x e4127cbb850287bcc61e4b3bb99bfbab54c95a50 |
Without this throttling waiting logs can get way too long.
Summary by CodeRabbit
Bug Fixes
Tests
✏️ Tip: You can customize this high-level summary in your review settings.