Skip to content

internal: Fix latest version display#344

Merged
peterj merged 2 commits intoagentregistry-dev:mainfrom
timflannagan:fix/version-output
Mar 13, 2026
Merged

internal: Fix latest version display#344
peterj merged 2 commits intoagentregistry-dev:mainfrom
timflannagan:fix/version-output

Conversation

@timflannagan
Copy link
Copy Markdown
Collaborator

@timflannagan timflannagan commented Mar 13, 2026

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

NONE

Additional Notes

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]>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 FormatVersionForDisplay to only add a v prefix when the version is valid semver.
  • Add regression tests covering latest and 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.
@peterj peterj enabled auto-merge March 13, 2026 18:27
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 FormatVersionForDisplay to add a v prefix only when the value is a valid semver.
  • Add test cases covering latest and 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.

@peterj peterj added this pull request to the merge queue Mar 13, 2026
Merged via the queue into agentregistry-dev:main with commit 7e29a9a Mar 13, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix "vlatest" output when publishing agents/servers with non-semver versions

3 participants