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

refactor: normal creator #3114

Merged
merged 3 commits into from
Jan 13, 2025
Merged

refactor: normal creator #3114

merged 3 commits into from
Jan 13, 2025

Conversation

phillebaba
Copy link
Member

@phillebaba phillebaba commented Oct 17, 2024

Description

This change refactors the package creation.

Related Issue

Relates to #2969

Checklist before merging

Copy link

netlify bot commented Oct 17, 2024

Deploy Preview for zarf-docs ready!

Name Link
🔨 Latest commit 8df4a70
🔍 Latest deploy log https://app.netlify.com/sites/zarf-docs/deploys/677fdfeca67c43000854bbcd
😎 Deploy Preview https://deploy-preview-3114--zarf-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@phillebaba phillebaba force-pushed the refactor/creator-normal branch from ae6c1dc to 6dbbc6b Compare October 17, 2024 13:41
Copy link

codecov bot commented Oct 17, 2024

Codecov Report

Attention: Patch coverage is 18.70504% with 1017 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/internal/packager2/layout/create.go 3.83% 445 Missing and 6 partials ⚠️
src/internal/packager2/actions/actions.go 0.00% 223 Missing ⚠️
src/internal/packager2/layout/sbom.go 9.50% 213 Missing and 6 partials ⚠️
src/internal/packager2/create.go 0.00% 40 Missing ⚠️
src/internal/packager2/filters/deploy.go 76.85% 23 Missing and 5 partials ⚠️
src/internal/packager2/layout/package.go 0.00% 28 Missing ⚠️
src/cmd/package.go 0.00% 13 Missing ⚠️
src/internal/packager2/layout/oci.go 0.00% 8 Missing ⚠️
src/internal/packager2/filters/diff.go 84.61% 4 Missing and 2 partials ⚠️
src/internal/packager2/layout/import.go 83.33% 0 Missing and 1 partial ⚠️
Files with missing lines Coverage Δ
src/internal/packager2/filters/empty.go 100.00% <100.00%> (ø)
src/internal/packager2/filters/os.go 100.00% <100.00%> (ø)
src/internal/packager2/filters/select.go 100.00% <100.00%> (ø)
src/internal/packager2/filters/strat.go 100.00% <100.00%> (ø)
src/internal/packager2/filters/utils.go 100.00% <100.00%> (ø)
src/internal/packager2/layout/import.go 14.50% <83.33%> (+0.51%) ⬆️
src/internal/packager2/filters/diff.go 84.61% <84.61%> (ø)
src/internal/packager2/layout/oci.go 22.44% <0.00%> (-0.47%) ⬇️
src/cmd/package.go 0.00% <0.00%> (ø)
src/internal/packager2/filters/deploy.go 76.85% <76.85%> (ø)
... and 5 more

@phillebaba phillebaba force-pushed the refactor/creator-normal branch 7 times, most recently from 47c5dd1 to 5b54240 Compare October 25, 2024 09:00
@phillebaba phillebaba force-pushed the refactor/creator-normal branch 9 times, most recently from cbd05e3 to ca69d35 Compare November 2, 2024 15:49
@phillebaba phillebaba force-pushed the refactor/creator-normal branch 6 times, most recently from 3c36c9d to 4a829c6 Compare November 5, 2024 21:57
@phillebaba phillebaba marked this pull request as ready for review November 5, 2024 21:58
@phillebaba phillebaba requested review from a team as code owners November 5, 2024 21:58
@phillebaba phillebaba force-pushed the refactor/creator-normal branch from 4a829c6 to 8cd0d1c Compare November 5, 2024 22:06
@phillebaba phillebaba force-pushed the refactor/creator-normal branch 3 times, most recently from 60a658b to dcd8b19 Compare November 26, 2024 09:13
@phillebaba phillebaba force-pushed the refactor/creator-normal branch 4 times, most recently from 805199a to 8bf8990 Compare December 3, 2024 17:45
@AustinAbro321
Copy link
Contributor

Generally looks good. I do request that we keep the Package saved to "zarf-init-amd64-v0.43.0.tar.zst" message we have currently.

I know we're trying to limit output for non errors, but I think the package tar path is worth logging since the filename isn't intuitive. It's a combination of whether it's an init or package config, amd or arm64, and the version. As a user I've found it useful to copy + paste the name from terminal when my next step is to publish or deploy, especially when I have multiple packages in the same directory.

@phillebaba phillebaba force-pushed the refactor/creator-normal branch 3 times, most recently from ad7f12a to 49f5112 Compare December 9, 2024 18:51
@phillebaba
Copy link
Member Author

I have now added back the logging for the path the package is saved to.

@phillebaba phillebaba force-pushed the refactor/creator-normal branch 6 times, most recently from 0a14ee3 to d83dc83 Compare January 8, 2025 13:17
Signed-off-by: Philip Laine <[email protected]>
@phillebaba phillebaba force-pushed the refactor/creator-normal branch from d83dc83 to e30e460 Compare January 8, 2025 14:11
Signed-off-by: Philip Laine <[email protected]>
@phillebaba phillebaba force-pushed the refactor/creator-normal branch from 92132d9 to 8df4a70 Compare January 9, 2025 14:40
}
seenImports[importPath] = nil
seenImports = maps.Clone(seenImports)
Copy link
Contributor

Choose a reason for hiding this comment

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

Ah so by using the maps.clone it creates a shallow copy so when the next component in the for loop comes by it doesn't have the sibling branches on it. Very neat!

@phillebaba phillebaba added this pull request to the merge queue Jan 13, 2025
Merged via the queue into main with commit 3eab928 Jan 13, 2025
26 checks passed
@phillebaba phillebaba deleted the refactor/creator-normal branch January 13, 2025 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants