-
Notifications
You must be signed in to change notification settings - Fork 163
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
add pipeline input parameters #3293
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3293 +/- ##
==========================================
- Coverage 84.77% 84.77% -0.01%
==========================================
Files 1308 1309 +1
Lines 29247 29283 +36
Branches 7936 7954 +18
==========================================
+ Hits 24795 24824 +29
- Misses 4452 4459 +7
... and 15 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
let value = initialValue; | ||
|
||
if (typeof value === 'boolean') { | ||
value = value ? 'True' : 'False'; | ||
} | ||
|
||
if (typeof value === 'object') { | ||
value = JSON.stringify(value); |
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.
pipeline spec for the run has input definition types that can be used
inputDefinitions:
parameters:
datastore:
parameterType: STRUCT
hyperparameters:
parameterType: STRUCT
These should match up the the run runtime_config parameters, if not you can fall back to just a string, but if there is a match you can use the same type of parsing we do here:
Lines 56 to 90 in 33ea696
switch (type) { | |
case InputDefinitionParameterType.DOUBLE: | |
return numberValue && Number.isInteger(numberValue) | |
? numberValue.toFixed(1) | |
: numberValue; | |
case InputDefinitionParameterType.INTEGER: | |
return numberValue; | |
case InputDefinitionParameterType.BOOLEAN: | |
return boolValue ? 'True' : 'False'; | |
case InputDefinitionParameterType.STRING: | |
try { | |
const jsonStringValue = JSON.parse(stringValue ?? ''); | |
if (parseFloat(jsonStringValue)) { | |
throw stringValue; | |
} | |
return ( | |
<ExecutionDetailsPropertiesValueCode | |
code={JSON.stringify(jsonStringValue, null, 2)} | |
/> | |
); | |
} catch { | |
return stringValue || <NoValue />; | |
} | |
break; | |
case InputDefinitionParameterType.LIST: | |
return <ExecutionDetailsPropertiesValueCode code={JSON.stringify(listValue, null, 2)} />; | |
case InputDefinitionParameterType.STRUCT: | |
return ( | |
<ExecutionDetailsPropertiesValueCode code={JSON.stringify(structValue, null, 2)} /> | |
); | |
default: | |
return nullValue; | |
} |
make sure to create a reusable util for this then to avoid duplicate code
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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Gkrumbach07 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 |
https://issues.redhat.com/browse/RHOAIENG-9425
Description
Added back the input parameter tab which was removed previously
Both for runs and scheduled runs
How Has This Been Tested?
Test Impact
Updated cypress test
Request review criteria:
Self checklist (all need to be checked):
If you have UI changes:
After the PR is posted & before it merges:
main