Skip to content

Conversation

a1994sc
Copy link
Contributor

@a1994sc a1994sc commented Aug 8, 2025

Description

This adds the flavor to the file name, when pulling a package.

zarf package pull oci://ghcr.io/defenseunicorns/packages/uds/renovate:41.57.1-uds.0-upstream

will now create a file like the following:

zarf-package-renovate-amd64-upstream-41.57.1-uds.0.tar.zst

instead of

zarf-package-renovate-amd64-41.57.1-uds.0.tar.zst

Other changes

Added logic that includes the .metadata.name in the file name when pulling an init package, whose name is not init

zarf package pull --skip-signature-validation oci://ghcr.io/colonel-byte/zarf-init-slim:v0.60.0-upstream

will now create a file like the following:

zarf-init-zarf-init-slim-amd64-upstream-v0.60.0.tar.zst

instead of

zarf-init-amd64-upstream-v0.60.0.tar.zst

I can remove this logic as it is not directly related to the below ticket

Related Issue

Fixes #3881

Checklist before merging

Signed-off-by: Allen Conlon <software@conlon.dev>
@a1994sc a1994sc marked this pull request as ready for review August 8, 2025 22:00
Copy link

netlify bot commented Aug 8, 2025

Deploy Preview for zarf-docs ready!

Name Link
🔨 Latest commit a93e6c9
🔍 Latest deploy log https://app.netlify.com/projects/zarf-docs/deploys/68a38bd430b3c60008cf9760
😎 Deploy Preview https://deploy-preview-4063--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 project configuration.

@a1994sc a1994sc requested review from a team as code owners August 8, 2025 22:00
@AustinAbro321
Copy link
Contributor

The biggest thing to consider here are workflows that automatically create + push or pull + deploy. This change would break those workflows. That said, I do like this change, and it should be fairly easy for users to figure out what the issue is in their automation. Still, I'd like to here thoughts from other members of @zarf-dev/maintainers.

Copy link

codecov bot commented Aug 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
src/pkg/packager/layout/package.go 45.68% <100.00%> (+1.68%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@a1994sc
Copy link
Contributor Author

a1994sc commented Aug 11, 2025

It could be a feature flag, that Kit added recently, fancy-names, and then work it in as the default?

@AustinAbro321
Copy link
Contributor

AustinAbro321 commented Aug 11, 2025

While that is an option, I'd rather avoid it. Feature flags have to be documented, maintained, and deprecated. Thinking about the user flows, I'm not sure the better name is convenient enough for me to make sure I have the flag set. Similarly, if I ran into the problem I wouldn't want to disable the feature flag, I'd rather use the new name for my package.

@mkcp
Copy link
Contributor

mkcp commented Aug 13, 2025

IMO this is a good change for us to make. Two of the same package with different flavors do not necessarily have the same behavior (if so why use a flavor?) so being able to tell which is which and not having them collide on disk feels intuitive. There's lots of breaking changes to consider, many that we may not expect, so as much community feedback as possible on this change is crucial.

Regarding feature flagging it, it would add some amount of safety to making the change where users could undo it. I don't see a lot of value in having it disabled by default to start though. This doesn't necessarily enable new workflows, so keeping it disabled wouldn't get us necessary feedback. This is a good nudge for me to get features into beta with the appropriate website docs and cli support for viewing all flags though!

@a1994sc
Copy link
Contributor Author

a1994sc commented Aug 13, 2025

Two of the same package with different flavors do not necessarily have the same behavior (if so why use a flavor?) so being able to tell which is which and not having them collide on disk feels intuitive.

This is true.... To use the original parent of Zarf, Defense Unicorn, they have two-three flavors, upstream, registry1, and unicorn, where the difference is just the source of the images.

There's lots of breaking changes to consider, many that we may not expect, so as much community feedback as possible on this change is crucial.

This is very true, I can cross post this issue into the slack channel and see what people think as well.

Regarding feature flagging it, it would add some amount of safety to making the change where users could undo it. I don't see a lot of value in having it disabled by default to start though.

I do like the idea of having an on by default feature flag, maybe a little bit of middle ground would be to announce it has a disabled feature with the note saying in N+2 (seems to be about about 1 month for minor version bumps) releases it will be enabled by default. Allowing for A) package maintainers to the required work ahead of time to update the CI/CD logic and B) gives the package maintainers the opportunity to disable it if they can not update either logic for the time being.

