Skip to content

RHOAIENG-50913-Part 2: A workbench cannot be stopped if it's hardware profile doesn't exist - #7175

Merged
openshift-merge-bot[bot] merged 1 commit into
opendatahub-io:stable-2.xfrom
srtanish1992:bug/RHOAIENG-50913-part2
Apr 10, 2026
Merged

RHOAIENG-50913-Part 2: A workbench cannot be stopped if it's hardware profile doesn't exist#7175
openshift-merge-bot[bot] merged 1 commit into
opendatahub-io:stable-2.xfrom
srtanish1992:bug/RHOAIENG-50913-part2

Conversation

@srtanish1992

@srtanish1992 srtanish1992 commented Apr 10, 2026

Copy link
Copy Markdown
Contributor

https://redhat.atlassian.net/browse/RHOAIENG-50913

Description

The useDeletedHardwareProfilePatches hook had a condition loaded && loadError added in #6947 that was impossible to satisfy — useFetch only sets loaded=true on success, never on error. This prevented hardware profile annotation removal patches from being generated, blocking workbench stop/start when the hardware profile was deleted.

Fix: remove the loaded check. loadError being set already implies the fetch completed.

hwnbbug.mp4

How Has This Been Tested?

Manually tested against RHOAI 2.25.4 cluster:

  • Stop a running workbench with a deleted hardware profile — succeeds, PATCH includes annotation removal
  • Start a stopped workbench with a deleted hardware profile — succeeds, PATCH includes annotation removal

Test Impact

Existing Cypress tests cover both scenarios — no changes needed:

  • Should stop a running workbench with a deleted hardware profile
  • Should start a stopped workbench with a deleted hardware profile

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)
  • The code follows our Best Practices (React coding standards, PatternFly usage, performance considerations)

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

@coderabbitai

coderabbitai Bot commented Apr 10, 2026

Copy link
Copy Markdown
Contributor

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.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 88177db2-8152-4d47-8e1c-e7fe763557f5

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

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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

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

useFetch never sets loaded=true when a fetch errors, so the condition
loaded && loadError was impossible to satisfy. This prevented the
hardware profile annotation removal patches from being generated,
causing workbench stop/start to fail when the hardware profile was
deleted.

Also add cy.wait for the hardware profile 404 fetch in the start test
to ensure the async response is processed before clicking.

Made-with: Cursor
@srtanish1992
srtanish1992 force-pushed the bug/RHOAIENG-50913-part2 branch from dca1d9b to 30d7ac4 Compare April 10, 2026 04:08
@codecov

codecov Bot commented Apr 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.93%. Comparing base (88e172f) to head (30d7ac4).
⚠️ Report is 38 commits behind head on stable-2.x.

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff               @@
##           stable-2.x    #7175      +/-   ##
==============================================
- Coverage       68.05%   67.93%   -0.12%     
==============================================
  Files            2230     2238       +8     
  Lines           50369    50847     +478     
  Branches        14086    14252     +166     
==============================================
+ Hits            34280    34545     +265     
- Misses          16089    16302     +213     
Files with missing lines Coverage Δ
...rdwareProfiles/useDeletedHardwareProfilePatches.ts 100.00% <100.00%> (ø)

... and 18 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 84a98b3...30d7ac4. 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.

@DaoDaoNoCode DaoDaoNoCode 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

@openshift-ci

openshift-ci Bot commented Apr 10, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: DaoDaoNoCode

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

The pull request process is described 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

@openshift-merge-bot
openshift-merge-bot Bot merged commit d45da9a into opendatahub-io:stable-2.x Apr 10, 2026
40 of 41 checks passed
DaoDaoNoCode added a commit to red-hat-data-services/odh-dashboard that referenced this pull request Apr 10, 2026
fix: remove loaded check in useDeletedHardwareProfilePatches (opendatahub-io#7175)
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.

2 participants