Skip to content

fix: ignore inactive remote URL conflicts#1317

Open
he-yufeng wants to merge 1 commit into
modelcontextprotocol:mainfrom
he-yufeng:fix/skip-inactive-remote-url-conflicts
Open

fix: ignore inactive remote URL conflicts#1317
he-yufeng wants to merge 1 commit into
modelcontextprotocol:mainfrom
he-yufeng:fix/skip-inactive-remote-url-conflicts

Conversation

@he-yufeng

Copy link
Copy Markdown
Contributor

Fixes #1193.

Remote URL uniqueness validation already excluded deleted servers at the query layer, but deprecated servers were still treated as conflicts. That blocks publishing a replacement server when the old server has intentionally been deprecated.

This change keeps the existing same-server exemption and skips inactive registry entries before reporting a remote URL conflict. The regression test creates a deprecated server that owns a remote URL, then verifies a different replacement server can reuse that URL.

Validation

Passed:

  • gofmt -w internal\service\registry_service.go internal\service\registry_service_test.go
  • go test ./internal/service -run '^$' -count=1
  • git diff --check

Blocked locally:

  • go test ./internal/service -run TestValidateNoDuplicateRemoteURLs -count=1
  • go test ./internal/service -run 'TestUpdateServerStatus_ValidateRemoteURLsOnRestore|TestUpdateAllVersionsStatus_ValidateRemoteURLsOnRestore' -count=1

Both targeted test commands require a local PostgreSQL test database. This Windows clean clone does not have Docker/PostgreSQL available, and the test helper failed before executing the test body with: Failed to connect to PostgreSQL. Make sure PostgreSQL is running via: docker-compose up -d postgres.

@he-yufeng

Copy link
Copy Markdown
Contributor Author

Friendly nudge on this one. Publishing is still blocked when a deprecated server shares a remote URL, even though deleted servers are already excluded from the uniqueness check at the query layer. This aligns the deprecated case with that behavior so re-publishing a renamed server works again.

Would appreciate a look when someone has a moment.

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.

Exclude deleted and deprecated servers while validating remote urls.

1 participant