Skip to content

fix(custom-image): match dashboard's actual duplicate-image error text - #3059

Open
jiridanek wants to merge 2 commits into
red-hat-data-services:masterfrom
jiridanek:fix/custom-image-duplicate-error-text
Open

fix(custom-image): match dashboard's actual duplicate-image error text#3059
jiridanek wants to merge 2 commits into
red-hat-data-services:masterfrom
jiridanek:fix/custom-image-duplicate-error-text

Conversation

@jiridanek

@jiridanek jiridanek commented Aug 22, 2026

Copy link
Copy Markdown
Member

Summary

Two fixes needed together to get Test Duplicate Image in custom-image.robot passing again:

1. Stale expected error text. The test waits for:

Unable to add notebook image: imagestreams.image.openshift.io "<hyphenated-name>" already exists

but the actual RHOAI Dashboard shows:

Unable to add notebook image: image.openshift.io/v1 "<raw display name, with spaces>" already exists

byonDuplicatedErrorMessage() in odh-dashboard's frontend (frontend/src/utilities/imageStreamUtils.ts) builds this message itself from kindApiVersion(ImageStreamModel) (a GroupVersion string, image.openshift.io/v1) plus the raw, un-sanitized display name — it never actually surfaces the k8s API's own imagestreams.image.openshift.io ... already exists conflict text (which is group-resource-qualified and hyphenated). Confirmed this directly against a live cluster: creating a duplicate ImageStream via kubectl create returns the group-resource-qualified message straight from the k8s apiserver, so the mismatch is entirely in the dashboard's own message construction — not something that varies between real OpenShift and any test/dev backend.

2. Stale sidebar navigation, breaking Suite Setup for every test in the file. Open Notebook Images Page calls Menu.Navigate To Page with only 2 levels (Settings, Workbench images), but the dashboard sidebar now nests Workbench images (along with Hardware profiles and Connection types) inside an intermediate "Environment setup" group under Settings. With the 2-level call, the code expands "Settings" and then immediately tries to click the "Workbench images" link — which exists in the DOM but is still hidden inside the collapsed "Environment setup" accordion, since that group was never expanded. This throws ElementNotInteractableException deterministically (not a flake) on any current dashboard build with this nav structure. Navigate To Page already supports a 3-level (subsubmenu) call for exactly this case; this just uses it.

Version bracket for backporting: checked frontend/src/plugins/extensions/navigation.ts across red-hat-data-services/odh-dashboard release branches directly. rhoai-2.25 still has the old flat structure (Workbench images a direct child of Settings, no Environment setup group at all) — the 2-level call is correct there and this fix must NOT be backported to anything targeting 2.25 (it would break navigation the other way). The nested Environment setup group is present on rhoai-3.0, rhoai-3.2, rhoai-3.3, and rhoai-3.4 (didn't check every intermediate tag; rhoai-3.1 branch doesn't exist in the repo) — so this is a RHOAI-3.x-only regression, introduced sometime between the 2.25 and 3.0 dashboard releases.

Context

Found while investigating jiridanek/rhoai-in-kind#56 (a from-scratch kind-based CI harness for RHOAI), where issue 1 was one of two failures in custom-image.robot. Not yet ported to opendatahub-tests (checked — no BYON/duplicate-image-conflict test exists there yet), so this fix is still relevant to the active robot suite.

When did this regress?

The expected text (issue 1) was last deliberately fixed to the current (now-stale) form on 2025-01-14 (7d593c4, "[fix] tests for the BYON feature"), correctly matching the dashboard's behavior at the time.

byonDuplicatedErrorMessage() first appears in odh-dashboard at opendatahub-io/odh-dashboard#4470 ("Migrate /images POST, PUT, and DELETE endpoints to frontend", merged 2025-08-08) — confirmed absent from imageStreamUtils.ts as of the June 2025 GET-only migration commit, present fully-formed in #4470's merge commit. Before that PR, image creation/duplicate-conflict handling ran through the backend (which relayed the k8s API's own conflict message, matching what this test expected); after the migration to frontend-only handling, the frontend started constructing its own message client-side, causing the mismatch this PR fixes.

A later ods-ci fix pass (723340b, 2025-10-27, "fix jupyterhub/workbenches related tests for RHOAI3.0") touched this same file but didn't revisit this specific assertion, so it's been silently broken since roughly August 2025.

Testing

