Skip to content
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

bugfix: ignore extra fields in yaml #107

Merged
merged 2 commits into from
Dec 13, 2023

Conversation

letFunny
Copy link
Collaborator

  • Have you signed the CLA?

Ignoring extra fields makes the code forward compatible with changes in the yaml format, without a version bump being necessary.

Ignoring extra fields makes the code forward compatible with changes in
the yaml format, without a version bump being necessary.
Copy link
Member

@rebornplusplus rebornplusplus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Good fix.

@@ -319,7 +319,7 @@ func readSlices(release *Release, baseDir, dirName string) error {

type yamlRelease struct {
Format string `yaml:"format"`
Archives map[string]yamlArchive `yaml:"archives`
Archives map[string]yamlArchive `yaml:"archives"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed.

Copy link
Collaborator

@cjdcordeiro cjdcordeiro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. This also propagates to PathInfo right? (e.g. /path: {badkind: foo})

@cjdcordeiro cjdcordeiro added the Simple Nice for a quick look on a minute or two label Dec 13, 2023
@letFunny
Copy link
Collaborator Author

@cjdcordeiro You are absolutely right, I have added another field in the test to reflect that.

Copy link
Contributor

@niemeyer niemeyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@niemeyer niemeyer merged commit 2266288 into canonical:main Dec 13, 2023
14 checks passed
@letFunny letFunny deleted the ignore-yaml-extra-fields branch December 13, 2023 12:10
@cjdcordeiro
Copy link
Collaborator

@cjdcordeiro You are absolutely right, I have added another field in the test to reflect that.

A bit too late, but also not too urgent: @letFunny if you add a new key under slices, and it is not a map, chisel will fail to unmarshal it into setup.yamlSlice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Simple Nice for a quick look on a minute or two
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants