-
Notifications
You must be signed in to change notification settings - Fork 199
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 yaml <-> json roundtrip #1482
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I had a bug report for problems parsing a --yes flag as a bool instead of a string, causing the flag to be passed as --true. install: - exec: description: "use a yes flag" command: az arguments: - something flags: yes: "" This is fixed in v3 of the yaml package, becauase it uses a newer version of yaml that doesn't interpret yes/no as boolean keys. This version bump does change the indentation strategy of serializing to yaml but other than impacting our test strings, it's still valid yaml, just uses more spaces. Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
* null keys should marhsal as "null" * null values should marshal as nil/null Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
vdice
approved these changes
Mar 4, 2021
pkg/exec/builder/action.go
Outdated
@@ -6,8 +6,10 @@ import ( | |||
"io/ioutil" | |||
|
|||
"get.porter.sh/porter/pkg/context" | |||
//"get.porter.sh/porter/pkg/yaml" |
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.
Looks like this line can be removed?
Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
joshuabezaleel
pushed a commit
to joshuabezaleel/porter
that referenced
this pull request
Mar 14, 2021
* Upgrade to gopkg.in/yaml.v3 I had a bug report for problems parsing a --yes flag as a bool instead of a string, causing the flag to be passed as --true. install: - exec: description: "use a yes flag" command: az arguments: - something flags: yes: "" This is fixed in v3 of the yaml package, becauase it uses a newer version of yaml that doesn't interpret yes/no as boolean keys. This version bump does change the indentation strategy of serializing to yaml but other than impacting our test strings, it's still valid yaml, just uses more spaces. Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com> * Fix yaml <-> json roundtrip for null * null keys should marhsal as "null" * null values should marshal as nil/null Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com> * Remove unused import Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this change
I had a bug report for problems parsing a --yes flag as a bool instead of a string, causing the flag to be passed as --true.
This is fixed in v3 of the yaml package, becauase it uses a newer version of yaml that doesn't interpret yes/no as boolean keys.
This version bump does change the indentation strategy of serializing to yaml but other than impacting our test strings, it's still valid yaml, just uses more spaces.
What issue does it fix
Fixes #1483 where null wasn't being handled properly and other reports of roundtrip problem between yaml to json.
Notes for the reviewer
I'm not sure if using v3 gives us any other capabilities. We were actually using it already in one of our packages because of it's node manipulation. This just has us use the same version everywhere.
Checklist