Revert "docs: clarify release deployment process and enable manual deploy trigger"

This reverts commit c40374c280.
This commit is contained in:
tadasant 2025-09-29 18:57:40 -07:00
commit a0bc09dbe1
29 changed files with 112 additions and 134 deletions

View file

@ -4,7 +4,6 @@ on:
push: push:
branches: branches:
- main - main
workflow_dispatch:
permissions: permissions:
contents: read contents: read

View file

@ -308,7 +308,7 @@ func createServerJSON(
URL: repoURL, URL: repoURL,
Source: repoSource, Source: repoSource,
}, },
Version: version, Version: version,
Packages: []model.Package{pkg}, Packages: []model.Package{pkg},
} }
} }

View file

@ -13,7 +13,7 @@ func LogoutCommand() error {
} }
tokenPath := filepath.Join(homeDir, TokenFileName) tokenPath := filepath.Join(homeDir, TokenFileName)
// Check if token file exists // Check if token file exists
if _, err := os.Stat(tokenPath); os.IsNotExist(err) { if _, err := os.Stat(tokenPath); os.IsNotExist(err) {
_, _ = fmt.Fprintln(os.Stdout, "Not logged in") _, _ = fmt.Fprintln(os.Stdout, "Not logged in")
@ -30,7 +30,7 @@ func LogoutCommand() error {
".mcpregistry_github_token", ".mcpregistry_github_token",
".mcpregistry_registry_token", ".mcpregistry_registry_token",
} }
for _, file := range legacyFiles { for _, file := range legacyFiles {
path := filepath.Join(homeDir, file) path := filepath.Join(homeDir, file)
if _, err := os.Stat(path); err == nil { if _, err := os.Stat(path); err == nil {
@ -40,4 +40,4 @@ func LogoutCommand() error {
_, _ = fmt.Fprintln(os.Stdout, "✓ Successfully logged out") _, _ = fmt.Fprintln(os.Stdout, "✓ Successfully logged out")
return nil return nil
} }

View file

@ -67,4 +67,4 @@ func printUsage() {
_, _ = fmt.Fprintln(os.Stdout, " publish Publish server.json to the registry") _, _ = fmt.Fprintln(os.Stdout, " publish Publish server.json to the registry")
_, _ = fmt.Fprintln(os.Stdout) _, _ = fmt.Fprintln(os.Stdout)
_, _ = fmt.Fprintln(os.Stdout, "Use 'mcp-publisher <command> --help' for more information about a command.") _, _ = fmt.Fprintln(os.Stdout, "Use 'mcp-publisher <command> --help' for more information about a command.")
} }

View file

@ -51,7 +51,7 @@ func SetupIngressController(ctx *pulumi.Context, cluster *providers.ProviderInfo
Values: pulumi.Map{ Values: pulumi.Map{
"controller": pulumi.Map{ "controller": pulumi.Map{
"service": pulumi.Map{ "service": pulumi.Map{
"type": serviceType, "type": serviceType,
"annotations": pulumi.Map{}, "annotations": pulumi.Map{},
}, },
"config": pulumi.Map{ "config": pulumi.Map{

View file

@ -22,19 +22,19 @@ type Provider struct{}
// createGCPProvider creates a GCP provider with explicit credentials if configured // createGCPProvider creates a GCP provider with explicit credentials if configured
func createGCPProvider(ctx *pulumi.Context, name string) (*gcp.Provider, error) { func createGCPProvider(ctx *pulumi.Context, name string) (*gcp.Provider, error) {
gcpConf := config.New(ctx, "gcp") gcpConf := config.New(ctx, "gcp")
// Get project ID from config // Get project ID from config
projectID := gcpConf.Get("project") projectID := gcpConf.Get("project")
if projectID == "" { if projectID == "" {
return nil, fmt.Errorf("GCP project ID not configured. Set gcp:project") return nil, fmt.Errorf("GCP project ID not configured. Set gcp:project")
} }
// Get region from config or use default // Get region from config or use default
region := gcpConf.Get("region") region := gcpConf.Get("region")
if region == "" { if region == "" {
region = "us-central1" region = "us-central1"
} }
// Get credentials from config (base64 encoded service account JSON) // Get credentials from config (base64 encoded service account JSON)
credentials := gcpConf.Get("credentials") credentials := gcpConf.Get("credentials")
if credentials != "" { if credentials != "" {
@ -45,7 +45,7 @@ func createGCPProvider(ctx *pulumi.Context, name string) (*gcp.Provider, error)
} }
credentials = string(decodedCreds) credentials = string(decodedCreds)
} }
// Create a GCP provider with explicit credentials if provided // Create a GCP provider with explicit credentials if provided
if credentials != "" { if credentials != "" {
return gcp.NewProvider(ctx, name, &gcp.ProviderArgs{ return gcp.NewProvider(ctx, name, &gcp.ProviderArgs{
@ -54,7 +54,7 @@ func createGCPProvider(ctx *pulumi.Context, name string) (*gcp.Provider, error)
Credentials: pulumi.String(credentials), Credentials: pulumi.String(credentials),
}) })
} }
return nil, nil return nil, nil
} }

View file

@ -16,34 +16,10 @@ The release workflow will automatically:
## After Release ## After Release
The release workflow will automatically: - Docker images will be available at:
- Build and publish Docker images:
- `ghcr.io/modelcontextprotocol/registry:latest` - Latest stable release - `ghcr.io/modelcontextprotocol/registry:latest` - Latest stable release
- `ghcr.io/modelcontextprotocol/registry:vX.Y.Z` - Specific release version - `ghcr.io/modelcontextprotocol/registry:vX.Y.Z` - Specific release version
- Binaries will be available on the GitHub release page - Binaries can be downloaded from the GitHub release page
**Important:** Creating a release does **not** automatically deploy to production. Production deployments are triggered by pushes to the `main` branch.
## Deploying the Release to Production
After creating a release, you need to ensure production pulls the new `:latest` Docker image. You have two options:
1. **Recommended:** Merge a commit to `main` (e.g., a changelog update or version bump). This will trigger the deployment workflow which will:
- Build and push a new `:main` Docker image
- Deploy to staging
- Deploy to production (which uses `:latest` and will pull the new image)
2. **Manual restart (requires kubectl access):**
```bash
kubectl rollout restart deployment/mcp-registry -n default
```
## Verifying the Deployment
After deployment completes, verify the changes are live:
- Check the deployment workflow succeeded: https://github.com/modelcontextprotocol/registry/actions/workflows/deploy.yml
- Test the API endpoint to confirm schema changes are applied
- Check migrations ran successfully in the pod logs
## Docker Image Tags ## Docker Image Tags

View file

@ -387,6 +387,7 @@ func TestDefaultHTTPKeyFetcher(t *testing.T) {
} }
} }
func TestHTTPAuthHandler_Permissions(t *testing.T) { func TestHTTPAuthHandler_Permissions(t *testing.T) {
cfg := &config.Config{ cfg := &config.Config{
JWTPrivateKey: "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef", JWTPrivateKey: "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
@ -737,3 +738,4 @@ func TestHTTPvsDNS_PermissionDifferences(t *testing.T) {
}) })
} }
} }

View file

@ -97,8 +97,8 @@ func RegisterEditEndpoints(api huma.API, registry service.RegistryService, cfg *
// Prevent undeleting servers - once deleted, they stay deleted // Prevent undeleting servers - once deleted, they stay deleted
if currentServer.Meta.Official != nil && if currentServer.Meta.Official != nil &&
currentServer.Meta.Official.Status == model.StatusDeleted && currentServer.Meta.Official.Status == model.StatusDeleted &&
newStatus != model.StatusDeleted { newStatus != model.StatusDeleted {
return nil, huma.Error400BadRequest("Cannot change status of deleted server. Deleted servers cannot be undeleted.") return nil, huma.Error400BadRequest("Cannot change status of deleted server. Deleted servers cannot be undeleted.")
} }

View file

@ -639,4 +639,4 @@ func TestEditServerEndpointEdgeCases(t *testing.T) {
// Helper function // Helper function
func stringPtr(s string) *string { func stringPtr(s string) *string {
return &s return &s
} }

View file

@ -75,7 +75,7 @@ func buildPermissionErrorMessage(attemptedResource string, permissions []auth.Pe
permissionStrs = append(permissionStrs, perm.ResourcePattern) permissionStrs = append(permissionStrs, perm.ResourcePattern)
} }
} }
errorMsg := "You do not have permission to publish this server" errorMsg := "You do not have permission to publish this server"
if len(permissionStrs) > 0 { if len(permissionStrs) > 0 {
errorMsg += ". You have permission to publish: " + strings.Join(permissionStrs, ", ") errorMsg += ". You have permission to publish: " + strings.Join(permissionStrs, ", ")
@ -83,6 +83,6 @@ func buildPermissionErrorMessage(attemptedResource string, permissions []auth.Pe
errorMsg += ". You do not have any publish permissions" errorMsg += ". You do not have any publish permissions"
} }
errorMsg += ". Attempting to publish: " + attemptedResource errorMsg += ". Attempting to publish: " + attemptedResource
return errorMsg return errorMsg
} }

View file

@ -162,9 +162,9 @@ func TestPublishIntegration(t *testing.T) {
t.Run("publish fails with invalid token", func(t *testing.T) { t.Run("publish fails with invalid token", func(t *testing.T) {
publishReq := apiv0.ServerJSON{ publishReq := apiv0.ServerJSON{
Name: "io.github.domdomegg/test-server", Name: "io.github.domdomegg/test-server",
Description: "Test server", Description: "Test server",
Version: "1.0.0", Version: "1.0.0",
} }
body, err := json.Marshal(publishReq) body, err := json.Marshal(publishReq)
@ -185,7 +185,7 @@ func TestPublishIntegration(t *testing.T) {
publishReq := apiv0.ServerJSON{ publishReq := apiv0.ServerJSON{
Name: "io.github.other/test-server", Name: "io.github.other/test-server",
Description: "A test server", Description: "A test server",
Version: "1.0.0", Version: "1.0.0",
Repository: model.Repository{ Repository: model.Repository{
URL: "https://github.com/example/test-server", URL: "https://github.com/example/test-server",
Source: "github", Source: "github",
@ -221,7 +221,7 @@ func TestPublishIntegration(t *testing.T) {
publishReq := apiv0.ServerJSON{ publishReq := apiv0.ServerJSON{
Name: "io.github.domdomegg/airtable-mcp-server", Name: "io.github.domdomegg/airtable-mcp-server",
Description: "A test server with MCPB package", Description: "A test server with MCPB package",
Version: "1.7.2", Version: "1.7.2",
Packages: []model.Package{ Packages: []model.Package{
{ {
RegistryType: model.RegistryTypeMCPB, RegistryType: model.RegistryTypeMCPB,

View file

@ -47,7 +47,7 @@ func TestPublishRegistryValidation(t *testing.T) {
publishReq := apiv0.ServerJSON{ publishReq := apiv0.ServerJSON{
Name: "com.example/test-server-with-npm", Name: "com.example/test-server-with-npm",
Description: "A test server with invalid npm package reference", Description: "A test server with invalid npm package reference",
Version: "1.0.0", Version: "1.0.0",
Packages: []model.Package{ Packages: []model.Package{
{ {
RegistryType: model.RegistryTypeNPM, RegistryType: model.RegistryTypeNPM,
@ -88,7 +88,7 @@ func TestPublishRegistryValidation(t *testing.T) {
publishReq := apiv0.ServerJSON{ publishReq := apiv0.ServerJSON{
Name: "com.example/test-server-mcpb-validation", Name: "com.example/test-server-mcpb-validation",
Description: "A test server with MCPB package and registry validation enabled", Description: "A test server with MCPB package and registry validation enabled",
Version: "0.0.36", Version: "0.0.36",
Packages: []model.Package{ Packages: []model.Package{
{ {
RegistryType: model.RegistryTypeMCPB, RegistryType: model.RegistryTypeMCPB,
@ -138,7 +138,7 @@ func TestPublishRegistryValidation(t *testing.T) {
publishReq := apiv0.ServerJSON{ publishReq := apiv0.ServerJSON{
Name: "com.example/test-server-multiple-packages", Name: "com.example/test-server-multiple-packages",
Description: "A test server with multiple packages where second fails", Description: "A test server with multiple packages where second fails",
Version: "1.0.0", Version: "1.0.0",
Packages: []model.Package{ Packages: []model.Package{
{ {
RegistryType: model.RegistryTypeMCPB, RegistryType: model.RegistryTypeMCPB,
@ -189,7 +189,7 @@ func TestPublishRegistryValidation(t *testing.T) {
publishReq := apiv0.ServerJSON{ publishReq := apiv0.ServerJSON{
Name: "com.example/test-server-first-package-fails", Name: "com.example/test-server-first-package-fails",
Description: "A test server where first package fails", Description: "A test server where first package fails",
Version: "1.0.0", Version: "1.0.0",
Packages: []model.Package{ Packages: []model.Package{
{ {
RegistryType: model.RegistryTypeNPM, RegistryType: model.RegistryTypeNPM,

View file

@ -113,9 +113,9 @@ func TestPublishEndpoint(t *testing.T) {
{ {
name: "invalid authorization header format", name: "invalid authorization header format",
requestBody: apiv0.ServerJSON{ requestBody: apiv0.ServerJSON{
Name: "io.github.domdomegg/test-server", Name: "io.github.domdomegg/test-server",
Description: "Test server", Description: "Test server",
Version: "1.0.0", Version: "1.0.0",
}, },
authHeader: "InvalidFormat", authHeader: "InvalidFormat",
setupRegistryService: func(_ service.RegistryService) { setupRegistryService: func(_ service.RegistryService) {
@ -129,7 +129,7 @@ func TestPublishEndpoint(t *testing.T) {
requestBody: apiv0.ServerJSON{ requestBody: apiv0.ServerJSON{
Name: "test-server", Name: "test-server",
Description: "A test server", Description: "A test server",
Version: "1.0.0", Version: "1.0.0",
}, },
authHeader: "Bearer invalidToken", authHeader: "Bearer invalidToken",
setupRegistryService: func(_ service.RegistryService) { setupRegistryService: func(_ service.RegistryService) {
@ -143,7 +143,7 @@ func TestPublishEndpoint(t *testing.T) {
requestBody: apiv0.ServerJSON{ requestBody: apiv0.ServerJSON{
Name: "io.github.other/test-server", Name: "io.github.other/test-server",
Description: "A test server", Description: "A test server",
Version: "1.0.0", Version: "1.0.0",
Repository: model.Repository{ Repository: model.Repository{
URL: "https://github.com/example/test-server", URL: "https://github.com/example/test-server",
Source: "github", Source: "github",
@ -167,7 +167,7 @@ func TestPublishEndpoint(t *testing.T) {
requestBody: apiv0.ServerJSON{ requestBody: apiv0.ServerJSON{
Name: "example/test-server", Name: "example/test-server",
Description: "A test server", Description: "A test server",
Version: "1.0.0", Version: "1.0.0",
Repository: model.Repository{ Repository: model.Repository{
URL: "https://github.com/example/test-server", URL: "https://github.com/example/test-server",
Source: "github", Source: "github",
@ -185,7 +185,7 @@ func TestPublishEndpoint(t *testing.T) {
existingServer := apiv0.ServerJSON{ existingServer := apiv0.ServerJSON{
Name: "example/test-server", Name: "example/test-server",
Description: "Existing test server", Description: "Existing test server",
Version: "1.0.0", Version: "1.0.0",
Repository: model.Repository{ Repository: model.Repository{
URL: "https://github.com/example/test-server-existing", URL: "https://github.com/example/test-server-existing",
Source: "github", Source: "github",
@ -202,7 +202,7 @@ func TestPublishEndpoint(t *testing.T) {
requestBody: apiv0.ServerJSON{ requestBody: apiv0.ServerJSON{
Name: "com.example/test-server-mcpb", Name: "com.example/test-server-mcpb",
Description: "A test server with MCPB package", Description: "A test server with MCPB package",
Version: "1.0.0", Version: "1.0.0",
Packages: []model.Package{ Packages: []model.Package{
{ {
RegistryType: model.RegistryTypeMCPB, RegistryType: model.RegistryTypeMCPB,
@ -499,7 +499,7 @@ func TestPublishEndpoint_MultipleSlashesEdgeCases(t *testing.T) {
mux.ServeHTTP(rr, req) mux.ServeHTTP(rr, req)
// Assertions // Assertions
assert.Equal(t, tc.expectedStatus, rr.Code, assert.Equal(t, tc.expectedStatus, rr.Code,
"%s: expected status %d, got %d", tc.description, tc.expectedStatus, rr.Code) "%s: expected status %d, got %d", tc.description, tc.expectedStatus, rr.Code)
if tc.expectedStatus == http.StatusBadRequest { if tc.expectedStatus == http.StatusBadRequest {
@ -508,4 +508,4 @@ func TestPublishEndpoint_MultipleSlashesEdgeCases(t *testing.T) {
} }
}) })
} }
} }

View file

@ -41,7 +41,6 @@ type ServerVersionsInput struct {
} }
// RegisterServersEndpoints registers all server-related endpoints // RegisterServersEndpoints registers all server-related endpoints
//
//nolint:cyclop // Multiple endpoint registrations are inherently complex //nolint:cyclop // Multiple endpoint registrations are inherently complex
func RegisterServersEndpoints(api huma.API, registry service.RegistryService) { func RegisterServersEndpoints(api huma.API, registry service.RegistryService) {
// List servers endpoint // List servers endpoint

View file

@ -509,4 +509,4 @@ func TestServersEndpointEdgeCases(t *testing.T) {
assert.Contains(t, []model.Status{model.StatusActive, model.StatusDeprecated, model.StatusDeleted}, server.Meta.Official.Status) assert.Contains(t, []model.Status{model.StatusActive, model.StatusDeprecated, model.StatusDeleted}, server.Meta.Official.Status)
} }
}) })
} }

View file

@ -23,12 +23,12 @@ func TrailingSlashMiddleware(next http.Handler) http.Handler {
// Create a copy of the URL and remove the trailing slash // Create a copy of the URL and remove the trailing slash
newURL := *r.URL newURL := *r.URL
newURL.Path = strings.TrimSuffix(r.URL.Path, "/") newURL.Path = strings.TrimSuffix(r.URL.Path, "/")
// Use 308 Permanent Redirect to preserve the request method // Use 308 Permanent Redirect to preserve the request method
http.Redirect(w, r, newURL.String(), http.StatusPermanentRedirect) http.Redirect(w, r, newURL.String(), http.StatusPermanentRedirect)
return return
} }
next.ServeHTTP(w, r) next.ServeHTTP(w, r)
}) })
} }

View file

@ -6,4 +6,4 @@ var BlockedNamespaces = []string{
// Add blocked namespaces here, e.g.: // Add blocked namespaces here, e.g.:
// "io.github.spammer", // "io.github.spammer",
// "com.evil-domain", // "com.evil-domain",
} }

View file

@ -300,9 +300,9 @@ func TestJWTManager_BlockedNamespaces(t *testing.T) {
originalBlocked := auth.BlockedNamespaces originalBlocked := auth.BlockedNamespaces
auth.BlockedNamespaces = []string{"io.github.spammer"} auth.BlockedNamespaces = []string{"io.github.spammer"}
defer func() { auth.BlockedNamespaces = originalBlocked }() defer func() { auth.BlockedNamespaces = originalBlocked }()
jwtManager := auth.NewJWTManager(cfg) jwtManager := auth.NewJWTManager(cfg)
claims := auth.JWTClaims{ claims := auth.JWTClaims{
AuthMethod: auth.MethodGitHubAT, AuthMethod: auth.MethodGitHubAT,
AuthMethodSubject: "spammer", AuthMethodSubject: "spammer",
@ -325,9 +325,9 @@ func TestJWTManager_BlockedNamespaces(t *testing.T) {
originalBlocked := auth.BlockedNamespaces originalBlocked := auth.BlockedNamespaces
auth.BlockedNamespaces = []string{"io.github.spammer"} auth.BlockedNamespaces = []string{"io.github.spammer"}
defer func() { auth.BlockedNamespaces = originalBlocked }() defer func() { auth.BlockedNamespaces = originalBlocked }()
jwtManager := auth.NewJWTManager(cfg) jwtManager := auth.NewJWTManager(cfg)
claims := auth.JWTClaims{ claims := auth.JWTClaims{
AuthMethod: auth.MethodGitHubAT, AuthMethod: auth.MethodGitHubAT,
AuthMethodSubject: "gooduser", AuthMethodSubject: "gooduser",
@ -349,9 +349,9 @@ func TestJWTManager_BlockedNamespaces(t *testing.T) {
originalBlocked := auth.BlockedNamespaces originalBlocked := auth.BlockedNamespaces
auth.BlockedNamespaces = []string{"io.github.badorg"} auth.BlockedNamespaces = []string{"io.github.badorg"}
defer func() { auth.BlockedNamespaces = originalBlocked }() defer func() { auth.BlockedNamespaces = originalBlocked }()
jwtManager := auth.NewJWTManager(cfg) jwtManager := auth.NewJWTManager(cfg)
claims := auth.JWTClaims{ claims := auth.JWTClaims{
AuthMethod: auth.MethodGitHubAT, AuthMethod: auth.MethodGitHubAT,
AuthMethodSubject: "user", AuthMethodSubject: "user",
@ -378,9 +378,9 @@ func TestJWTManager_BlockedNamespaces(t *testing.T) {
originalBlocked := auth.BlockedNamespaces originalBlocked := auth.BlockedNamespaces
auth.BlockedNamespaces = []string{"io.github.spammer"} auth.BlockedNamespaces = []string{"io.github.spammer"}
defer func() { auth.BlockedNamespaces = originalBlocked }() defer func() { auth.BlockedNamespaces = originalBlocked }()
jwtManager := auth.NewJWTManager(cfg) jwtManager := auth.NewJWTManager(cfg)
claims := auth.JWTClaims{ claims := auth.JWTClaims{
AuthMethod: auth.MethodNone, AuthMethod: auth.MethodNone,
AuthMethodSubject: "admin", AuthMethodSubject: "admin",

View file

@ -16,4 +16,4 @@ const (
MethodHTTP Method = "http" MethodHTTP Method = "http"
// No authentication - should only be used for local development and testing // No authentication - should only be used for local development and testing
MethodNone Method = "none" MethodNone Method = "none"
) )

Some files were not shown because too many files have changed in this diff Show more