feat(publish): support for tag specification#4641
Conversation
…ersion Signed-off-by: Brandt Keller <[email protected]>
✅ Deploy Preview for zarf-docs canceled.
|
Signed-off-by: Brandt Keller <[email protected]>
Codecov Report❌ Patch coverage is
... and 5 files with indirect coverage changes 🚀 New features to boost your workflow:
|
| if len(pkg.Metadata.Version) == 0 { | ||
| return registry.Reference{}, errors.New("version is required for publishing") | ||
| } |
There was a problem hiding this comment.
Should we change this requirement to version or tag?
There was a problem hiding this comment.
I left Version as a strict requirement. Anytime we are publishing we have required a version so I believe that maintains the stance. Tag is optional.
There was a problem hiding this comment.
I'm fine with keeping the requirement, I'd rather encourage users tag their packages through the metadata version. I called attention to this since the reason we added this requirement was because otherwise we wouldn't have a tag. Now that we can have an explicit tag it's no longer a technical requirement
There was a problem hiding this comment.
fair point - it is no longer a technical requirement - should it still be a publishing requirement?
Or said another way - do we want to allow a package to be published that does not have a metadata.version?
There was a problem hiding this comment.
Yeah, I wanted to raise it for consideration, but thinking it over I'd probably still lean towards keeping it as a requirement.
Thinking through the workflow, I'd rather have people set version with .metdata.Version than with --tag as I feel it's a bit easier to track. However, if we give an error message telling users, that they have to set version or give a tag, then they're more likely to use a tag since it's least resistance, so I'm cool with keeping the requirement.
Signed-off-by: Brandt Keller <[email protected]>
Description
Adds support for a
--tag | -tflag onpackage publishto override the package metadata.version tag that is statically defined.This purposefully does not add the tag to create at this time.
Consideration could be made for a list of tags but that adds more complexity than should be needed to a publish activity. Additionally "flavor" could be an option on the zoci options but I deferred to keeping that explicit.
Related Issue
Fixes #4609
Checklist before merging