Skip to content

test pr#165

Closed
bennyz wants to merge 1 commit into
jumpstarter-dev:mainfrom
bennyz:test-pr
Closed

test pr#165
bennyz wants to merge 1 commit into
jumpstarter-dev:mainfrom
bennyz:test-pr

Conversation

@bennyz

@bennyz bennyz commented Jan 27, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • New Features

    • Adds background token expiry monitoring during interactive shell sessions — warns before expiry and cancels sessions when tokens expire.
  • Chores

    • CI download step now runs verbosely and logs post-download diagnostics for Fedora Cloud images (directory listing and file contents).

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

@coderabbitai

coderabbitai Bot commented Jan 27, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Adds an async background task _monitor_token_expiry(config, cancel_scope) to periodically check token lifetime, emit a one-time warning when nearing expiry, cancel the shell on expiry, and a CI change to make curl verbose and add post-download QCOW2 diagnostics.

Changes

Cohort / File(s) Summary
Token expiry monitor
python/packages/jumpstarter-cli/jumpstarter_cli/shell.py
Adds async def _monitor_token_expiry(config, cancel_scope) -> None that reads token from config, polls remaining lifetime every 30s, emits a one-time warning when <= TOKEN_EXPIRY_WARNING_SECONDS, logs expiry in red and cancels the shell when remaining <= 0. Contains a stray comment line # test.
CI download diagnostics
.github/workflows/python-tests.yaml
Switches Fedora Cloud image curl to verbose (-vvv), changes download host URL, and adds post-download diagnostics: lists images directory and prints each downloaded *.qcow2 file when cache-miss path runs.

Sequence Diagram(s)

(Skipped — changes are self-contained and do not introduce multi-component control flow worthy of a sequence diagram.)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • mangelajo

Poem

🐰 The token ticks, I softly stare,
A yellow whisper on the air.
If crimson falls and time is done,
I close the path, the race is run.
🥕 Hop on—watch the seconds run.

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'test pr' is vague and generic, using non-descriptive terms that don't convey meaningful information about the actual changes made to the codebase. Replace with a descriptive title that summarizes the main change, such as 'Add token expiry monitoring to shell' or 'Update Fedora download workflow and add monitoring'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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.

@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

🤖 Fix all issues with AI agents
In `@python/packages/jumpstarter-cli/jumpstarter_cli/shell.py`:
- Line 30: Remove the stray debug comment "# test" from
jumpstarter_cli/shell.py; locate the module-level or nearby inline comment in
the shell.py file (no functional symbols affected) and delete that line so no
leftover test/debug marker remains in the production code.

click.echo(click.style(f"To reconnect: JMP_LEASE={lease_name} jmp shell", fg="cyan"))


# test

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.

⚠️ Potential issue | 🟡 Minor

Remove leftover test comment.

This # test comment appears to be a debug marker that should be removed before merging.

Proposed fix
-# test
 async def _monitor_token_expiry(config, cancel_scope) -> None:
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# test
async def _monitor_token_expiry(config, cancel_scope) -> None:
🤖 Prompt for AI Agents
In `@python/packages/jumpstarter-cli/jumpstarter_cli/shell.py` at line 30, Remove
the stray debug comment "# test" from jumpstarter_cli/shell.py; locate the
module-level or nearby inline comment in the shell.py file (no functional
symbols affected) and delete that line so no leftover test/debug marker remains
in the production code.

@bennyz bennyz force-pushed the test-pr branch 2 times, most recently from 1aedbbe to f4b6915 Compare January 27, 2026 14:39
Signed-off-by: Benny Zlotnik <bzlotnik@redhat.com>

@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

🤖 Fix all issues with AI agents
In @.github/workflows/python-tests.yaml:
- Around line 81-84: The CI currently runs a for-loop that cats each QCOW2 in
python/packages/jumpstarter-driver-qemu/images which will dump binary data into
logs; change the loop to run a safe inspection command such as qemu-img info
"$file" or file "$file" (inside the same for ...; do ...; done block) to print
human-readable metadata instead of raw binary, ensuring the command references
the existing loop variable `file` used in that for-loop.

Comment on lines +81 to 84
ls -lsh python/packages/jumpstarter-driver-qemu/images
for file in python/packages/jumpstarter-driver-qemu/images/*.qcow2; do
cat $file
done

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.

⚠️ Potential issue | 🟠 Major

Using cat on binary QCOW2 files will flood CI logs with binary data.

QCOW2 files are binary disk images (hundreds of MBs). Running cat on them outputs raw binary to the CI logs, providing no useful diagnostic information and potentially causing log storage/display issues.

If the intent is to verify the downloaded files, use qemu-img info or file instead.

🔧 Suggested fix using qemu-img info
          done
          ls -lsh python/packages/jumpstarter-driver-qemu/images
          for file in python/packages/jumpstarter-driver-qemu/images/*.qcow2; do
-           cat $file
+           qemu-img info "$file"
          done
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
ls -lsh python/packages/jumpstarter-driver-qemu/images
for file in python/packages/jumpstarter-driver-qemu/images/*.qcow2; do
cat $file
done
ls -lsh python/packages/jumpstarter-driver-qemu/images
for file in python/packages/jumpstarter-driver-qemu/images/*.qcow2; do
qemu-img info "$file"
done
🤖 Prompt for AI Agents
In @.github/workflows/python-tests.yaml around lines 81 - 84, The CI currently
runs a for-loop that cats each QCOW2 in
python/packages/jumpstarter-driver-qemu/images which will dump binary data into
logs; change the loop to run a safe inspection command such as qemu-img info
"$file" or file "$file" (inside the same for ...; do ...; done block) to print
human-readable metadata instead of raw binary, ensuring the command references
the existing loop variable `file` used in that for-loop.

@bennyz bennyz closed this Jan 27, 2026
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