Skip to content

feat(publish): add --version to set metadata.version from the CLI - #4

Merged
eddie-knight merged 2 commits into
mainfrom
feat/version
Sep 29, 2026
Merged

eddie-knight merged 2 commits into
mainfrom
feat/version

Conversation

@eddie-knight

Copy link
Copy Markdown
Contributor

The Gemara schema leaves metadata.version optional (for situations like unpublished drafts), but the hub refuses an unversioned bundle and requires the OCI tag to equal metadata.version.

A tag-only flag would push bytes and then fail at sync, so --version stamps the value into the body's metadata.version before packing (node-level yaml.v3 edit; comments and key order survive) and the tag is derived from it as before.

The flag supersedes the file's value — release pipelines stamp values like 1.0.0-rc1 over whatever the file says — and an override is noted on stderr so the pipeline log shows it.

Closes #3

… line

The Gemara schema leaves metadata.version optional (drafts), but the hub
refuses an unversioned bundle and requires the OCI tag to equal
metadata.version. A tag-only flag would push bytes and then fail at sync,
so --version stamps the value into the body's metadata.version before
packing (node-level yaml.v3 edit; comments and key order survive) and
the tag is derived from it as before.

The flag supersedes the file's value — release pipelines stamp values
like 1.0.0-rc1 over whatever the file says — and an override is noted
on stderr so the pipeline log shows it.

Closes #3

Signed-off-by: Eddie Knight <knight@linux.com>
…002)

Signed-off-by: Eddie Knight <knight@linux.com>

@sonupreetam sonupreetam left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM.

@eddie-knight
eddie-knight merged commit fd1da67 into main Sep 29, 2026
4 checks passed
sonupreetam added a commit to sonupreetam/gemara-publish-action that referenced this pull request Oct 1, 2026
Add optional 'version' input that passes --version to grcli publish,
stamping metadata.version from the CLI when the artifact YAML omits it
(gemaraproj/grcli#4). When set, the layout tag is known ahead of time
and the grep hack is skipped.

- Add testdata/minimal-catalog-no-version.yaml fixture
- Add version-flag E2E test job in action-test.yml
- Update stale grcli#3 references across README, spec, ADR 0004

Ref gemaraproj/grcli#3, gemaraproj/grcli#4
sonupreetam added a commit to sonupreetam/gemara-publish-action that referenced this pull request Oct 1, 2026
v0.2.0 includes the --version flag (gemaraproj/grcli#4), which the
version input depends on. Unblocks the version-flag CI test job.
sonupreetam added a commit to sonupreetam/gemara-publish-action that referenced this pull request Oct 1, 2026
Add optional 'version' input that passes --version to grcli publish,
stamping metadata.version from the CLI when the artifact YAML omits it
(gemaraproj/grcli#4). When set, the layout tag is known ahead of time
and the grep hack is skipped.

- Add testdata/minimal-catalog-no-version.yaml fixture
- Add version-flag E2E test job in action-test.yml
- Update stale grcli#3 references across README, spec, ADR 0004

Ref gemaraproj/grcli#3, gemaraproj/grcli#4

Signed-off-by: sonupreetam <spreetam@redhat.com>
sonupreetam added a commit to sonupreetam/gemara-publish-action that referenced this pull request Oct 1, 2026
v0.2.0 includes the --version flag (gemaraproj/grcli#4), which the
version input depends on. Unblocks the version-flag CI test job.

Signed-off-by: sonupreetam <spreetam@redhat.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.

feat(publish): add --version flag as fallback when metadata.version is absent

2 participants