Skip to content

feat(publish): support for tag specification#4641

Merged
brandtkeller merged 8 commits into
mainfrom
4609_publish_tag
Mar 9, 2026
Merged

feat(publish): support for tag specification#4641
brandtkeller merged 8 commits into
mainfrom
4609_publish_tag

Conversation

@brandtkeller
Copy link
Copy Markdown
Member

@brandtkeller brandtkeller commented Feb 24, 2026

Description

Adds support for a --tag | -t flag on package publish to 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

@brandtkeller brandtkeller self-assigned this Feb 24, 2026
@brandtkeller brandtkeller requested review from a team as code owners February 24, 2026 21:38
@netlify
Copy link
Copy Markdown

netlify Bot commented Feb 24, 2026

Deploy Preview for zarf-docs canceled.

Name Link
🔨 Latest commit 6667c4b
🔍 Latest deploy log https://app.netlify.com/projects/zarf-docs/deploys/69ab5971869e980008e8264d

@brandtkeller brandtkeller changed the title feat(publish): support for tag specification separate from metadata.v… feat(publish): support for tag specification Feb 24, 2026
@brandtkeller brandtkeller moved this to PR Review in Zarf Feb 24, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 24, 2026

Codecov Report

❌ Patch coverage is 55.88235% with 15 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/pkg/zoci/utils.go 50.00% 4 Missing and 3 partials ⚠️
src/cmd/package.go 16.66% 5 Missing ⚠️
src/pkg/zoci/copier.go 0.00% 3 Missing ⚠️
Files with missing lines Coverage Δ
src/pkg/packager/publish.go 66.66% <100.00%> (+1.96%) ⬆️
src/pkg/zoci/common.go 50.00% <ø> (ø)
src/pkg/zoci/copier.go 0.00% <0.00%> (ø)
src/cmd/package.go 37.64% <16.66%> (-0.06%) ⬇️
src/pkg/zoci/utils.go 46.66% <50.00%> (+1.66%) ⬆️

... and 5 files 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.

Comment thread src/pkg/zoci/utils.go
Comment on lines 31 to 33
if len(pkg.Metadata.Version) == 0 {
return registry.Reference{}, errors.New("version is required for publishing")
}
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.

Should we change this requirement to version or tag?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Member

@AustinAbro321 AustinAbro321 Mar 6, 2026

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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?

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.

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.

Comment thread src/pkg/zoci/utils.go
@github-project-automation github-project-automation Bot moved this from PR Review to In progress in Zarf Mar 6, 2026
@brandtkeller brandtkeller added this pull request to the merge queue Mar 9, 2026
Merged via the queue into main with commit 9cf8912 Mar 9, 2026
42 checks passed
@brandtkeller brandtkeller deleted the 4609_publish_tag branch March 9, 2026 14:01
@github-project-automation github-project-automation Bot moved this from In progress to Done in Zarf Mar 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Non 1:1 tag-to-version relationship

2 participants