Skip to content

Add explicit expiration time to iso download tool#28

Merged
carbonin merged 1 commit intoopenshift-assisted:masterfrom
carbonin:add-exp-to-iso-tool
Jul 14, 2025
Merged

Add explicit expiration time to iso download tool#28
carbonin merged 1 commit intoopenshift-assisted:masterfrom
carbonin:add-exp-to-iso-tool

Conversation

@carbonin
Copy link
Copy Markdown
Collaborator

@carbonin carbonin commented Jul 14, 2025

Previously the model was showing inconsistent behavior regarding the expiration time. Sometimes it would extract it from the claims in the url, sometimes it would print it in a readable format, and sometimes it wouldn't print anything at all. This should make it more consistent.

Summary by CodeRabbit

  • Documentation
    • Updated documentation to clarify the format of ISO download URLs, including structured details and optional expiration timestamps.
  • Bug Fixes
    • Improved the formatting of ISO download URL outputs to include expiration information when available, with clearer separation between entries.
  • Tests
    • Enhanced tests to verify correct formatting of ISO download URLs, including cases with and without expiration timestamps.

Previously the model was showing inconsistent behavior regarding the
expiration time. Sometimes it would extract it from the claims in the
url, sometimes it would print it in a readable format, and sometimes it
wouldn't print anything at all. This should make it more consistent.
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Jul 14, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: carbonin

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jul 14, 2025

Walkthrough

The changes update the cluster_iso_download_url tool to return a more structured, formatted string that includes both ISO download URLs and optional expiration timestamps. The documentation and tests are updated to reflect this new output format, and new test cases ensure correct handling of missing or default expiration values.

Changes

File(s) Change Summary
README.md Updated documentation to clarify the new, structured output format of cluster_iso_download_url.
server.py Enhanced cluster_iso_download_url to return formatted strings with URLs and optional expiration timestamps.
tests/test_server.py Updated and expanded tests to validate new output format and edge cases for expiration timestamps.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant Server
    participant InfraEnvDB

    Client->>Server: Request ISO download URLs for cluster_id
    Server->>InfraEnvDB: Query infraenvs for cluster_id
    InfraEnvDB-->>Server: Return infraenv data (URLs, expires_at)
    Server->>Server: Format output string (URL, optional Expires at)
    Server-->>Client: Return formatted ISO URLs with expiration info
Loading

Possibly related PRs

Suggested labels

size/L, lgtm

Suggested reviewers

  • eranco74

Poem

A cluster’s ISO, once hidden, now clear,
With URLs and timestamps, the format’s sincere.
If expiration’s missing, no need for alarm,
The output adapts, with structure and charm.
Tests hop along, ensuring it’s right—
Another bright patch in the dev bunny’s night! 🐇✨

✨ 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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@openshift-ci openshift-ci Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jul 14, 2025
Copy link
Copy Markdown

@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)
README.md (1)

112-113: Minor: Consider consistent markdown list style.

The static analysis tool suggests using asterisks instead of dashes for consistency with the rest of the documentation.

-  - URL: <download-url>
-  - Expires at: <expiration-timestamp> (if available)
+  * URL: <download-url>
+  * Expires at: <expiration-timestamp> (if available)
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 24a0b19 and eeaec1f.

📒 Files selected for processing (3)
  • README.md (1 hunks)
  • server.py (2 hunks)
  • tests/test_server.py (6 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
tests/test_server.py (2)
service_client/assisted_service_api.py (1)
  • list_infra_envs (256-291)
server.py (1)
  • cluster_iso_download_url (203-260)
🪛 markdownlint-cli2 (0.17.2)
README.md

112-112: Unordered list style
Expected: asterisk; Actual: dash

(MD004, ul-style)


113-113: Unordered list style
Expected: asterisk; Actual: dash

(MD004, ul-style)

⏰ 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). (1)
  • GitHub Check: Red Hat Konflux / assisted-service-mcp-saas-main-on-pull-request
🔇 Additional comments (6)
server.py (2)

211-215: LGTM: Documentation accurately reflects the new structured format.

The updated docstring clearly describes the new output format with explicit URL and expiration information.


231-260: LGTM: Well-implemented structured output with proper expiration handling.

The implementation correctly:

  • Extracts both URL and expiration data from infra environments
  • Formats the response with clear prefixes
  • Filters out zero/default expiration dates consistently with cluster_credentials_download_url
  • Separates multiple ISOs with blank lines for readability

The logic handles edge cases appropriately and maintains consistency with the existing codebase.

README.md (1)

111-114: LGTM: Documentation accurately reflects the new implementation.

The updated documentation clearly describes the structured output format with URL and optional expiration information, matching the implementation in server.py.

tests/test_server.py (3)

237-237: LGTM: Appropriate pylint disable for test class.

The disable comment is correctly placed for the test class which naturally has many public test methods.


361-361: LGTM: Tests properly updated to match new structured format.

The test expectations correctly reflect the new output format with "URL:" and "Expires at:" prefixes, and proper separation of multiple ISOs with blank lines.

Also applies to: 370-370, 390-390, 400-400, 414-417


422-475: LGTM: Comprehensive edge case testing.

The new test cases properly cover important edge cases:

  • test_cluster_iso_download_url_no_expiration: Validates behavior when expires_at is missing
  • test_cluster_iso_download_url_zero_expiration: Validates behavior when expires_at is a zero/default date

Both tests correctly expect only the URL line without expiration information, matching the implementation logic.

@oourfali
Copy link
Copy Markdown

/lgtm

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Jul 14, 2025

@oourfali: changing LGTM is restricted to collaborators

Details

In response to this:

/lgtm

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@carbonin carbonin merged commit 58d84de into openshift-assisted:master Jul 14, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants