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
⚠ Breaking Change: make components required
by default
#2059
Comments
I personally think 2 would be the most clean and while a biggish change is something we could handle with the deprecated version-handling code that we have (at least for previously built packages/skeletons). For future to-be-built packages we would probably want to return an error if we saw |
required
by default
During this issue we should also reinvestigate |
Kicking this to past our community meetup. |
required
by defaultrequired
by default
Currently, all Zarf components default to being optional due to the
required
key being optional in the yaml. This leads to behaviors where a package author must ensure they are careful to annotate this key for each component--though the validation doesn't require them to so assumes a sort of "all things are optional" default state.When Zarf was first created, we didn't really know how it would evolve and this key was introduced in those very early days. I think at this point it would be better to require all components by default--especially with the introduction of composability and the OCI skeleton work, there is plenty of flexibility in the API to compose bespoke packages assembled from other packages.
I see a few ways we could handle this:
Simply force the
required
key to be a non-optional, so that package authors would be forced to specify it for each component, thereby removing any ambiguity--but also force one more key for every single component every created 🫠Deprecate
required
and introduce an optionaloptional
key, which would default to false. I do think this still feels strange if you did something likeoptional: false
.Do something more significant like combine various condition-based things such as
only
,optional
(instead ofrequired
),default
, I would have saidgroup
, but... 😆The text was updated successfully, but these errors were encountered: