Skip to content

Resolve the tag Charts marker only from a real annotated tag - #1103

Merged
ArnobKumarSaha merged 1 commit into
masterfrom
arnob-tag-marker
Jul 31, 2026
Merged

Resolve the tag Charts marker only from a real annotated tag#1103
ArnobKumarSaha merged 1 commit into
masterfrom
arnob-tag-marker

Conversation

@ArnobKumarSaha

Copy link
Copy Markdown
Member

Problem

The OCI publish job for v0.36.1 failed:

publishing charts matching: annotated-tag body marker resolve to a glob that make stage-charts
staged 0 chart(s) matching '...' in .charts-subset
Error: /home/runner/work/ui-wizards/ui-wizards/.oci/*: no such file

Two bugs compounded:

  1. The tag is lightweight on the runner. actions/checkout fetches a tag push by commit sha, so refs/tags/<tag> points at the commit rather than the annotated tag object. git tag -l --format='%(body)' then falls back to the commit message. Locally the tag is fine — git cat-file -t v0.36.1 reports tag and the body is Charts: kubedbcom-*-editor-options.
  2. The commit body of 4bb0e8d has a wrapped line starting with Charts:Charts: annotated-tag body marker resolve to a glob that make stage-charts. The marker sed matched that prose, find -name matched no dirs, and publish-oci-charts.sh globbed an empty .oci/.

Fix

publish-oci.yml and release.yml (identical block in both):

  • Only treat GITHUB_REF as a tag when it is one. On workflow_dispatch the old code fed refs/heads/master to git tag -l.
  • Refetch refs/tags/$GIT_TAG explicitly so the annotated tag object exists, then gate the body read on git cat-file -t "$GIT_TAG" = tag. A lightweight tag now yields no pattern instead of a commit message.
  • Reject a resolved pattern containing whitespace with ::error:: + exit 1. A glob is one shell word; whitespace means the marker matched prose.

Makefilestage-charts exits 1 with no charts matched '<glob>' instead of staging zero charts and letting the publish script fail later with an opaque .oci/*: no such file.

Verification

$ make stage-charts CHARTS_PATTERN='kubedbcom-mongodb-*' STAGE_DIR=/tmp/sc-ok
staged 2 chart(s) matching 'kubedbcom-mongodb-*' in /tmp/sc-ok      exit=0

$ make stage-charts CHARTS_PATTERN='annotated-tag body marker resolve to a glob' ...
no charts matched 'annotated-tag body marker resolve to a glob'
make: *** [stage-charts] Error 1                                     exit=2

The whitespace guard was exercised standalone under bash -e: errors on prose, passes kubedbcom-*-editor-options through.

Note

v0.36.1 still points at 4bb0e8d, whose commit body contains that prose Charts: line. With this fix the annotated body is read correctly so it no longer matters, but the tag needs to be moved to include this commit before the workflow behaves differently.

actions/checkout fetches a tag push by sha, so refs/tags/<tag> on the runner
is lightweight and git tag -l --format='%(body)' falls back to the commit
message. A wrapped prose line in 4bb0e8d begins with "Charts:", so the
marker resolved to that sentence, staged 0 charts, and publish-oci-charts.sh
died on an empty .oci/ glob.

Refetch the tag ref, gate the body read on cat-file -t reporting a tag object,
and skip the lookup entirely when GITHUB_REF is not a tag. Reject a resolved
pattern containing whitespace: a glob is one shell word. stage-charts now
fails when nothing matches instead of handing an empty dir downstream.

Signed-off-by: Arnob Kumar Saha <arnob@appscode.com>
@ArnobKumarSaha
ArnobKumarSaha merged commit 8a16336 into master Jul 31, 2026
10 checks passed
@ArnobKumarSaha
ArnobKumarSaha deleted the arnob-tag-marker branch July 31, 2026 07:45
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.

1 participant