Visitar URL original
fix: refactor create stages into separate lib by lucasrod16 · Pull Request #2223 · zarf-dev/zarf · GitHub
Skip to content

fix: refactor create stages into separate lib - #2223

Merged
Noxsios merged 217 commits into
mainfrom
2188-refactor-create-stages-into-separate-lib
Mar 13, 2024
Merged

Noxsios merged 217 commits into
mainfrom
2188-refactor-create-stages-into-separate-lib

Conversation

@lucasrod16

@lucasrod16 lucasrod16 commented Jan 11, 2024 •

Copy link
Copy Markdown
Contributor

Description

refactor create stages into separate lib

Related Issue

Fixes #2188

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Other (security config, docs update, etc)

Checklist before merging

Lucas Rodriguez added 2 commits January 10, 2024 18:44
This introduces the Creator interface to be used as the source of truth
for package create operations.
@netlify

netlify Bot commented Jan 11, 2024 •

Copy link
Copy Markdown

✅ Deploy Preview for zarf-docs canceled.

Name Link
🔨 Latest commit a5d3566
🔍 Latest deploy log https://app.netlify.com/sites/zarf-docs/deploys/65f1c765a579880008e2a9d4

Lucas Rodriguez added 27 commits January 10, 2024 19:03
deprecated.MigrateComponent is called in composeComponents
so we should be able to remove this duplicate logic
…om readZarfYAML

The goal here is separation of concerns
Goal here is separation of concerns
Use utils.ReadYaml in place of readZarfYAML
Ensure ReadYaml is passed the correct path
"Normal" packages and skeleton packages require different
loading processes, so using an interface allows us to
have two separate implementations for them.

This makes the load logic easier to reason about and easier to maintain.

Loader is defined in package packager because most of the operations
require direct access to the top-level Packager struct fields.
Create Assembler interface

Creator interface embeds Loader and Assembler interfaces
to allow various create methods to be accessed through a single interface.

Create operations are (and should be) closely coupled to Packager,
so it makes sense to have create functions in the packager package.

Modularity, separation of concerns, library usage, etc can be achieved
through the use of these interfaces while remaining in package packager.
Add CdToBaseDir to Creator interface so that it is grouped
together with other create-specific operations.
Adds a new modifier WithCreator() that is intended to be passed
in as an argument when instantiating a new Packager instance.
Lucas Rodriguez and others added 17 commits March 6, 2024 09:33
Signed-off-by: razzle <harry@razzle.cloud>
Signed-off-by: razzle <harry@razzle.cloud>
Signed-off-by: razzle <harry@razzle.cloud>
Signed-off-by: razzle <harry@razzle.cloud>
Signed-off-by: razzle <harry@razzle.cloud>
Signed-off-by: razzle <harry@razzle.cloud>
Signed-off-by: razzle <harry@razzle.cloud>
Signed-off-by: razzle <harry@razzle.cloud>
Signed-off-by: razzle <harry@razzle.cloud>
Signed-off-by: razzle <harry@razzle.cloud>
@Noxsios Noxsios changed the title chore: refactor create stages into separate lib fix: refactor create stages into separate lib Mar 12, 2024
Noxsios added 3 commits March 13, 2024 09:29
Signed-off-by: razzle <harry@razzle.cloud>
Signed-off-by: razzle <harry@razzle.cloud>
AustinAbro321
AustinAbro321 previously approved these changes Mar 13, 2024

@AustinAbro321 AustinAbro321 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approved with tiny thing

Comment thread src/pkg/packager/deploy.go Resolved
Co-authored-by: Austin Abro <37223396+AustinAbro321@users.noreply.github.com>
@Noxsios
Noxsios merged commit 1ec8849 into main Mar 13, 2024
@Noxsios
Noxsios deleted the 2188-refactor-create-stages-into-separate-lib branch March 13, 2024 16:02
Noxsios pushed a commit that referenced this pull request Mar 19, 2024
…2386)

## Description
Refactoring that took place in
#2223 introduced a bug on
`deploy` where the user is not prompted to view SBOMs. This occurs
because `p.sbomViewFiles` is not being populated correctly. This PR
fixes this issue by populating `p.sbomViewFiles`.

## Related Issue
N/A

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Other (security config, docs update, etc)

## Checklist before merging

- [ ] Test, docs, adr added or updated as needed
- [ ] [Contributor Guide
Steps](https://github.com/defenseunicorns/zarf/blob/main/CONTRIBUTING.md#developer-workflow)
followed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Breakout create stages into separate lib

3 participants