-
Notifications
You must be signed in to change notification settings - Fork 168
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
Fix validation in the storage modal mount path #3236
Conversation
@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 |
7320c9e
to
a5ceb94
Compare
That logic is likely wrong fwiw -- but I suppose this PR doesn't have to deal with that |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3236 +/- ##
=======================================
Coverage 85.07% 85.08%
=======================================
Files 1292 1292
Lines 28814 28813 -1
Branches 7749 7748 -1
=======================================
+ Hits 24514 24516 +2
+ Misses 4300 4297 -3
... and 4 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verified locally. Although you did not write the error messages of Must only consist of lower case letters and dashes
and Mount folder is already in use for this workbench
, I think these both are meant to end with periods.
Worth having @kaedward take a look at all of these screenshots of yours to be sure anyways. I don't consider this blocking.
@@ -37,8 +37,8 @@ const MountPathField: React.FC<MountPathFieldProps> = ({ | |||
onChange={(e, value) => { | |||
let error = ''; | |||
if (value.length === 0) { | |||
error = 'Required'; | |||
} else if (!/^[a-z-]+$/.test(value)) { | |||
error = 'Enter a path to a model or folder. This path cannot point to a root folder.'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this text been provided by UX? Maybe @kaedward could verify this tech content.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I just moved the old text here https://github.com/opendatahub-io/odh-dashboard/blob/main/frontend/src/pages/projects/pvc/MountPathField.tsx#L55 to above because the helper text render logic was incorrect before.
a5ceb94
to
90dae40
Compare
90dae40
to
15d1363
Compare
@DaoDaoNoCode it will except a duplicate path if you put a just a trailing slash, but will reject without it or if you add another folder to the end of the trailing slash |
@Gkrumbach07 Reading the comment that @andrewballantyne left in the ticket:
I think |
Read the last line of the description
Allow them to add a slash if they want. |
if
is true then this looks good, otherwise needs to be fixed? |
@Gkrumbach07 I tested with both |
no it can handle the path. i am saying it allows me to create two pvcs one with /something and the other with /something/... both attached to the same workbench. i tested it and it wont let the notebook start |
@Gkrumbach07 My notebook start and running |
i still cannot replicate it. Are you restarting the workbench pods after you add both PVCs to it |
@Gkrumbach07 Hmm, I added it to a stopped notebook, and click toggle the start manually. |
well i cant get a workbench to spawn at all im pretty sure so something is wrong on my end. I wont hold this PR up then /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Gkrumbach07, jpuzz0 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 |
/retest |
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:
Trailing slash:
Duplicate path:
Empty input:
Invalid value (contains number):
Invalid value (slash is not the trailing slash):
How Has This Been Tested?
Test Impact
Updated the cypress test to check the error cases.
Request review criteria:
Self checklist (all need to be checked):
If you have UI changes:
After the PR is posted & before it merges:
main