-
Notifications
You must be signed in to change notification settings - Fork 28
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
fix(compiler)!: webhook payload containing message with special characters causes failure #793
fix(compiler)!: webhook payload containing message with special characters causes failure #793
Conversation
Use the implementation made upstream in drone/envsubst#27 to fix escape sequence handling to prevent yaml parsing to fail due to invalid escape sequences. Issue: go-vela/community#702
go.mod
Outdated
@@ -53,6 +53,7 @@ require ( | |||
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect | |||
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect | |||
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect | |||
github.com/drone/envsubst v1.0.3 // indirect |
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.
This is an indirect dependency
❯ go mod why github.com/drone/envsubst
# github.com/drone/envsubst
github.com/go-vela/server/api
github.com/go-vela/types/pipeline
github.com/drone/envsubst
Going to update this dependency in types/pipeline
as well
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.
PR to update types/pipeline
go-vela/types#284
Codecov Report
@@ Coverage Diff @@
## main #793 +/- ##
=======================================
Coverage 57.73% 57.73%
=======================================
Files 263 263
Lines 15911 15911
=======================================
Hits 9187 9187
Misses 6310 6310
Partials 414 414
|
"full-review" failed due to other lint checks done by golangci-lint |
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.
LGTM
looks great, thanks @NickHackman :D im excited for the fix, so i'd say admins should be watchful on rolling this change out, and also should mark this as a breaking change in the PR and in the release notes. |
@plyr4 good call out, this would impact users who have tried to hack around the issue in the first place. Hopefully that's a very small subset of users who need remediation here |
with further testing theres a bit more to the issue at large
@NickHackman Hi Nick! Thanks for the PR. I pulled down both the changes in this PR as well as your changes in the types PR. I had a few buggy payloads to test, and it does indeed look like the escape character error is resolved, however some new YAML parser error arose, such as |
@ecrupper Awesome, fire away with examples here. I assume any issue we face is coming from the upstream library. I'll do my best to patch things if we can get cases that fail. Ideally these issues are all fixed in the upstream library. Vela shouldn't need to patch it, but whatever is seen as best |
PR: go-vela/server#793 Issue: go-vela/community#702 Co-authored-by: Jacob Floyd <cognifloyd@gmail.com> Co-authored-by: Easton Crupper <65553218+ecrupper@users.noreply.github.com>
Will update the original issue with anything else we find related to compiler errors from weird character sequences. For now, we know this fixes a few things and doesn't break anything from what we can tell. Merging! Thanks again @NickHackman ! |
Use the implementation made upstream in drone/envsubst#27 to fix escape sequence handling to prevent yaml parsing to fail due to invalid escape sequences.
Issue: go-vela/community#702