Verified against a real cluster (RHOAI 3.5.0), not just static analysis:

  • Manually reproduced the duplicate-image scenario via the dashboard UI and confirmed it shows exactly Unable to add notebook image: image.openshift.io/v1 "<name>" already exists, matching this fix's expected text.
  • Ran Test Duplicate Image end-to-end with both commits applied against the same RHOAI 3.5.0 cluster: 1 test, 1 passed, 0 failed. Before the second commit, Suite Setup failed 100% of the time with ElementNotInteractableException trying to click "Workbench images" (confirmed twice, not a one-off flake).

byonDuplicatedErrorMessage() in odh-dashboard's frontend
(frontend/src/utilities/imageStreamUtils.ts) builds the "Unable to add
notebook image: ..." conflict message itself from
kindApiVersion(ImageStreamModel) plus the raw display name - it never
surfaces the k8s API's own "imagestreams.image.openshift.io ... already
exists" conflict text. So the dialog actually shows
`image.openshift.io/v1 "<raw name with spaces>" already exists`, not the
group-resource-qualified, hyphenated form this test was waiting for.

Verified against a live cluster: creating a duplicate ImageStream via
kubectl gives the group-resource-qualified message directly from k8s,
confirming the mismatch is entirely in the dashboard's own message
construction and not something that varies between real OpenShift and
any polyfilled backend.
@coderabbitai

coderabbitai Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: 85908d6c-7a91-49f4-8811-2ec047b52b5f

📥 Commits

Reviewing files that changed from the base of the PR and between 98b92bf and 7ef4a24.

📒 Files selected for processing (1)
  • ods_ci/tests/Resources/Page/ODH/ODHDashboard/ODHDashboard.robot

Included review availability: Your plan provides up to 12 included reviews per hour; 10 remain after this review.


📝 Walkthrough

Walkthrough

The PR updates notebook image navigation to use Settings > Environment setup > Workbench images. It also updates duplicate custom-image validation to match the dashboard-generated error format.

Changes

Dashboard test updates

Layer / File(s) Summary
Dashboard navigation and duplicate-image validation
ods_ci/tests/Resources/Page/ODH/ODHDashboard/ODHDashboard.robot, ods_ci/tests/Tests/0500__ide/0501__ide_jupyterhub/custom-image.robot
Open Notebook Images Page now opens Workbench images through Environment setup. The duplicate-image test expects the dashboard’s image.openshift.io/v1 error and removes image-name normalization.

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

Merge Risk: ⚪ Minimal · up to 7ef4a

The change aligns duplicate-image test handling with the dashboard's displayed error text and does not introduce a production behavior change; no actionable merge-blocking risk remains after normal checks and review.

Suggested reviewers: jstourac

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)
Description check ✅ Passed The description directly explains both test fixes, their RHOAI version scope, and the verification performed.
Linked Issues check ✅ Passed The linked issue concerns the failing custom-image tests addressed by this pull request.
Out of Scope Changes check ✅ Passed Both file changes directly support the stated duplicate-image assertion and sidebar navigation fixes.
Title check ✅ Passed The title clearly identifies the primary change: matching the dashboard's duplicate-image error text.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

… images

Open Notebook Images Page called Menu.Navigate To Page with only 2 levels
(Settings, Workbench images), but the dashboard sidebar now nests
Workbench images (along with Hardware profiles and Connection types)
inside an intermediate "Environment setup" group under Settings. With
the 2-level call, the code expands "Settings" and then immediately tries
to click the "Workbench images" link - which exists in the DOM but is
still hidden inside the collapsed "Environment setup" accordion, since
that group was never expanded. This throws
ElementNotInteractableException deterministically (not a flake) on any
current dashboard build with this nav structure, failing Suite Setup for
every test in custom-image.robot before any test case even runs.

Navigate To Page already supports a 3-level (subsubmenu) call for
exactly this case; this just uses it.
@sonarqubecloud

Copy link
Copy Markdown

@jstourac jstourac left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/lgtm
/approve

@openshift-ci

openshift-ci Bot commented Aug 24, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: jiridanek, jstourac

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

@jiridanek
jiridanek enabled auto-merge (squash) August 24, 2026 08:57
@jiridanek

Copy link
Copy Markdown
Member Author

/cherrypick rhoai-3.5

@openshift-cherrypick-robot

Copy link
Copy Markdown

@jiridanek: once the present PR merges, I will cherry-pick it on top of rhoai-3.5 in a new PR and assign it to you.

Details

In response to this:

/cherrypick rhoai-3.5

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.

@jiridanek
jiridanek requested a review from harshad16 August 25, 2026 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm verified This PR has been tested with Jenkins

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants