Skip to content

Conversation

@njnu-seafish
Copy link
Contributor

Purpose of the pull request

close #17942

Brief change log

Add startParams validation logic in both the frontend and backend.

Verify this pull request

This pull request is code cleanup without any test coverage.

(or)

This pull request is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(or)

Pull Request Notice

Pull Request Notice

If your pull request contains incompatible change, you should also add it to docs/docs/en/guide/upgrade/incompatible.md

@SbloodyS SbloodyS added the improvement make more easy to user or prompt friendly label Feb 10, 2026
@SbloodyS SbloodyS added this to the 3.4.1 milestone Feb 10, 2026
Comment on lines +294 to +297
// UI configuration state from form management hook
...startState.startForm,
// Business data injected from modal operations hook
startParamsList: variables.startParamsList
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// UI configuration state from form management hook
...startState.startForm,
// Business data injected from modal operations hook
startParamsList: variables.startParamsList
...startState.startForm,
startParamsList: variables.startParamsList

Comment on lines +87 to +102
// null key
if (StringUtils.isEmpty(param.getProp())) {
throw new ServiceException("Parameter key cannot be empty");
}

String key = param.getProp().trim();
// duplicate keys
if (keys.contains(key)) {
throw new ServiceException("Duplicate parameter key: " + key);
}
keys.add(key);

// IN-type params require a non-empty value
if (Direct.IN.equals(param.getDirect()) && StringUtils.isEmpty(param.getValue())) {
throw new ServiceException("IN parameter value cannot be empty for key: " + key);
}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// null key
if (StringUtils.isEmpty(param.getProp())) {
throw new ServiceException("Parameter key cannot be empty");
}
String key = param.getProp().trim();
// duplicate keys
if (keys.contains(key)) {
throw new ServiceException("Duplicate parameter key: " + key);
}
keys.add(key);
// IN-type params require a non-empty value
if (Direct.IN.equals(param.getDirect()) && StringUtils.isEmpty(param.getValue())) {
throw new ServiceException("IN parameter value cannot be empty for key: " + key);
}
if (StringUtils.isEmpty(param.getProp())) {
throw new ServiceException("Parameter key cannot be empty");
}
String key = param.getProp().trim();
if (keys.contains(key)) {
throw new ServiceException("Duplicate parameter key: " + key);
}
if (Direct.IN.equals(param.getDirect()) && StringUtils.isEmpty(param.getValue())) {
throw new ServiceException("IN parameter value cannot be empty for key: " + key);
}
keys.add(key);

Comment on lines +81 to +83
if (startParamList == null || startParamList.isEmpty()) {
return;
}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if (startParamList == null || startParamList.isEmpty()) {
return;
}
if (CollectionUtils.isEmpty(startParamList)) {
return;
}

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 60%)

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend improvement make more easy to user or prompt friendly UI ui and front end related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Improvement][API] Add null/empty/duplicate validation logic for startParams when manually triggering a workflow

2 participants