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

#208. Basic Composability #351

Merged
merged 12 commits into from
Mar 10, 2022
Merged

#208. Basic Composability #351

merged 12 commits into from
Mar 10, 2022

Conversation

mike-winberry
Copy link
Contributor

No description provided.

…e private config. package/create.Create: Add logic to expand locally imported components within the parent build config. types: Add Import field to Zarf.Component as expirement (expected to change).
@mike-winberry mike-winberry self-assigned this Feb 25, 2022
@mike-winberry mike-winberry linked an issue Feb 25, 2022 that may be closed by this pull request
7 tasks
@jeff-mccoy jeff-mccoy added enhancement ✨ New feature or request packager needs-docs PR Label - Docs required to merge labels Feb 27, 2022
…ponents and nested import components. UPDATE types.go: Added ZarfImport type with a path variable as the associated type with ZarfComponent.Import field (this sets up sha verification additions in the future, still need team imput). UPDATE Packager/Common.go: pulled confirming optional component logic out of getValidComponents to play with composed package validation (need to validate expected behavior). UPDATE Packager/Create.go: Replaced the initial compose logic with call to GetComposedAssets(). ADD examples/compose-example: a simple composition example for explicit example.
mike-winberry referenced this pull request Feb 28, 2022
…ponents and nested import components. UPDATE types.go: Added ZarfImport type with a path variable as the associated type with ZarfComponent.Import field (this sets up sha verification additions in the future, still need team imput). UPDATE Packager/Common.go: pulled confirming optional component logic out of getValidComponents to play with composed package validation (need to validate expected behavior). UPDATE Packager/Create.go: Replaced the initial compose logic with call to GetComposedAssets(). ADD examples/compose-example: a simple composition example for explicit example.
Copy link
Contributor

@jeff-mccoy jeff-mccoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will need to go back and look more closely at the compose.go, but here are some quick thoughts.

cli/internal/packager/create.go Outdated Show resolved Hide resolved
cli/config/config.go Outdated Show resolved Hide resolved
cli/types/types.go Show resolved Hide resolved
@jeff-mccoy jeff-mccoy added the needs-tests PR Label - Tests required to merge label Mar 1, 2022
…er needed. UPDATE packager/compose: removed the logic working with SeedImages as it is not necessary for composition. UPDATE packager/create.go: seperate the GetComposedAssets call from the seed images. Set seedImages variable using the config.GetSeedImages() method.
…he composed packages flux and games are properly deployed together. UPDATE examples/Makefile with the package-example-composability command and added that command to the package-examples command. RENAME examples/composable-example -> examples/composable-packages
…ethod for use with compose.go. UPDATE packager/compose: add the hasValidSubPackage method and replaced the hasSubPackage calls. Updated the hasSubPackage method to validate only that the Component.Import field exists. Clean up index names in prepComponentToCompose.
mike-winberry added a commit that referenced this pull request Mar 1, 2022
…ethod for use with compose.go. UPDATE packager/compose: add the hasValidSubPackage method and replaced the hasSubPackage calls. Updated the hasSubPackage method to validate only that the Component.Import field exists. Clean up index names in prepComponentToCompose.
…ackages. ADD examples/composable-packages/README: with instructions on running doom using composition from the games example zarf.yaml. UPDATE examples/composable-packages/zarf.yaml: removed the flux package as the game is a more clear example and still shows the same composability without the need of flux since the games package does not rely on flux
mike-winberry added a commit that referenced this pull request Mar 2, 2022
…ackages. ADD examples/composable-packages/README: with instructions on running doom using composition from the games example zarf.yaml. UPDATE examples/composable-packages/zarf.yaml: removed the flux package as the game is a more clear example and still shows the same composability without the need of flux since the games package does not rely on flux
@mike-winberry mike-winberry added needs-docs PR Label - Docs required to merge needs-tests PR Label - Tests required to merge and removed needs-docs PR Label - Docs required to merge needs-tests PR Label - Tests required to merge labels Mar 2, 2022
…ge method when pulling in imported components. Updated shouldAddImportedPackage method to no longer prompt if --confirm flag is passed
mike-winberry added a commit that referenced this pull request Mar 2, 2022
…ge method when pulling in imported components. Updated shouldAddImportedPackage method to no longer prompt if --confirm flag is passed
…sed package when the user chooses to not import that composed packages.
mike-winberry added a commit that referenced this pull request Mar 3, 2022
…sed package when the user chooses to not import that composed packages.
… due to remove of flux composed component in the composability example.
@mike-winberry mike-winberry changed the title DRAFT: #208. Basic Composability #208. Basic Composability Mar 3, 2022
@mike-winberry
Copy link
Contributor Author

/test all

@mike-winberry
Copy link
Contributor Author

Ready for review.

test/e2e/e2e_composability_test.go Show resolved Hide resolved
cli/internal/packager/compose.go Outdated Show resolved Hide resolved
@mike-winberry
Copy link
Contributor Author

Ready for review and merge.

@jeff-mccoy jeff-mccoy added this to the Zarf GA milestone Mar 8, 2022
YrrepNoj
YrrepNoj previously approved these changes Mar 8, 2022
Copy link
Contributor

@YrrepNoj YrrepNoj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the way you're doing the 'validateOrBail(..)'. I think that's a good pattern we should use in the future.

@mike-winberry mike-winberry force-pushed the 208-basic-composibility branch from 5f1cea0 to 05f97a8 Compare March 9, 2022 15:49
@mike-winberry mike-winberry force-pushed the 208-basic-composibility branch 2 times, most recently from 52cf424 to bce3f34 Compare March 9, 2022 16:25
@mike-winberry mike-winberry force-pushed the 208-basic-composibility branch from bce3f34 to fc0aea3 Compare March 9, 2022 16:36
@mike-winberry mike-winberry force-pushed the 208-basic-composibility branch from fc0aea3 to 01a7b22 Compare March 9, 2022 16:46
…s. Update .github/workflows/test*: add package-compose-example to make packages stage. UPDATE packager/compose: rename GetComposedAssets to GetComposedComponents UPDATE reference in packager/create. refactored and rename hasValidSubPackage to validateOrBail. Rename shouldAddImportedPackage to shouldComposePackage. Extracted component required logic to componentConfirmedForInclusion. UPDATE e2e/e2e_composability_test: to work with new testing strategy.
@mike-winberry
Copy link
Contributor Author

I need another review and approval on this. I needed to sign my old commits. Bad news I lost three commits. Good news I learned how to not have this happen again and how to properly sign an old commit if it somehow does happen again. I replaced the lost commits in the most recent single commit and all tests are passing again. Thanks!

@mike-winberry mike-winberry merged commit c999236 into master Mar 10, 2022
@mike-winberry mike-winberry deleted the 208-basic-composibility branch March 10, 2022 19:28
Noxsios pushed a commit that referenced this pull request Mar 8, 2023
* #208. config: Add SetComponents method to update the components in the private config. package/create.Create: Add logic to expand locally imported components within the parent build config. types: Add Import field to Zarf.Component as expirement (expected to change).

* #208. ADD packager/compose.go: Created compose logic for imported components and nested import components. UPDATE types.go: Added ZarfImport type with a path variable as the associated type with ZarfComponent.Import field (this sets up sha verification additions in the future, still need team imput). UPDATE Packager/Common.go: pulled confirming optional component logic out of getValidComponents to play with composed package validation (need to validate expected behavior). UPDATE Packager/Create.go: Replaced the initial compose logic with call to GetComposedAssets(). ADD examples/compose-example: a simple composition example for explicit example.

* #208. UPDATE cli/config: Delete SetSeedImages method as it is no longer needed. UPDATE packager/compose: removed the logic working with SeedImages as it is not necessary for composition. UPDATE packager/create.go: seperate the GetComposedAssets call from the seed images. Set seedImages variable using the config.GetSeedImages() method.

* #208. ADD e2e_composability_test: set up basic tests to ensure that the composed packages flux and games are properly deployed together. UPDATE examples/Makefile with the package-example-composability command and added that command to the package-examples command. RENAME examples/composable-example -> examples/composable-packages

* #208, #351. UPDATE packager/validate: add the ValidateImportPackage method for use with compose.go. UPDATE packager/compose: add the hasValidSubPackage method and replaced the hasSubPackage calls. Updated the hasSubPackage method to validate only that the Component.Import field exists. Clean up index names in prepComponentToCompose.

* #208, #351. UPDATE docer/components: Added new section on composing packages. ADD examples/composable-packages/README: with instructions on running doom using composition from the games example zarf.yaml. UPDATE examples/composable-packages/zarf.yaml: removed the flux package as the game is a more clear example and still shows the same composability without the need of flux since the games package does not rely on flux

* #208, #351. UPDATE packager/compose: added the shouldAddImportedPackage method when pulling in imported components. Updated shouldAddImportedPackage method to no longer prompt if --confirm flag is passed

* #208, #351. FIX packager/compose: to no longer add the optional composed package when the user chooses to not import that composed packages.

* #208. UPDATE e2e_composability_test: removed the tests verifying flux due to remove of flux composed component in the composability example.

* #208, #351. UPDATE Makefile: add package-example-compose for e2e tests. Update .github/workflows/test*: add package-compose-example to make packages stage. UPDATE packager/compose: rename GetComposedAssets to GetComposedComponents UPDATE reference in packager/create. refactored and rename hasValidSubPackage to validateOrBail. Rename shouldAddImportedPackage to shouldComposePackage. Extracted component required logic to componentConfirmedForInclusion. UPDATE e2e/e2e_composability_test: to work with new testing strategy.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ✨ New feature or request needs-docs PR Label - Docs required to merge needs-tests PR Label - Tests required to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Basic composability, starting with Flux
3 participants