Skip to content

fix: catch Exception in _flush_lines - #979

Open
bennyz wants to merge 1 commit into
jumpstarter-dev:mainfrom
bennyz:fix-hooks-flake
Open

fix: catch Exception in _flush_lines#979
bennyz wants to merge 1 commit into
jumpstarter-dev:mainfrom
bennyz:fix-hooks-flake

Conversation

@bennyz

@bennyz bennyz commented Aug 7, 2026

Copy link
Copy Markdown
Member

In case there are unexepected exceptions, to avoid hitting flakes https://github.com/jumpstarter-dev/jumpstarter/actions/runs/31179469197/attempts/1

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@bennyz, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 14 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ba5536d2-66fb-42cf-af83-af9a44bb72d5

📥 Commits

Reviewing files that changed from the base of the PR and between d8c6661 and 09f5e3c.

📒 Files selected for processing (1)
  • python/packages/jumpstarter/jumpstarter/exporter/hooks_test.py
📝 Walkthrough

Walkthrough

read_pty_output now catches unexpected exceptions during PTY polling, logs them at debug level, and stops output reading. A macOS regression test verifies that hook execution still succeeds.

Changes

PTY output handling

Layer / File(s) Summary
Reader exception handling
python/packages/jumpstarter/jumpstarter/exporter/hooks.py, python/packages/jumpstarter/jumpstarter/exporter/hooks_test.py
The PTY reader logs unexpected exceptions and exits the loop. A macOS-targeted test verifies that a ValueError does not fail hook execution.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

Suggested reviewers: kirkbrauer, raballew

Poem

A rabbit reads the PTY stream,
A sudden error breaks the beam.
The error is logged,
The loop is unclogged,
And hooks complete as planned.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: catching unexpected exceptions in _flush_lines to prevent flaky failures.
Description check ✅ Passed The description explains that unexpected exceptions are handled to prevent flaky CI hook failures.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@python/packages/jumpstarter/jumpstarter/exporter/hooks_test.py`:
- Around line 1058-1066: Update the test around execute_before_lease_hook to
capture the mocked hooks.logger and assert the expected main-loop debug message
from the ValueError before asserting result is None. Ensure the assertion
distinguishes the main-loop handling from the finally drain, preserving coverage
of the main-loop exception path.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ec1ca0b8-fa0a-4a55-991a-2d269861495c

📥 Commits

Reviewing files that changed from the base of the PR and between d17426e and d8c6661.

📒 Files selected for processing (1)
  • python/packages/jumpstarter/jumpstarter/exporter/hooks_test.py

Comment thread python/packages/jumpstarter/jumpstarter/exporter/hooks_test.py Outdated
In case there are unexepected exceptions, to avoid hitting flakes
https://github.com/jumpstarter-dev/jumpstarter/actions/runs/31179469197/attempts/1

Signed-off-by: Benny Zlotnik <bzlotnik@redhat.com>
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.

1 participant