Skip to content

Conversation

nananosirova
Copy link
Contributor

@nananosirova nananosirova commented Aug 5, 2025

https://issues.redhat.com/browse/RHOAIENG-31381

Description

We currently handle two types of image streams:

  • BYON image streams: Typically contain a single tag pointing to one image.
  • Non-BYON image streams: Contain multiple tags, each corresponding to a different versioned image.
    When a tag refers to an image that cannot be retrieved , the tag is marked with an error condition. For example:
- tag: '2023.2'
  conditions:
    - type: ImportSuccess
      status: 'False'
      reason: NotFound
      message: 'dockerimage.image.openshift.io "quay.io/opendatahub/workbench-images:latest" not found'

To avoid showing invalid images in the UI, we check tag import statuses after fetching image streams.
For BYON image streams, this validation works by inspecting the status of the single available tag.
However, the current logic incorrectly treats non-BYON image streams the same way by checking only the first tag in the list.
Since the tag list is sorted in ascending order (e.g: '2023.2', '2024.1', '2024.2'), this means that if the oldest tag failed to import (which could happen in disconnected environments where unsupported images are excluded), the entire image stream would be considered invalid and filtered out even if newer valid tags were present.

In this PR, we fix the issue by correcting the differentiation between BYON and non-BYON image streams.

How Has This Been Tested?

Tested on a cluster by using the image produced from branch.

Test Impact

In a cluster with ODH 2.30 installed (equivalent to RHOAI 2.22):

Request review criteria:

Self checklist (all need to be checked):

  • The developer has manually tested the changes and verified that the changes work
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has added tests or explained why testing cannot be added (unit or cypress tests for related changes)

If you have UI changes:

  • Included any necessary screenshots or gifs if it was a UI change.
  • Included tags to the UX team if it was a UI/UX change.

After the PR is posted & before it merges:

  • The developer has tested their solution on a cluster by using the image produced by the PR to main

Summary by CodeRabbit

  • Bug Fixes
    • Corrected an issue where error messages for certain images were not set accurately, ensuring error information now reflects the actual image data.

@openshift-ci openshift-ci bot requested review from mturley and pnaik1 August 5, 2025 20:11
Copy link
Contributor

coderabbitai bot commented Aug 5, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

A logical error in the processImageInfo function within imageUtils.ts has been corrected. The code now properly calls the isBYONImage function with the imageStream argument, ensuring the error property is set based on the actual image stream rather than a function reference.

Changes

Cohort / File(s) Change Summary
Image Processing Logic Fix
backend/src/routes/api/images/imageUtils.ts
Corrected invocation of isBYONImage in processImageInfo to use the function result, not the function reference, for error assignment.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Suggested labels

lgtm, approved

Poem

A bug in the stream, now set to rights,
No more confusion in logical flights.
The rabbit hops, with code so bright,
BYON errors now handled just right!
🐇✨

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.
  • 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.

Support

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

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 generate unit tests to generate unit tests for 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.

@nananosirova nananosirova changed the title Workbench images with incomplete imagestreams are not listed in the Spawn basic workbench odh-dashboard page [WIP] Workbench images with incomplete imagestreams are not listed in the Spawn basic workbench odh-dashboard page Aug 5, 2025
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress This PR is in WIP state label Aug 5, 2025
@nananosirova nananosirova changed the base branch from main to v2.30.0-fixes August 5, 2025 20:11
Copy link
Contributor

openshift-ci bot commented Aug 5, 2025

@nananosirova: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/images 0f0e774 link true /test images
ci/prow/odh-dashboard-pr-image-mirror 0f0e774 link true /test odh-dashboard-pr-image-mirror

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@nananosirova nananosirova changed the title [WIP] Workbench images with incomplete imagestreams are not listed in the Spawn basic workbench odh-dashboard page Workbench images with incomplete imagestreams are not listed in the Spawn basic workbench odh-dashboard page Aug 5, 2025
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress This PR is in WIP state label Aug 5, 2025
Copy link

codecov bot commented Aug 5, 2025

Codecov Report

❌ Patch coverage is 83.59133% with 53 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.10%. Comparing base (3ea00fd) to head (ca4c3b7).
⚠️ Report is 598 commits behind head on v2.35.0-fixes.

Files with missing lines Patch % Lines
frontend/src/utilities/useEnableApplication.tsx 63.15% 14 Missing ⚠️
frontend/src/components/OdhAppCard.tsx 0.00% 9 Missing ⚠️
...pts/metrics/kserve/useNimMetricsGraphDefinition.ts 73.68% 5 Missing ⚠️
...ntend/src/pages/exploreApplication/EnableModal.tsx 37.50% 5 Missing ⚠️
...d/src/pages/exploreApplication/GetStartedPanel.tsx 28.57% 5 Missing ⚠️
...nd/src/utilities/useWatchIntegrationComponents.tsx 66.66% 4 Missing ⚠️
.../src/concepts/metrics/kserve/NimMetricsContext.tsx 88.00% 3 Missing ⚠️
...metrics/kserve/content/NIMCurrentRequestsGraph.tsx 80.00% 3 Missing ⚠️
...etrics/kserve/content/NIMRequestsOutcomesGraph.tsx 84.61% 2 Missing ⚠️
...pts/metrics/kserve/content/NIMTokensCountGraph.tsx 92.30% 1 Missing ⚠️
... and 2 more
Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                @@
##           v2.35.0-fixes    #4629      +/-   ##
=================================================
+ Coverage          85.82%   86.10%   +0.27%     
=================================================
  Files               1419     1431      +12     
  Lines              32644    32923     +279     
  Branches            9167     9245      +78     
