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

Fix validation in the storage modal mount path #3236

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

DaoDaoNoCode
Copy link
Member

@DaoDaoNoCode DaoDaoNoCode commented Sep 20, 2024

JIRA: https://issues.redhat.com/browse/RHOAIENG-7680

Description

There is something wrong with the logic in the helper text and what error text we should show. I made some changes to that to correct the logic. Also, change the regex to allow a trailing / in the path.

Initial state:

Screenshot 2024-09-20 at 3 12 01 PM

Trailing slash:

Screenshot 2024-09-20 at 3 12 24 PM

Duplicate path:

Screenshot 2024-09-20 at 3 12 47 PM

Empty input:

Screenshot 2024-09-20 at 3 13 05 PM

Invalid value (contains number):

Screenshot 2024-09-20 at 3 13 30 PM

Invalid value (slash is not the trailing slash):

Screenshot 2024-09-20 at 3 14 32 PM

How Has This Been Tested?

  1. Create a cluster storage
  2. Attach it to a workbench
  3. Input in the mouth path field, check if it's allowing a trailing slash
  4. Check all the error states as listed above

Test Impact

Updated the cypress test to check the error cases.

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

Copy link
Contributor

openshift-ci bot commented Sep 20, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign manosnoam for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

@DaoDaoNoCode
Copy link
Member Author

@andrewballantyne The bug you mentioned in #3231 (review) is not because of the connection path starts with a preexisting connection path, it's because you have a number 2 in your path, which is not allowed. The code had wrong logic of checking the error cases so it was showing an incorrect error message. The logic is fixed now in this PR.

@andrewballantyne
Copy link
Member

That logic is likely wrong fwiw -- but I suppose this PR doesn't have to deal with that

Copy link

codecov bot commented Sep 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (main@83472f4). Learn more about missing BASE report.
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3236   +/-   ##
=======================================
  Coverage        ?   85.48%           
=======================================
  Files           ?     1280           
  Lines           ?    28228           
  Branches        ?     7557           
=======================================
  Hits            ?    24132           
  Misses          ?     4096           
  Partials        ?        0           
Files with missing lines Coverage Δ
frontend/src/pages/projects/pvc/MountPathField.tsx 100.00% <100.00%> (ø)

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 83472f4...a5ceb94. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants