Skip to content

Feature implementation from commits 3d695c3..4dbf805#3

Open
codeOwlAI wants to merge 15 commits intofeature-base-branch-3from
feature-head-branch-3
Open

Feature implementation from commits 3d695c3..4dbf805#3
codeOwlAI wants to merge 15 commits intofeature-base-branch-3from
feature-head-branch-3

Conversation

@codeOwlAI
Copy link
Owner

@codeOwlAI codeOwlAI commented Jun 30, 2025

PR Summary

Change Return Type from model.Entry to model.Server

Overview

This PR refactors the system to use model.Server instead of model.Entry as the return type across multiple services and database interactions. It also updates a function call to include a required githubClientID parameter.

Change Types

Type Description
Refactor Change return type from model.Entry to model.Server
Refactor Update function call to include githubClientID parameter

Affected Modules

Module / File Change Description
database/memory.go Changed result variable type from []*model.Entry to []*model.Server
service/fake_service.go Changed return type of List method from []model.Entry to []model.Server
service/service.go Changed RegistryService interface List method return type to []model.Server
publisher/main.go Updated performDeviceFlowLogin function call to include githubClientID parameter

Breaking Changes

  • Changed return type of List method from []model.Entry to []model.Server in multiple files
  • Updated performDeviceFlowLogin function call to require githubClientID parameter

Notes for Reviewers

  • Verify that all consumers of the List method are updated to handle the new return type
  • Ensure the githubClientID parameter is being passed correctly in all cases

connor4312 and others added 15 commits May 13, 2025 14:55
* Update the model to handle new changes to schema based on modelcontextprotocol#33

* Made the import script a little simpler.
* Add a new updated seed file
* update template mcp.json file for publisher
I originally introduced `package_canonical` into the API schema because,
at the time, we were thinking to "pin" the version of the MCP server to
_one_ of the referenced source code packages.

We are no longer doing this (we are maintaining a separate notion of
`version` unique to the MCP server), so I don't believe
`package_canonical` is needed anymore. Does anyone see otherwise?

This change removes all mentions in READMEs and usages in code.
…tprotocol#62)

<!-- Provide a brief summary of your changes -->
Inline ServerDetail fields in PublishRequest

## Motivation and Context
<!-- Why is this change needed? What problem does it solve? -->
Fix modelcontextprotocol#55 

## How Has This Been Tested?
<!-- Have you tested this in a real application? Which scenarios were
tested? -->

## Breaking Changes
<!-- Will users need to update their code or configurations? -->

## Types of changes
<!-- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update

## Checklist
<!-- Go over all the following points, and put an `x` in all the boxes
that apply. -->
- [x] I have read the [MCP
Documentation](https://modelcontextprotocol.io)
- [x] My code follows the repository's style guidelines
- [x] New and existing tests pass locally
- [x] I have added appropriate error handling
- [x] I have added or updated documentation as needed

## Additional context
<!-- Add any other context, implementation notes, or design decisions
-->

https://github.com/modelcontextprotocol/registry/blob/94c19fafa45896df4ea55fc2fd06309b42499393/scripts/test_publish.sh#L61-L102

---------

Co-authored-by: Avinash Sridhar <sridharavinash@users.noreply.github.com>
}

var result []*model.Entry
var result []*model.Server
Copy link

Choose a reason for hiding this comment

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

🐛 Correctness Issue

Type mismatch between result and filteredEntries.

Changed result type to []*model.Server but it's being assigned from filteredEntries which may still be of type []*model.Entry, causing compilation errors.

Proposed Code:

	var result []*model.Server
	if startIdx < len(filteredEntries) {
		result = filteredEntries[startIdx:endIdx]  // Type mismatch if filteredEntries is []*model.Entry
	} else {
		result = []*model.Server{}
	}

// Convert from []*model.Entry to []model.Entry
result := make([]model.Entry, len(entries))
// Convert from []*model.Server to []model.Server
result := make([]model.Server, len(entries))
Copy link

Choose a reason for hiding this comment

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

🐛 Correctness Issue

Type Mismatch Between Signature and Implementation.

The function signature returns []model.Entry but the implementation creates []model.Server objects, which will cause compilation errors.

Current Code (Diff):

-	result := make([]model.Server, len(entries))
+	result := make([]model.Entry, len(entries))
📝 Committable suggestion

‼️ IMPORTANT
Trust, but verify! 🕵️ Please review this suggestion with the care of a code archaeologist - check that it perfectly replaces the highlighted code, preserves all lines, maintains proper indentation, and won't break anything in production. Your future self will thank you! 🚀

Suggested change
result := make([]model.Server, len(entries))
result := make([]model.Entry, len(entries))

// RegistryService defines the interface for registry operations
type RegistryService interface {
List(cursor string, limit int) ([]model.Entry, string, error)
List(cursor string, limit int) ([]model.Server, string, error)
Copy link

Choose a reason for hiding this comment

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

🐛 Correctness Issue

Breaking Interface Change.

Changing the return type from []model.Entry to []model.Server breaks the interface contract and will cause compilation failures in all implementations and consumers.

Proposed Code:

	List(cursor string, limit int) ([]model.Server, string, error)

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.

8 participants