Skip to content
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 STRING input validator #1123

Merged
merged 3 commits into from
Apr 25, 2023
Merged

Conversation

yuri1969
Copy link
Contributor

@yuri1969 yuri1969 commented Apr 2, 2023

This PR adds a regex-based validation for the STRING inputs. The pattern is defined by input's newly added validator property.

inputs:
  - name: my-upper-case-value
    type: STRING
    validator: [A-Z]+

This PR deals with the STRING inputs only since these are frequent & variable.

Naming, etc. should be reviewed to fit in.

close #1122

@loicmathieu
Copy link
Member

@yuri1969 thanks for your PR.

I update it to allow more flexible validation by allowing to validate all input types with differents validation properties and enabling the UI to be aware of this validation.
This is a first step as only String are validated for now but we forsee validating more types (for ex number with minand max properties) and the UI part is not yet done.

@yuri1969
Copy link
Contributor Author

yuri1969 commented Apr 5, 2023

@loicmathieu Great, adding type-specific validation implementations should be easy now.

@loicmathieu
Copy link
Member

I rebased the branch onto master as there was a strange test error.

We will discuss internally if we merge this one as is or if we take the opportunity to add more constraints.

Copy link
Member

@tchiotludo tchiotludo left a comment

Choose a reason for hiding this comment

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

Minor change for seems to be good stuff anyway and there is missing change on webserver unit test

@loicmathieu loicmathieu force-pushed the validate-inputs branch 2 times, most recently from 48b3504 to e1b5255 Compare April 6, 2023 09:17
@loicmathieu loicmathieu requested a review from tchiotludo April 6, 2023 09:54
@tchiotludo tchiotludo force-pushed the develop branch 13 times, most recently from 41e0ce3 to 5b28dc1 Compare April 23, 2023 12:19
@loicmathieu loicmathieu merged commit b276525 into kestra-io:develop Apr 25, 2023
@loicmathieu
Copy link
Member

@yuri1969 thanks a lot for your contribution, it is now merged and will be included in Kestra 0.9.0 !

I created two issue to continue on the subject to have a complete input validation in Kestra.

@yuri1969 yuri1969 deleted the validate-inputs branch April 26, 2023 06:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a basic validation of flow inputs
3 participants