-
Notifications
You must be signed in to change notification settings - Fork 593
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
[WIP] Cleanup PipelineBuilder validation code #4805
[WIP] Cleanup PipelineBuilder validation code #4805
Conversation
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.
Some initial comments to help with reviews.
frontend/packages/dev-console/src/components/import/image-search/ImageStreamTagDropdown.tsx
Show resolved
Hide resolved
values, | ||
} = props; | ||
const statusRef = React.useRef(status); | ||
statusRef.current = status; | ||
useFormikValidationFix(values); |
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.
Odd that this does not fix my update error... Will need to investigate why. cc @rohitkrai03
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.
You might try moving this to the specific part of the form where validation issue is happening.
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.
Interesting... figured this was a deep compare... but will look into it. Perhaps there is some React non-triggering happening that could be triggering the issue. I'll investigate, thanks Rohit.
...dev-console/src/components/pipelines/pipeline-builder/task-sidebar/TaskSidebarParamArray.tsx
Show resolved
Hide resolved
import * as React from 'react'; | ||
|
||
export const SidebarInputWrapper: React.FC = ({ children }) => { | ||
return <div style={{ width: 'calc(100% - 28px)' }}>{children}</div>; |
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.
I'm not happy with this -- open to ideas on how I can keep the width of the inputs the same throughout the sidebar (the string[] guy comes with a "-" sign on the right side and that's 28px wide).
frontend/packages/dev-console/src/components/pipelines/pipeline-builder/validation-utils.ts
Show resolved
Hide resolved
/cc @abhinandan13jan Adding Abhi as the second reviewer as he has taken an interest in Pipelines in the past. |
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.
@andrewballantyne i'll look through a bit more carefully, but I notice that you use "please" in the messages. Our convention is to omit "please" from the UI, so if you can pull that word out, that would be great!
6447418
to
6318167
Compare
Fixed that, thanks for the reminder 😄 -- I've updated the description. @serenamarie125 While I was there looking at the code, I noticed this scenario got missed in refactor and the solution could not be the same... let me explain. This is what we have today as the initial resting state (immediately after adding the task and opening the sidebar): However, this is functionality that worked because the field was custom before this work... now we are using the standard form field and it's actually not possible to be in an error state, disabled, and where the user has never touched the field. This seems pretty consistent throughout our add forms as well. Solution... make it just help text (probably not ideal?): When you have a field and when you select it... I modified the tooltip to be similar to what I had but slightly different (see description screenshots for the previous look): |
b5dd259
to
28590b4
Compare
values, | ||
} = props; | ||
const statusRef = React.useRef(status); | ||
statusRef.current = status; | ||
useFormikValidationFix(values); |
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.
You might try moving this to the specific part of the form where validation issue is happening.
...dev-console/src/components/pipelines/pipeline-builder/task-sidebar/TaskSidebarParamArray.tsx
Show resolved
Hide resolved
frontend/packages/dev-console/src/components/pipelines/pipeline-builder/validation-utils.ts
Show resolved
Hide resolved
/assign |
I somehow broke logic and didn't test submission after that 🤦♂ Ah well, good catch @rohitkrai03 Thanks! I'll fix it. Got |
28590b4
to
8862c56
Compare
c5da205
to
d540071
Compare
d540071
to
704c5a5
Compare
Adding a WIP label to hide it from filters for Feature Freeze. Will go in next week. |
Needs to include logic from #5235 when reworked for 4.6 |
704c5a5
to
7a20104
Compare
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: andrewballantyne 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 |
Another PR to merge in #6228 |
/hold |
@andrewballantyne: The following tests failed, say
Full PR test history. Your PR dashboard. 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/test-infra repository. I understand the commands that are listed here. |
@andrewballantyne: The following tests failed, say
Full PR test history. Your PR dashboard. 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/test-infra repository. I understand the commands that are listed here. |
Fixes:
https://issues.redhat.com/browse/ODC-3165
Analysis / Root cause:
When the Pipeline Builder was put into 4.4 as a feature the week before Feature Freeze, corners were cut to get around some
yup
& Formik issues. This has caused a very brittle validation schema and served as non-stop issues.Solution Description:
Rewrite the validation schema to validate the entirety of the Pipeline Builder and remove all custom error code / handling.
Screen shots / Gifs for design review:
@openshift/team-devconsole-ux
Empty Name:
Invalid Name:
Array Param with error & description (breaks from the norm?):
Counter example of first field error:
Successful Resource connections:
Rename a resource; breaks connection:
Update to correct:
Delete resource (breaks connection but no fix):
Unit test coverage report:
Test setup:
This is my validation path, these should all pass (with the exception of one -- noted below).
openshift-client
(no error)s2i-nodejs
(error)s2i-java-11
(error, resources over params)openshift-client
s2i-java-11
s2i-nodejs
(error)openshift-client
task (for a positive passing task)s2i-nodejs
(error? — Formik has issues, still looking into it, any further update clears the error)Browser conformance:
/kind cleanup
/cc @rohitkrai03