Fix /default parameters not displayed in Compare Runs
This PR fixes an issue where default pipeline parameters are not shown in the Compare Runs view when a run is created from the UI without changing any parameter values. Previously, parameter values were only propagated when the user interacted with the inputs, so untouched defaults were missing from runtime_config and therefore from Compare Runs.
changes
NewRunParametersV2.tsx
Extend the existing parameter initialization effect to:
1. Build runtimeParametersInRealType from specParameters using convertInput for each parameter type.
2. Call handleParameterChange(runtimeParametersInRealType) once on mount/when spec changes so that:
* Default parameter values are propagated to the parent (setRuntimeParameters).
* These defaults are included in runtime_config even if the user does not modify any parameter fields.
3. Preserve the existing validation behavior with setIsValidInput.
NewRunParametersV2.test.tsx
1. Add a test: calls handleParameterChange with default values on mount:
Mount NewRunParametersV2 with a set of parameters of different types: STRING, NUMBER_INTEGER, BOOLEAN, LIST, and STRUCT, each with a defaultValue.
2.Assert that handleParameterChange is:
* Called exactly once.
*Called with the correctly converted runtime values.
3. Assert that these default values are rendered in the UI inputs.
Fixes: #12536
Hi @rishabh998186. Thanks for your PR.
I'm waiting for a kubeflow member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.
Once the patch is verified, the new status will be reflected by the ok-to-test label.
I understand the commands that are listed here.
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.
/ok-to-test
Hey @droctothorpe, thanks for looking at my PR!
I've made some new changes to address the Compare Runs issue:
NewRunParametersV2.tsx: Now calls handleParameterChange on mount with all default parameter values, ensuring they're included in runtime_config even without user interaction
NewRunParametersV2.test.tsx: Updated existing tests and added 3 new test cases covering default-only runs, partial changes, and falsy default values
All tests are passing and the frontend build succeeds. Could you please review these changes and let me know if you need any modifications?
Thanks!
/ok-to-test
✅ Added ok-to-test label. CI will now run automatically on all commits to this PR.
/lgtm
@droctothorpe I think all required checks are passed the failing check is just an syntex error . If anything is still missing let me know , I fix it.
thinks for looking at my pr .
Np! Tag me once you fix the syntax error.
@droctothorpe done ,i fixed the syntex error.
/approve
Thanks for the contribution, @rishabh998186 ! 🎉
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: droctothorpe
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~frontend/OWNERS~~ [droctothorpe]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
@droctothorpe I think tke LGTM is required to merge this pr. Bot removed the label due to the new commit of syntex error fix . And Thanks for reviewing my pr.
/lgtm