=================================================
+ Hits               28018    28347     +329     
+ Misses              4626     4576      -50     
Files with missing lines Coverage Δ
...end/src/api/prometheus/kservePerformanceMetrics.ts 99.11% <100.00%> (+1.07%) ⬆️
frontend/src/concepts/metrics/kserve/const.ts 100.00% <100.00%> (ø)
...ts/metrics/kserve/content/NIMKVCacheUsageGraph.tsx 100.00% <100.00%> (ø)
...rics/kserve/content/NIMTimeForFirstTokenGraphs.tsx 100.00% <100.00%> (ø)
...rics/kserve/content/NIMTimePerOutputTokenGraph.tsx 100.00% <100.00%> (ø)
...cepts/metrics/kserve/content/NimMetricsContent.tsx 100.00% <100.00%> (ø)
frontend/src/concepts/metrics/kserve/utils.ts 100.00% <100.00%> (ø)
...src/concepts/nimServing/NIMAvailabilityContext.tsx 100.00% <100.00%> (+9.09%) ⬆️
...t/pipelinesDetails/pipelineRun/runLogs/LogsTab.tsx 76.47% <ø> (ø)
...pages/exploreApplication/useIntegratedAppStatus.ts 88.88% <100.00%> (+1.38%) ⬆️
... and 21 more

... and 6 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3ea00fd...ca4c3b7. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jiridanek
Copy link
Member

@coderabbitai full review

Copy link
Contributor

coderabbitai bot commented Aug 6, 2025

✅ Actions performed

Full review triggered.

Copy link
Contributor

@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: 1

🔭 Outside diff range comments (1)
backend/src/routes/api/images/imageUtils.ts (1)

169-173: getTagInfo may return undefined – propagate crash

Early-returning without a value breaks the declared return type
ImageTagInfo[] and will blow up any caller that does
(getTagInfo(...) || []).map(...).

-  if (!tags?.length) {
-    console.error(`${imageStream.metadata.name} does not have any tags.`);
-    return;
-  }
+  if (!tags?.length) {
+    console.error(`${imageStream.metadata.name} does not have any tags.`);
+    return [];
+  }
🧹 Nitpick comments (1)
backend/src/routes/api/images/imageUtils.ts (1)

208-220: Simplify packagesToString implementation

The manual string building is verbose, error-prone and slower than
JSON.stringify.

-  if (packages.length > 0) {
-    let packageAsString = '[';
-    packages.forEach((value, index) => {
-      packageAsString = packageAsString + JSON.stringify(value);
-      if (index !== packages.length - 1) {
-        packageAsString = packageAsString + `,`;
-      } else {
-        packageAsString = packageAsString + ']';
-      }
-    });
-    return packageAsString;
-  }
-  return '[]';
+  return JSON.stringify(packages);
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 30bd23d and ca4c3b7.

📒 Files selected for processing (1)
  • backend/src/routes/api/images/imageUtils.ts (1 hunks)

Comment on lines +145 to 146
error: isBYONImage(imageStream) && getBYONImageErrorMessage(imageStream),
};
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Guard against false leaking into error field

&& will assign the boolean false to error whenever the image is not BYON.
Down-stream consumers almost certainly expect either undefined/null or a
string message – not a boolean. Use a ternary to keep the type stable.

-    error: isBYONImage(imageStream) && getBYONImageErrorMessage(imageStream),
+    error: isBYONImage(imageStream)
+      ? getBYONImageErrorMessage(imageStream)
+      : undefined,
📝 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
error: isBYONImage(imageStream) && getBYONImageErrorMessage(imageStream),
};
error: isBYONImage(imageStream)
? getBYONImageErrorMessage(imageStream)
: undefined,
};
🤖 Prompt for AI Agents
In backend/src/routes/api/images/imageUtils.ts around lines 145 to 146, the
error field is assigned using a logical AND which results in a boolean false
when the image is not BYON, but downstream expects either undefined/null or a
string. Replace the logical AND with a ternary expression that assigns the error
message string if the image is BYON, otherwise assigns undefined or null to keep
the error field type consistent.

@nananosirova nananosirova changed the base branch from v2.30.0-fixes to v2.35.0-fixes August 6, 2025 14:18
@nananosirova nananosirova changed the base branch from v2.35.0-fixes to v2.30.0-fixes August 6, 2025 14:29
@nananosirova nananosirova changed the base branch from v2.30.0-fixes to v2.35.0-fixes August 6, 2025 14:34
@jrenee42
Copy link
Contributor

/lgtm
/approve

@jrenee42
Copy link
Contributor

/approve

1 similar comment
@Gkrumbach07
Copy link
Member

/approve

Copy link
Contributor

openshift-ci bot commented Aug 26, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Gkrumbach07, jrenee42

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

The pull request process is described here

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

@openshift-merge-bot openshift-merge-bot bot merged commit 530e266 into opendatahub-io:v2.35.0-fixes Aug 26, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants