-
Notifications
You must be signed in to change notification settings - Fork 420
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
Provide error for invalid bindings #1049
Provide error for invalid bindings #1049
Conversation
The following is the coverage report on the affected files.
|
Looks like build test is failing with:
|
So, this happens at processing time, but I wonder if we want to change this to a validation error? It might be an issue in existing installs, but an error at triggerbinding creation time might make more sense than during the HTTP request. |
53aad97
to
3d385f0
Compare
The following is the coverage report on the affected files.
|
Agreed. That makes more sense. |
3d385f0
to
daac875
Compare
Updated tests and Validation function (as well as validation error messages). The HTTP request processing remains completely the same, we will just reject binding values that have nested tekton expressions within them. |
The following is the coverage report on the affected files.
|
daac875
to
633476f
Compare
This eliminates the concern about nested Tekton expressions that could possibly be parsed in sink processing.
633476f
to
3e2476d
Compare
terminated := true | ||
for _, e := range maybeExpressions[1:] { // Split always returns at least one element | ||
// Iterate until we find the first unbalanced ) | ||
numOpenBrackets := 0 |
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.
question: is it possible to reuse this bit from the jsonpath.go? Maybe this bit could be extracted to its own function? If that's too much for this PR, I'm happy to merge this as is.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dibyom The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/lgtm |
Changes
TriggerBinding values do not yet have any validation on their values, but we have situations, as
discussed in #385, where the binding value is somewhat nonsensical. In templates, it is possible that
a nesting situation may take place within a TaskRun script, but for a binding parameter value it makes
sense to avoid these types of situations.
This PR currently only avoids the situations where expressions are directly nested, meaning
dollar-parens immediately followed by dollar-parens. This would not detect a situation where they are
separated by some characters
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
See the contribution guide for more details.
Release Notes