Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deleting workbench resource makes workbench editable #3368

Merged
merged 1 commit into from
Oct 25, 2024

Conversation

pnaik1
Copy link
Contributor

@pnaik1 pnaik1 commented Oct 23, 2024

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

Description

  • If a cluster admin deletes secrets or config maps that a Notebook resource (workbench) uses, then editing notebook will display a alert warning stating which secret or configmap is deleted
  • if you click on the update workbench, the notebook will be updated successfully without any error and the secrets/ configmaps will be removed from envFrom
  • You can even delete the notebook which has secrets/configMaps deletd by clusteradmin successfully without any error

How Has This Been Tested?

  1. Create a workbench with secret or configMap env variables and
  2. Delete one of the env variables from console
  3. Stop the workbench and edit the workbench
  4. check the workbench with alert warning
  5. check whether the workbench updates successfully
  6. delete the workbench which has has secrets/configMaps deletd by clusteradmin and check if its deleted successfully

Screenshot 2024-10-23 at 5 31 38 PM

Screenshot 2024-10-23 at 5 29 03 PM

Test Impact

added cypress test

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

@xianli123
Copy link

Thanks! @pnaik1 LGTM!

Copy link

codecov bot commented Oct 23, 2024

Codecov Report

Attention: Patch coverage is 94.36620% with 4 lines in your changes missing coverage. Please review.

Project coverage is 85.07%. Comparing base (d9788f8) to head (5061e96).
Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
.../spawner/environmentVariables/AlertWarningText.tsx 93.10% 2 Missing ⚠️
...r/environmentVariables/useNotebookEnvVariables.tsx 91.66% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3368      +/-   ##
==========================================
- Coverage   85.08%   85.07%   -0.01%     
==========================================
  Files        1329     1330       +1     
  Lines       29931    29989      +58     
  Branches     8200     8216      +16     
==========================================
+ Hits        25466    25514      +48     
- Misses       4465     4475      +10     
Files with missing lines Coverage Δ
...src/pages/projects/screens/spawner/SpawnerPage.tsx 96.92% <100.00%> (+0.14%) ⬆️
...ects/screens/spawner/environmentVariables/utils.ts 100.00% <100.00%> (ø)
...tend/src/pages/projects/screens/spawner/service.ts 78.67% <100.00%> (+2.38%) ⬆️
.../spawner/environmentVariables/AlertWarningText.tsx 93.10% <93.10%> (ø)
...r/environmentVariables/useNotebookEnvVariables.tsx 86.95% <91.66%> (+2.10%) ⬆️

... and 5 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 d9788f8...5061e96. Read the comment docs.

Copy link
Member

@DaoDaoNoCode DaoDaoNoCode left a comment

Choose a reason for hiding this comment

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

Left some comments, code lgtm overall. I still need to test it on a live cluster.

@pnaik1 pnaik1 force-pushed the rhoaieng-1891 branch 2 times, most recently from 99d2931 to a1234bb Compare October 24, 2024 10:19
@pnaik1
Copy link
Contributor Author

pnaik1 commented Oct 25, 2024

FYI, I have modified the existing useNotebookEnvVariables hook to include a call to getDeletedConfigMapOrSecretVariables, thats because current envVariables lists even the newly added/changed envVariables leading to unnecessary alerts when previously present envVariables are deleted from edit workbench page, open to any different approaches

Copy link
Member

@DaoDaoNoCode DaoDaoNoCode left a comment

Choose a reason for hiding this comment

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

/lgtm

@DaoDaoNoCode
Copy link
Member

/retest

Copy link
Member

@Gkrumbach07 Gkrumbach07 left a comment

Choose a reason for hiding this comment

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

this looks good

/lgtm

Copy link
Contributor

openshift-ci bot commented Oct 25, 2024

[APPROVALNOTIFIER] This PR is APPROVED

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

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 cfff255 into opendatahub-io:main Oct 25, 2024
6 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.

5 participants