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

⚠ Breaking Change: make components required by default #2059

Open
jeff-mccoy opened this issue Oct 8, 2023 · 3 comments · May be fixed by #2211
Open

⚠ Breaking Change: make components required by default #2059

jeff-mccoy opened this issue Oct 8, 2023 · 3 comments · May be fixed by #2211
Assignees
Labels
breaking-change 💔 enhancement ✨ New feature or request ga Issues tracking toward Zarf 1.0
Milestone

Comments

@jeff-mccoy
Copy link
Member

jeff-mccoy commented 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:

  1. 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 🫠

  2. 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.

  3. Do something more significant like combine various condition-based things such as only, optional (instead of required), default, I would have said group, but... 😆

@jeff-mccoy jeff-mccoy added the enhancement ✨ New feature or request label Oct 8, 2023
@Racer159 Racer159 added the ga Issues tracking toward Zarf 1.0 label Oct 8, 2023
@Racer159 Racer159 added this to the (2023.10.24) milestone Oct 8, 2023
@Racer159
Copy link
Contributor

Racer159 commented Oct 8, 2023

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 Racer159 changed the title Breaking Change: make components required by default ⚠️ Breaking Change: make components required by default Oct 8, 2023
@Racer159 Racer159 changed the title ⚠️ Breaking Change: make components required by default ⚠️ Breaking Change: make components required by default Oct 8, 2023
@Racer159 Racer159 modified the milestones: (2023.10.24), (2023.11.07) Oct 13, 2023
@Racer159
Copy link
Contributor

During this issue we should also reinvestigate default

@Racer159 Racer159 modified the milestones: (2023.11.07), (2023.11.21) Nov 1, 2023
@Racer159 Racer159 modified the milestones: (2023.11.21), (2023.12.05) Nov 16, 2023
@Noxsios Noxsios linked a pull request Jan 2, 2024 that will close this issue
5 tasks
@Racer159 Racer159 modified the milestones: (2024.01.16), (2024.01.30) Jan 3, 2024
@Racer159
Copy link
Contributor

Racer159 commented Jan 3, 2024

Kicking this to past our community meetup.

@eddiezane eddiezane changed the title ⚠️ Breaking Change: make components required by default ⚠ Breaking Change: make components required by default Feb 2, 2024
@Racer159 Racer159 modified the milestones: (2024.02.06), (2024.02.20) Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change 💔 enhancement ✨ New feature or request ga Issues tracking toward Zarf 1.0
Projects
Status: In review
Status: New
Development

Successfully merging a pull request may close this issue.

3 participants