This is a good nudge for me to get features into beta with the appropriate website docs and cli support for viewing all flags though!

Ha, yea, I will say it took me a bit to understand the idea behind feature gates, but I think it does open the door for some cool things.

If we as a community decided to go with the feature approach, I would be more then happy to be a bit of a guinea pig with implementing outside of the core maintainers (e.i Austin, Kit, and Brandt).

@AustinAbro321
Copy link
Contributor

@a1994sc The default feature flag is definitely a reasonable option, and it's good that the users will be able to control their workflows ahead of time. Ultimately, we'll have to decide if we think users will want to take the extra action ahead of time, and if we want to document it.

I think it'd be good to ask this question in slack and see what people think. Generally Zarf has said that we're okay with breaking changes on create, but really try to avoid breaking changes for deployers. This ride that line a bit since it might break some pull+deploy workflows, but it's always in a non-destructive way so it should be alright.

@Racer159
Copy link
Contributor

Just a consideration (this is still useful as is thanks for the PR!) - it could be nice to do zarf-package-<name>-<arch>-<version>-<flavor>.tar.zst (flavor after version) instead to make it easier to map back and forth between OCI registries and tarballs (since that would then just be zarf-package-<last-part-of-repo-name>-<platform-arch>-<tag>.tar.zst without needing to parse/split on the tag to build the package name).

@a1994sc
Copy link
Contributor Author

a1994sc commented Aug 18, 2025

I'm totally fine with that, I can update that this week. Are there any thoughts on the zarf-init change?

@AustinAbro321
Copy link
Contributor

Yeah I can see why a user would want to name their packages. I'm not sure I want to special case the name init. Could you create a separate issue for this?

@a1994sc
Copy link
Contributor Author

a1994sc commented Aug 18, 2025

Absolutely, I will create a new issue/pr based off this current PR.

@a1994sc
Copy link
Contributor Author

a1994sc commented Aug 18, 2025

@AustinAbro321 so I removed the custom names for the init packages, however left the flavor indicator in the file name, if that is ok

Copy link
Contributor

@soltysh soltysh left a comment

Choose a reason for hiding this comment

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

I'm supportive of this change, even though this might be breaking change, which we have to be loud about, to ensure people are aware of the change. But switching to globbing when matching new files should handle that easily.

@AustinAbro321 AustinAbro321 changed the title feat: add flavor in file name feat!: add flavor in file name Aug 20, 2025
Copy link
Contributor

@AustinAbro321 AustinAbro321 left a comment

Choose a reason for hiding this comment

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

Adding a ! in the title to denote breaking change. Looks good to me

@a1994sc
Copy link
Contributor Author

a1994sc commented Aug 20, 2025

I mean a lot of both my public and private CI/CD for zarf package using something to the effect of zarf package publish zarf-*.tar.zst so I agree with using the globbing

Copy link
Member

@brandtkeller brandtkeller left a comment

Choose a reason for hiding this comment

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

This change enhances the default and paves way for more conversations on package naming constraints ( IE #2103 ). We'll provide a mention in the release notes for those who might be impacted - LGTM.

@brandtkeller brandtkeller added this pull request to the merge queue Aug 20, 2025
Merged via the queue into zarf-dev:main with commit 7d65a24 Aug 20, 2025
27 checks passed
Ansible-man pushed a commit to Ansible-man/zarf that referenced this pull request Sep 6, 2025
Signed-off-by: Allen Conlon <software@conlon.dev>
Signed-off-by: Cade Thomas <cadethomas23@gmail.com>
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.

Include flavor to name of package created
6 participants