USHIFT-7189: CI Doctor image health information#199
Conversation
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ggiguash The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughAdds rh-catalog.sh Bash API client for Red Hat Container Catalog queries, filter_images.py Python filter with release-aware tag matching and freshness grade computation from ISO date ranges, extends doctor.sh to orchestrate image metadata collection into cached JSON files, and implements generalized data-table styling in create-report.py with a new interactive Image Health tab showing per-release/per-repo image versions and freshness grades plus latest-only filtering. ChangesContainer Image Health Reporting
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 9 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (9 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
plugins/shared/scripts/create-report.py (1)
724-756: 🧹 Nitpick | 🔵 Trivial | 💤 Low valueUnused
componentparameter in function signature.The
componentparameter is declared but never referenced in the function body. The docstring confirms repos are discovered from filenames rather than a component mapping.🔧 Suggested fix
-def load_images_data(workdir, component, releases): +def load_images_data(workdir, releases):And update the call site at line 1708:
- images_data = load_images_data(workdir, component, releases) + images_data = load_images_data(workdir, releases)🤖 Prompt for 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. In `@plugins/shared/scripts/create-report.py` around lines 724 - 756, The function load_images_data has a component parameter in its signature that is never used within the function body. Remove the component parameter from the load_images_data function signature since the function discovers repositories from filenames rather than a component mapping (as documented in the docstring). Also update the call site at line 1708 to remove the component argument when invoking load_images_data.
🤖 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 `@plugins/shared/scripts/doctor.sh`:
- Around line 27-33: The _component_repos function currently returns
space-delimited strings which rely on unquoted variable splitting for parsing.
Refactor this function to use bash arrays instead, where each repository is a
separate array element. Then update the code that uses the output from
_component_repos (around the area where repos are consumed) to properly handle
and iterate over the array using proper quoting patterns like "${array[@]}" to
avoid word splitting issues and ensure compliance with shell coding guidelines.
In `@plugins/shared/scripts/rh-catalog.sh`:
- Line 1: The shebang at the top of the rh-catalog.sh file currently uses
#!/bin/bash but according to the repository's CONTRIBUTING.md guidelines, it
must use #!/usr/bin/bash instead. Replace the shebang line with the correct path
to the bash interpreter as specified in the coding standards.
- Around line 25-37: The curl command in the fetch_api function lacks a timeout
parameter, allowing it to block indefinitely on stalled connections and
preventing the retry loop from advancing. Add a timeout option to the curl
command (such as --max-time or --connect-timeout) to ensure the request fails
after a reasonable duration if the connection stalls, allowing the loop to
proceed to the next retry attempt.
---
Nitpick comments:
In `@plugins/shared/scripts/create-report.py`:
- Around line 724-756: The function load_images_data has a component parameter
in its signature that is never used within the function body. Remove the
component parameter from the load_images_data function signature since the
function discovers repositories from filenames rather than a component mapping
(as documented in the docstring). Also update the call site at line 1708 to
remove the component argument when invoking load_images_data.
🪄 Autofix (Beta)
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: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: b1282fa0-c094-4050-9dde-9e49b9bbcbe0
📒 Files selected for processing (3)
plugins/shared/scripts/create-report.pyplugins/shared/scripts/doctor.shplugins/shared/scripts/rh-catalog.sh
905ddb7 to
c0f68e9
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 `@plugins/shared/scripts/filter_images.py`:
- Around line 42-48: The issue is that datetime.fromisoformat() on naive
timestamp strings (like "2024-06-01" or "2024-06-01T12:00:00") produces naive
datetimes, which cannot be compared with timezone-aware datetimes, causing the
comparison on line 47 to silently fail. Convert the parsed start_dt and end_dt
to timezone-aware datetimes before performing the comparison, handling various
input formats including date-only strings, naive ISO timestamps, and Z-notation.
Additionally, add test cases covering naive ISO string inputs, Z-notation
timestamps, and aware datetime comparisons to validate the parsing and
comparison logic works correctly per CONTRIBUTING.md requirements.
- Line 88: The sorting of tags on line 88 uses only `len` as the sort key, which
is unstable when multiple tags have the same length since set iteration order is
nondeterministic. This causes `tags[0]` used on line 96 to vary between runs.
Modify the `sorted(set(all_tags), key=len)` call to use a tuple key that sorts
by length first, then by the tag string itself alphabetically as a secondary
sort criterion to ensure deterministic ordering regardless of set iteration
order.
🪄 Autofix (Beta)
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: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: 6901d722-21b3-4954-841a-8ed341ac691d
📒 Files selected for processing (6)
plugins/lvms-ci/scripts/filter_images.pyplugins/microshift-ci/scripts/filter_images.pyplugins/shared/scripts/create-report.pyplugins/shared/scripts/doctor.shplugins/shared/scripts/filter_images.pyplugins/shared/scripts/rh-catalog.sh
✅ Files skipped from review due to trivial changes (1)
- plugins/microshift-ci/scripts/filter_images.py
🚧 Files skipped from review as they are similar to previous changes (2)
- plugins/shared/scripts/doctor.sh
- plugins/shared/scripts/create-report.py
c0f68e9 to
db63ceb
Compare
b15db97 to
a7f735d
Compare
bd862c3 to
53316d6
Compare
|
/lgtm |

Sample Report
report-lvm-operator-ci-doctor.html
Image Health UI
LVMS
MicroShift
Summary by CodeRabbit
Summary by CodeRabbit