Repository navigation
packagesets: add basic imagetype yaml to merge pkgSets - #1298
Conversation
cfacd62 to
3bfac4c
Compare
achilleas-k
left a comment
There was a problem hiding this comment.
We discussed this a bit offline but I'd like to repeat my thoughts here for posterity.
I like this! At first I was a bit hesitant about using too many yaml features, but I think it makes sense. It means we don't have to have obscure code constructs and internal rules for merging sets and if people want to define their sets without using all the references and fancy merging they can just write straight-up plain yaml without any of this and without needing to think about how it might interact with our internals.
supakeen
left a comment
There was a problem hiding this comment.
Yep, this is definitely the winner in my book. As close to "standards" as one can get with YAML I guess? :)
3bfac4c to
a1ef5b7
Compare
|
Thanks! I had to rebase because of conflicts but this should be good (again) now. |
ondrejbudai
left a comment
There was a problem hiding this comment.
I love it! Feels very straightforward. :)
This commit adds a basic imagetype yaml to support merging
of package sets This is a useful feature so that we can e.g.
avoid duplicating the `cloud_base` or `anaconda` package sets.
It works by adding new toplevels "image_types" in the
package_sets.yaml and then using anchors/refs to refer to
them in the image_type yaml. To allow sharing yaml that is
not part of an image_type it also introduces a top-level
`.common` that can have `any` yaml in it.
It allows us to write:
```yaml
.common:
base: &base_pkgset
include: [from-base-inc]
exclude: [from-base-exc]
condition:
distro_name:
test-distro:
include: [from-base-condition-inc]
exclude: [from-base-condition-exc]
image_types:
other_type:
package_sets:
- &other_type_pkgset
include: [from-other-type-inc]
exclude: [from-other-type-exc]
test_type:
package_sets:
- *base_pkgset
- *other_type_pkgset
- include: [from-type-inc]
exclude: [from-type-exc]
condition:
distro_name:
test-distro:
include: [from-condition-inc]
exclude: [from-condition-exc]
```
The downside of this approach is that:
1. it requires the anchor to be there before the ref, which can
be confusing (we could solve this later via includes)
2. if the anchor is forgotten the error becomes very obscure
3. its a bit "hardcore" yaml
The upside is that it is very symetrical and actually feels quite
nice.
a1ef5b7 to
64e27d4
Compare
|
Thanks! I had to rebase again because of conflicts - sorry for that (there was a bit of a backlog in this area but this should be the last rebase) |
[this is my personal winner in the race for best-yaml-for-shareing-pkgsets, based on a new idea of @ondrejbudai (thanks!), see also https://github.com//pull/1294 and https://github.com//pull/1296 and https://github.com//pull/1295]
This commit adds a basic imagetype yaml to support merging of package sets This is a useful feature so that we can e.g. avoid duplicating the
cloud_baseoranacondapackage sets.It works by adding new toplevels "image_types" in the package_sets.yaml and then using anchors/refs to refer to them in the image_type yaml. To allow sharing yaml that is not part of an image_type it also introduces a top-level
.commonthat can haveanyyaml in it.It allows us to write:
The downside of this approach is that:
The upside is that it is very symetrical and actually feels quite nice.