Use ML Commons validation methods in workflow parsing#1368
Merged
dbwiddis merged 6 commits intoMay 8, 2026
Merged
Conversation
dbwiddis
added a commit
to dbwiddis/flow-framework
that referenced
this pull request
Apr 21, 2026
Signed-off-by: Dan Widdis <widdisd@amazon.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1368 +/- ##
============================================
+ Coverage 78.38% 78.56% +0.17%
- Complexity 1308 1315 +7
============================================
Files 106 106
Lines 6019 6041 +22
Branches 641 647 +6
============================================
+ Hits 4718 4746 +28
+ Misses 1012 1004 -8
- Partials 289 291 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Adds field value validation during workflow template validation using ML Commons StringUtils.validateFields(). When validation=all is set, name and description fields in ML Commons steps (create_connector, register_remote_model, register_local_custom_model, register_local_sparse_encoding_model, register_local_pretrained_model, register_model_group) are now checked for safe characters before provisioning. Resolves opensearch-project#1152 Signed-off-by: Dan Widdis <widdisd@amazon.com>
Signed-off-by: Dan Widdis <widdisd@amazon.com>
Signed-off-by: Dan Widdis <widdisd@amazon.com>
522f71d to
97ab0dc
Compare
Signed-off-by: Daniel Widdis <widdis@gmail.com>
owaiskazi19
approved these changes
May 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Resolves #1152.
Adds field value validation during workflow template validation (
validation=all) using ML CommonsStringUtils.validateFields(). This catches invalid characters innameanddescriptionfields at parse time rather than waiting for runtime provisioning failures.Validated steps
The following ML Commons steps now have name/description validated during workflow parsing, matching the validation added in ml-commons#3805:
name(required)description(optional)create_connectorregister_remote_modelregister_local_custom_modelregister_local_sparse_encoding_modelregister_local_pretrained_modelregister_model_groupChanges
WorkflowProcessSorter.java: AddedvalidateFieldValues()method called fromvalidate(). UsesStringUtils.validateFields()andFieldDescriptorfrom ML Commons directly — no duplicated validation logic.WorkflowProcessSorterTests.java: Added 4 tests covering valid inputs, invalid name, invalid description, and non-ML step passthrough.Design decisions
previous_node_inputs(runtime references) are not validated at parse time.${{name}}) are also not validated, as these are resolved at provisioning time with user-supplied values.FieldDescriptorrequired/optional semantics as ML Commons:nameis required,descriptionis optional.How to test
Check List
--signoff.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.