Skip to content

Conversation

@shaohuzhang1
Copy link
Contributor

fix: In the workflow knowledge base, the specified reply node failed to parse the global variable input #4524

@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Dec 17, 2025

Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Details

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-sigs/prow repository.

@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Dec 17, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

globeLabel: `{{global.${item.field}}}`,
globeValue: `{{context['global'].${item.field}}}`,
}))
set(props.nodeModel.properties.config, 'globalFields', fields)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code appears to be setting up fields based on user input, and there are a few points that could improve clarity or functionality:

  1. Type Checking: Use strict type checking where possible. For example:

    type Field = {
      label?: string;
      field: string;
      globeLabel?: string;
    };
    
    const nodeFields = computed(() => {
      return props.nodeModel.properties.user_input_field_list.map((item: any): Field => ({
        label: typeof item.label === 'string' ? item.label : (item.label && item.label.label),
        value: item.field,
        globeLabel: global[item.label]?.label || '',
        globeValue: context.global[item.field] || '',
      }));
    });
  2. Conditional Handling for Globe Label:
    If you want to handle cases where global might not have the field (undefined, etc.), consider using optional chaining.

  3. String Interpolation: The use of mustache syntax {} can sometimes lead to confusion with other interpolation methods if used within template literals. Avoid mixing different formatting styles unless necessary.

  4. Set Function: Ensure this is being called properly and correctly applies changes.

By implementing these improvements, the code becomes more robust, easier to understand, and less prone to runtime errors related to missing properties.

@shaohuzhang1 shaohuzhang1 merged commit 0aef02d into v2 Dec 17, 2025
3 of 6 checks passed
@shaohuzhang1 shaohuzhang1 deleted the pr@v2@fix_workflow branch December 17, 2025 02:44
shaohuzhang1 added a commit that referenced this pull request Dec 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants