-
Notifications
You must be signed in to change notification settings - Fork 29
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
chore: add requirement validation #1559
Conversation
Signed-off-by: Jose I. Paris <jiparis@chainloop.dev>
Signed-off-by: Jose I. Paris <jiparis@chainloop.dev>
repeated string requirements = 6; | ||
repeated string requirements = 6 [(buf.validate.field).repeated.items = { | ||
string: { | ||
pattern: "^[^\\s@]+(@[^\\s@]+)?$", // whitespaces not allowed, lock is optional (@) |
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.
I know that I said we should force it but now I am wondering if we should be lax by default as you did. What do you think?
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.
Yes, but at least I would force the @
for the version separator (or /
, or :
, anything), as we do in other places
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.
I've updated the rule to have a mandatory requirement prefix for grouping them into frameworks, groups, or similar. myframework/myrequirement@version
Signed-off-by: Jose I. Paris <jiparis@chainloop.dev>
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.
thanks
This PR adds some validation to the requirement IDs, allowing only non space characters an 1
@
only to split versions.Closes #1558