fix: identify submitted server version in publish diagnostics - #1621
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 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.ErrInvalidVersionsentinel with a message that includes the submittedname@versionfor duplicate-version publishes (preservingerrors.Isbehavior). - Updates
mcp-publisher publishto printPublishing {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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.5look like a rejected publication of0.4.6in #1615.Include the submitted
name@versionin 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 soerrors.Iscontinues to work.Adds a CLI regression test for a failed publication and updates the API duplicate-error assertion.
Validation:
go test ./cmd/publisher/commands -run TestPublishCommand -count=1).git diff --checkpassed.Related to #1615.