-
Notifications
You must be signed in to change notification settings - Fork 670
Bug 1798357: Bump formik #4087
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
Bug 1798357: Bump formik #4087
Conversation
|
/retest |
1 similar comment
|
/retest |
|
|
Yes already mentioned the error in the description. Shouldnt have retested because obviously the tests will fail. |
|
@divyanshiGupta I think we can go ahead with upgrade to 2.0.3 for now and later upgrade to latest with all the required changes. |
rohitkrai03
left a comment
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.
/lgtm
|
/kind bug @divyanshiGupta looks like you have a test break around Formik components. |
|
@andrewballantyne fixed the test. |
|
@divyanshiGupta Awesome, you'll need to get Christian or someone from Admin to approve it as it reached outside of our teams packages for me to approve. |
|
/assign @christianvogt |
|
@andrewballantyne you can add lgtm as it got removed because of the test fix. |
|
/lgtm |
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.
@divyanshiGupta why is it we need to use useFormikContext here but we still use useField elsewhere like here:
https://github.com/openshift/console/blob/master/frontend/packages/dev-console/src/components/import/git/SourceSecretSelector.tsx#L12
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.
@christianvogt after upgrade it was throwing error on line 18,27,37 and 46 that the defaultRequestUnit does not exist on type string, I tried to do a bunch of things but the error wont go, then I tried to use the same values from useFormikContext and the error was gone.
Then I went through the implementation and they have changed the implementation of getFieldProps (used inside useField to get the field values) a bit from 2.0.1rc5 to 2.0.3. Now in 2.0.3 its enforced that we need to pass an object to useField for field types such as checkbox to get the desired data, but for other field types such TextInput passing a string of field name is sufficient. For full context you will have to go through the above 2 links I posted.
I missed to update the ToggleableFieldBase though, will do it. But I think for our use case here its okay to use useFormikContext in ResourceLimitSection since its not a FormikField and useField, if you see the implementation makes more sense when used in a FormikField.
|
Updated the |
|
fyi @jtomasek |
|
/lgtm |
|
@divyanshiGupta please add a bz |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: christianvogt, divyanshiGupta, rohitkrai03 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
1 similar comment
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
@divyanshiGupta: This pull request references Bugzilla bug 1798357, which is invalid:
Comment DetailsIn response to this:
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. |
|
/bugzilla refresh |
|
@divyanshiGupta: This pull request references Bugzilla bug 1798357, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
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. |
|
@divyanshiGupta: All pull requests linked via external trackers have merged. Bugzilla bug 1798357 has been moved to the MODIFIED state. DetailsIn response to this:
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. |
Jira Issue - https://issues.redhat.com/browse/ODC-2853
After
formikupgrade to2.0.1-rc.5this error jaredpalmer/formik#1678 started to pop on forms where it is needed to populate the form fields with existing values and an existing event handler is used insideuseEffectto achieve this.For example dev-console edit flows (In deploy image internal registry edit flow
imageStreamNamespaceis already set andonDropdownChangeis called to fill the other fields and dispatch desired actions according to thenamespace).formikupgrade is needed for dev-console edit flows:Solution:

Upgrade to 2.1.2
It gives this error -
To resolve this we need to upgrade
@types/reactand it gives another lot of errors on upgrade.Upgrade to 2.0.3
It solves the formik issue jaredpalmer/formik#1678 and does not give the above mentioned type error and hence no need of upgrading
@types/react.@rohitkrai03 Which approach seems better? I think upgrading to 2.0.3 will be better for the time being
cc: @christianvogt