You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 optional optional key, which would default to false. I do think this still feels strange if you did something like optional: false.
Do something more significant like combine various condition-based things such as only, optional (instead of required), default, I would have said group, but... 😆
The text was updated successfully, but these errors were encountered:
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 (rather than just a warning) to make it very clear that action needed to be taken by the package creator to make sure that their package worked correctly going forward...
Racer159
changed the title
Breaking Change: make components required by default
⚠️ Breaking Change: make components required by default
Oct 8, 2023
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: