-
Notifications
You must be signed in to change notification settings - Fork 798
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 ability to add default values to workflow parameters #865
Conversation
…src/' <!-- ELLIPSIS_HIDDEN --> | 🚀 | This description was created by 370ad16b5841fa91e23e2a0ac9fa41a2fcf2e057 | |--------|--------| feat: add default value support for workflow parameters ### Summary: Add default value support for workflow parameters with UI updates and JSON parsing. **Key points**: - Add default value support for workflow parameters. - Update UI in `FlowRenderer.tsx` and `WorkflowEditor.tsx`. - Allow setting/editing default values in `WorkflowParameterAddPanel.tsx` and `WorkflowParameterEditPanel.tsx`. - Handle JSON parsing for default values. - Replace `Input` with `AutoResizingTextarea` for string parameters in `WorkflowParameterInput.tsx`. - Add `Label` for boolean parameters in `WorkflowParameterInput.tsx`. - Add `getDefaultValueForParameterType` function in `workflowEditorUtils.ts`. - Update `WorkflowParameterYAML` to use `unknown` for `default_value`. ---- Generated with ❤️ by [ellipsis.dev](https://www.ellipsis.dev) <!-- ELLIPSIS_HIDDEN -->
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.
👍 Looks good to me! Reviewed everything up to cd11f88 in 39 seconds
More details
- Looked at
566
lines of code in10
files - Skipped
0
files when reviewing. - Skipped posting
3
drafted comments based on config settings.
1. skyvern-frontend/src/routes/workflows/editor/workflowEditorUtils.ts:770
- Draft comment:
ThegetDefaultValueForParameterType
function is redundant as a similar functiondefaultValue
exists inWorkflowRunParameters.tsx
. Consider consolidating these functions to avoid redundancy. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable:
The comment points out a potential redundancy, which is a valid concern for code quality. However, without seeingWorkflowRunParameters.tsx
, I cannot confirm if the functions are indeed redundant. The comment is speculative as it assumes redundancy without strong evidence from the diff itself.
I might be missing the context ofWorkflowRunParameters.tsx
, which could confirm the redundancy. However, the rules state to ignore cross-file issues, and the comment is speculative without strong evidence.
The rules emphasize focusing on the current file and changes. Since the comment is speculative and involves another file, it should be removed.
Remove the comment as it is speculative and involves cross-file issues, which are not to be considered.
2. skyvern-frontend/src/routes/workflows/WorkflowParameterInput.tsx:60
- Draft comment:
Thechecked
variable is unnecessary. TheCheckbox
component can handle the boolean conversion internally. Simplify by directly passingvalue
. - Reason this comment was not posted:
Confidence changes required:50%
Thechecked
variable in theWorkflowParameterInput
component is unnecessary because theCheckbox
component can handle the boolean conversion internally. This can simplify the code.
3. skyvern-frontend/src/routes/workflows/types/workflowYamlTypes.ts:33
- Draft comment:
Thedefault_value
property is now optional. Ensure all code handlingWorkflowParameterYAML
accounts for this to avoid undefined errors. - Reason this comment was not posted:
Confidence changes required:50%
Thedefault_value
property inWorkflowParameterYAML
is now optional, which is a good change to accommodate parameters without default values. However, ensure that all parts of the codebase that handle this type are aware of this change to avoid potential undefined errors.
Workflow ID: wflow_YnChGESvhp2fcK2B
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
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.
👍 Looks good to me! Incremental review on cd11f88 in 41 seconds
More details
- Looked at
566
lines of code in10
files - Skipped
0
files when reviewing. - Skipped posting
3
drafted comments based on config settings.
1. skyvern-frontend/src/routes/workflows/editor/workflowEditorUtils.ts:770
- Draft comment:
Consider adding a default case to handle unexpectedparameterType
values ingetDefaultValueForParameterType
. - Reason this comment was not posted:
Confidence changes required:50%
ThegetDefaultValueForParameterType
function inworkflowEditorUtils.ts
is not handling the case where theparameterType
is not one of the expected values. This could lead to unexpected behavior if an invalidparameterType
is passed.
2. skyvern-frontend/src/routes/workflows/editor/FlowRenderer.tsx:76
- Draft comment:
Consider directly assigningdefault_value: parameter.defaultValue
instead of using the spread operator for better readability. - Reason this comment was not posted:
Confidence changes required:30%
TheconvertToParametersYAML
function inFlowRenderer.tsx
is using a spread operator to conditionally adddefault_value
. This is fine, but it could be more readable by directly assigningdefault_value
toparameter.defaultValue
without the spread operator.
3. skyvern-frontend/src/routes/workflows/WorkflowParameterInput.tsx:57
- Draft comment:
Consider adding validation to ensure the input is a valid number before callingparseInt
orparseFloat
. - Reason this comment was not posted:
Confidence changes required:50%
InWorkflowParameterInput.tsx
, theonChange
handlers forinteger
andfloat
types do not handle invalid inputs gracefully. If the input is not a valid number,parseInt
andparseFloat
will returnNaN
, which might not be the desired behavior.
Workflow ID: wflow_7J2T3JZDIEopNo9s
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
feat: add default value support for workflow parameters
Summary:
Add default value support for workflow parameters with UI updates and JSON parsing.
Key points:
FlowRenderer.tsx
,WorkflowEditor.tsx
,WorkflowParameterAddPanel.tsx
, andWorkflowParameterEditPanel.tsx
.AutoResizingTextarea
for string parameters and addLabel
for boolean parameters inWorkflowParameterInput.tsx
.getDefaultValueForParameterType
function inworkflowEditorUtils.ts
.WorkflowParameterYAML
to useunknown
fordefault_value
.Generated with ❤️ by ellipsis.dev