fix(custom-image): match dashboard's actual duplicate-image error text - #3059
fix(custom-image): match dashboard's actual duplicate-image error text#3059jiridanek wants to merge 2 commits into
Conversation
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.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 12 included reviews per hour; 10 remain after this review. 📝 WalkthroughWalkthroughThe PR updates notebook image navigation to use ChangesDashboard test updates
Estimated code review effort: 1 (Trivial) | ~2 minutes Merge Risk: ⚪ Minimal · up to 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: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
… 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.
|
|
[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. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/cherrypick rhoai-3.5 |
|
@jiridanek: once the present PR merges, I will cherry-pick it on top of DetailsIn response to this:
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. |



Summary
Two fixes needed together to get
Test Duplicate Imageincustom-image.robotpassing again:1. Stale expected error text. The test waits for:
but the actual RHOAI Dashboard shows:
byonDuplicatedErrorMessage()in odh-dashboard's frontend (frontend/src/utilities/imageStreamUtils.ts) builds this message itself fromkindApiVersion(ImageStreamModel)(a GroupVersion string,image.openshift.io/v1) plus the raw, un-sanitized display name — it never actually surfaces the k8s API's ownimagestreams.image.openshift.io ... already existsconflict text (which is group-resource-qualified and hyphenated). Confirmed this directly against a live cluster: creating a duplicateImageStreamviakubectl createreturns 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 PagecallsMenu.Navigate To Pagewith only 2 levels (Settings,Workbench images), but the dashboard sidebar now nestsWorkbench images(along withHardware profilesandConnection 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 throwsElementNotInteractableExceptiondeterministically (not a flake) on any current dashboard build with this nav structure.Navigate To Pagealready supports a 3-level (subsubmenu) call for exactly this case; this just uses it.Version bracket for backporting: checked
frontend/src/plugins/extensions/navigation.tsacross red-hat-data-services/odh-dashboard release branches directly.rhoai-2.25still has the old flat structure (Workbench imagesa direct child ofSettings, noEnvironment setupgroup 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 nestedEnvironment setupgroup is present onrhoai-3.0,rhoai-3.2,rhoai-3.3, andrhoai-3.4(didn't check every intermediate tag;rhoai-3.1branch 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 toopendatahub-tests(checked — noBYON/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 fromimageStreamUtils.tsas 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:
Unable to add notebook image: image.openshift.io/v1 "<name>" already exists, matching this fix's expected text.Test Duplicate Imageend-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 withElementNotInteractableExceptiontrying to click "Workbench images" (confirmed twice, not a one-off flake).