-
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
Backslash quote in json will crash the trigger parser #777
Comments
/kind bug |
@chmouel what version of Triggers are you running? |
@dibyom |
Error in v0.8.1
|
yeah looks like the error is while creating the resource, the actual extraction in binding seems to work. specifically here: https://github.com/tektoncd/triggers/blob/master/pkg/resources/create.go#L69 |
I was looking at #772 and it looks like the same issue. I think this is happening because we are doing some overly simplistic escaping here: https://github.com/tektoncd/triggers/blob/v0.8.1/pkg/template/resource.go#L117 (related #257 ) @khrm let me know if your findings are similar! |
Yes, it looks similar. I reached the same conclusion just now. In this case, that escaping breaks the body. |
Strangely enough, if I set a param directly with backlash, it works but if that arrives from an event body, it doesn't. Will look into this day after tomorrow. |
Discussed at yesterday's (2020-10-27) Triggers call, to be able to drop the quoting of strings, we need to allow folks to retain the behaviour for at least a minor release or two, adding an annotation to TriggerTemplates that require the previous behaviour feels like the best option. Simply, the issue is caused by quoting strings that are being inserted at unknown positions in a byte slice, short of introducing a way to indicate that we want a specific replacement to be quoted, we have no context for the replacement (to know if it should be quoted or not). |
On a git repo which is plugged to a triggers, i have made a standard git revert of a commit to submit to a PR.
The title of git revert would look like this :
This will shows up like this in the webhook json payload :
but this title will crash trigger's parser :
Changing the title and removing the quote made triggers accepting the json payload and go on with its life...
/label bug
The text was updated successfully, but these errors were encountered: