chore: restore config components fallback for zarf init#4613
chore: restore config components fallback for zarf init#4613amirHdev wants to merge 3 commits intozarf-dev:mainfrom
Conversation
- prefer init.components for zarf init component selection - fallback to package.deploy.components when init.components is unset - add e2e regression coverage and docs clarification Signed-off-by: Amirhossein Akhlaghpour <m9.akhlaghpoor@gmail.com>
✅ Deploy Preview for zarf-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report❌ Patch coverage is
🚀 New features to boost your workflow:
|
|
Hey @amirHdev! Thanks for this PR and I appreciate the consideration applied to backwards compatibility. The changes look correct. Overall I don't have a hard opinion but I do feel that the changes we made to remove global state - which resulted in this change in behavior - ultimately provided the distinct separation between init components and package deploy components. Given our push to refine the v1.0.0 and intentionally looking for logic to cleanup - I am unsure if we would want this backwards-compatibility in perpetuity. Have you seen this negatively impacting many users for which they did not have control over correcting their |
Summary
Fixes
zarf initcomponent selection from config files by adding a backward-compatible fallback.zarf initnow resolves components in this order:init.components(preferred)package.deploy.components(fallback wheninit.componentsis unset)This addresses #4439 where users with existing
zarf-config.yamlfiles usingpackage.deploy.componentssaw components ignored duringzarf init --confirm.Changes
src/cmd/initialize.gosrc/test/e2e/29_config_file_test.goinit.componentsvspackage.deploy.componentsand fallback:site/src/content/docs/ref/config-files.mdxWhy
Historically, some users relied on
package.deploy.componentsforzarf init.This change keeps
init.componentsas the intended key while preventing breakage for existing configs.Testing
TestInitComponentsConfigFallbackpackage.deploy.componentsinit.componentstakes precedence when both are setIssue