-
Notifications
You must be signed in to change notification settings - Fork 146
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
Upgrade to yaml.v3 #347
Upgrade to yaml.v3 #347
Conversation
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.
When I run ghcp expand
on the PR branch and use the spack-gromacs example, I get output that looks like:
blueprint_name: spack-gromacs
validators:
- validator: test_project_exists
inputs:
project_id: ((var.project_id))
...
vars:
deployment_name: spack-gromacs
labels:
ghpc_blueprint: spack-gromacs
ghpc_deployment: spack-gromacs
project_id: toolkit-demo-zero-e913
region: us-central1
zone: us-central1-c
Lists are indented by 4 characters and, for some reason, the labels map is also. Other maps are indented by 2 characters.
The status quo looks like this
blueprint_name: spack-gromacs
validators:
- validator: test_project_exists
inputs:
project_id: ((var.project_id))
- validator: test_region_exists
inputs:
project_id: ((var.project_id))
region: ((var.region))
- validator: test_zone_exists
inputs:
project_id: ((var.project_id))
zone: ((var.zone))
- validator: test_zone_in_region
inputs:
project_id: ((var.project_id))
region: ((var.region))
zone: ((var.zone))
vars:
deployment_name: spack-gromacs
labels:
ghpc_blueprint: spack-gromacs
ghpc_deployment: spack-gromacs
project_id: toolkit-demo-zero-e913
region: us-central1
zone: us-central1-c
I believe a few paths are reasonable from here:
ghpc expand
should produce a "diff-less" YAML file compared to status quoghpc expand
should produce something that passes our linting tests- we should alter the behavior of
ghpc expand
to something we can defend (and linting tests should be modified to match)
Since the full checks passed, I don't think they need to be re-run if you address the "superficial" concerns in the review. |
First note, that the diff is less noticeable now that indent has been set to 2. Also description has been updated. From offline discussion:
FYI @tpdownes |
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.
The final result passes yamllint
in its default configuration, rather than ours which mimics common patterns seen in the wild. I am happy enough with that outcome subject to all the upstream library problems you note.
The
UnmarshalStrict
api is no longer available in v3 but the same functionality is supported using aDecoder
withKnownFields(true)
set.Changes from
map[interface{}]interface{}
tomap[string]interface{}
were required to avoid panic. It seems that the decoder is providing more explicit type information for deeply nested values.New behavior on marshaling introduces additional white space in listed items (starting with
-
). This means thatexpanded.yaml
files generated usingexpand
have different formatting after this change. There is a good summary here.Tested:
community/examples/spack-gromacs.yaml
and observed diff (whitespace changes only)Submission Checklist
pre-commit install
)make tests
)