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
Fixes #24099: Add a select type for technique parameter #5362
Fixes #24099: Add a select type for technique parameter #5362
Conversation
Commit modified |
b9c00fd
to
63f5371
Compare
case class Constraints( | ||
allowEmptyString: Option[Boolean], | ||
allowWhiteSpaceString: Option[Boolean], | ||
minLength: Option[Int], | ||
maxLength: Option[Int], | ||
regex: Option[String], | ||
notRegex: Option[String], | ||
select: Option[List[String]] | ||
) | ||
|
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.
Technique constraints are different from method constraints, cf. https://docs.rudder.io/techniques/8.1/syntax.html#parameters
Commit modified |
47f46db
to
9515234
Compare
Commit modified |
1 similar comment
Commit modified |
9515234
to
e337a48
Compare
Commit modified |
e337a48
to
1361841
Compare
(I'm not sure where the change comes from though) |
probleme was there: https://github.com/Normation/rudder/pull/5362/files#diff-b3d308fc87b50cacb27b8c7ae19ef5befc0b483b0c4d132b8982a1932fae1ef3R28 |
Commit modified |
1361841
to
39ade54
Compare
Nothing -> [] | ||
Just r -> if Regex.contains r (displayValue call.value) then [ConstraintError { id = call.id, message = ( "Parameter '"++call.id.value++"' start or end with whitespace characters" ) } ] else [] | ||
|
||
checkMax = if lengthValue call.value >= (constraint.maxLength |> Maybe.withDefault 16384) then [ConstraintError { id = call.id, message = ("Parameter '"++call.id.value++"' should be at most " ++ (String.fromInt (constraint.maxLength |> Maybe.withDefault 16384) ) ++ " long" ) } ]else [] |
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.
The default value 16384
should be defined somewhere globally and documented, in DataTypes likelly (it should not be in the middle of a view method)
I belived it should be the same for the name of the constraints, and their respective defaults (and perhaps the standard error message).
Merging this one as is, but the changes will need to be address afterward @VinceMacBuche |
OK, merging this PR |
a2740ca
into
Normation:branches/rudder/8.1
https://issues.rudder.io/issues/24099
This feature adds constraints to technique parameter to generate different metadata.xml with support for different inputs. Everything is already ok rudderc side. we juste need to add it into rudder api and also in technique editor UI