Skip to content

fix: identify submitted server version in publish diagnostics - #1621

Merged
rdimitrov merged 1 commit into
mainfrom
codex/explicit-publish-version
Sep 5, 2026
Merged

fix: identify submitted server version in publish diagnostics#1621
rdimitrov merged 1 commit into
mainfrom
codex/explicit-publish-version

Conversation

@rdimitrov

Copy link
Copy Markdown
Member

Publishing a manifest with a stale version currently produces a duplicate-version error without identifying the version that was submitted. This made a request containing 0.4.5 look like a rejected publication of 0.4.6 in #1615.

Include the submitted name@version in the CLI output before sending the request and in the API duplicate-version error. HTTP 400, the response structure, and duplicate-rejection behavior remain unchanged. The service wraps the existing error sentinel so errors.Is continues to work.

Adds a CLI regression test for a failed publication and updates the API duplicate-error assertion.

Validation:

  • Publish command tests passed (go test ./cmd/publisher/commands -run TestPublishCommand -count=1).
  • git diff --check passed.
  • API endpoint tests were attempted but could not run because PostgreSQL was unavailable on localhost:5432; Docker was also unavailable locally.

Related to #1615.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The change is narrowly scoped, preserves sentinel semantics, and is covered by updated regression tests for both CLI and API behavior.

Pull request overview

Improves publish diagnostics so that when a manifest submits a stale/duplicate version, the user can clearly see the exact name@version that was attempted—both in the mcp-publisher CLI output and in the registry API’s duplicate-version error message.

Changes:

  • Wraps the existing database.ErrInvalidVersion sentinel with a message that includes the submitted name@version for duplicate-version publishes (preserving errors.Is behavior).
  • Updates mcp-publisher publish to print Publishing {name}@{version} to {registry}... before sending the request.
  • Adds/updates regression tests to assert the enhanced diagnostics in both CLI and API paths.
File summaries
File Description
internal/service/registry_service.go Adds submitted name@version context to the duplicate-version error while preserving the existing sentinel via wrapping.
internal/api/handlers/v0/publish_test.go Updates the duplicate-version assertion to expect the submitted server identity in the error payload.
cmd/publisher/commands/publish.go Prints name@version in the “Publishing…” line prior to the publish request.
cmd/publisher/commands/publish_test.go Adds a CLI regression test asserting the submitted identity is printed even when publish fails.
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@rdimitrov
rdimitrov merged commit 068a97a into main Sep 5, 2026
8 checks passed
@rdimitrov
rdimitrov deleted the codex/explicit-publish-version branch September 5, 2026 21:18
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.

2 participants