internal: Fix latest version display#344
Conversation
We keep non-semver version labels unchanged when formatting them for CLI output. Previously, the display helper always added a leading v, which turned the latest sentinel into vlatest in publish and delete output. Now, only semver values are normalized with a v prefix, while labels like latest are shown as-is. Fixes agentregistry-dev#227. Signed-off-by: timflannagan <[email protected]>
e9c6a6d to
b3e5c6e
Compare
There was a problem hiding this comment.
Pull request overview
Updates CLI version display formatting to avoid incorrectly prefixing non-semver labels (e.g., latest), improving output correctness in publish/delete flows.
Changes:
- Update
FormatVersionForDisplayto only add avprefix when the version is valid semver. - Add regression tests covering
latestand other non-semver version labels.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| internal/cli/common/common.go | Adjusts display formatting to conditionally apply v prefix based on semver validity. |
| internal/cli/common/common_test.go | Expands unit tests to cover non-semver labels and date-like versions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
We aligned the display helper and tests with semver-only prefix behavior. This keeps comments and test names consistent with actual output handling.
There was a problem hiding this comment.
Pull request overview
Fixes CLI version display formatting so that non-semver version labels (e.g., latest) are shown unchanged instead of being prefixed with v, addressing the UX issue in publish/delete output.
Changes:
- Update
FormatVersionForDisplayto add avprefix only when the value is a valid semver. - Add test cases covering
latestand other non-semver labels to prevent regressions.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| internal/cli/common/common.go | Adjusts version display formatting to only normalize semver with a leading v. |
| internal/cli/common/common_test.go | Adds regression tests for latest and other non-semver labels. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Description
We keep non-semver version labels unchanged when formatting them for CLI output.
Previously, the display helper always added a leading v, which turned the latest sentinel into vlatest in publish and delete output.
Now, only semver values are normalized with a v prefix, while labels like latest are shown as-is.
Fixes #227.
Change Type
/kind fix
Changelog
Additional Notes