Skip to content

Commit 99d33f4

Browse files
tadasantclaude
andcommitted
fix: correct variable naming from versionId to versionID for linter
Go conventions require ID to be all caps (versionID) not camelCase (versionId). 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent f78e935 commit 99d33f4

30 files changed

+168
-155
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
build/
22
bin/
3+
tmp/
34

45
.db
56
.env
@@ -11,4 +12,4 @@ validate-schemas
1112
coverage.out
1213
coverage.html
1314
deploy/infra/infra
14-
registry
15+
registry

cmd/publisher/commands/init.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ func createServerJSON(
309309
URL: repoURL,
310310
Source: repoSource,
311311
},
312-
Version: version,
312+
Version: version,
313313
Packages: []model.Package{pkg},
314314
}
315315
}

cmd/publisher/commands/logout.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ func LogoutCommand() error {
1313
}
1414

1515
tokenPath := filepath.Join(homeDir, TokenFileName)
16-
16+
1717
// Check if token file exists
1818
if _, err := os.Stat(tokenPath); os.IsNotExist(err) {
1919
_, _ = fmt.Fprintln(os.Stdout, "Not logged in")
@@ -30,7 +30,7 @@ func LogoutCommand() error {
3030
".mcpregistry_github_token",
3131
".mcpregistry_registry_token",
3232
}
33-
33+
3434
for _, file := range legacyFiles {
3535
path := filepath.Join(homeDir, file)
3636
if _, err := os.Stat(path); err == nil {
@@ -40,4 +40,4 @@ func LogoutCommand() error {
4040

4141
_, _ = fmt.Fprintln(os.Stdout, "✓ Successfully logged out")
4242
return nil
43-
}
43+
}

cmd/publisher/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,4 @@ func printUsage() {
6767
_, _ = fmt.Fprintln(os.Stdout, " publish Publish server.json to the registry")
6868
_, _ = fmt.Fprintln(os.Stdout)
6969
_, _ = fmt.Fprintln(os.Stdout, "Use 'mcp-publisher <command> --help' for more information about a command.")
70-
}
70+
}

deploy/pkg/k8s/ingress.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func SetupIngressController(ctx *pulumi.Context, cluster *providers.ProviderInfo
5151
Values: pulumi.Map{
5252
"controller": pulumi.Map{
5353
"service": pulumi.Map{
54-
"type": serviceType,
54+
"type": serviceType,
5555
"annotations": pulumi.Map{},
5656
},
5757
"config": pulumi.Map{

deploy/pkg/providers/gcp/provider.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,19 @@ type Provider struct{}
2222
// createGCPProvider creates a GCP provider with explicit credentials if configured
2323
func createGCPProvider(ctx *pulumi.Context, name string) (*gcp.Provider, error) {
2424
gcpConf := config.New(ctx, "gcp")
25-
25+
2626
// Get project ID from config
2727
projectID := gcpConf.Get("project")
2828
if projectID == "" {
2929
return nil, fmt.Errorf("GCP project ID not configured. Set gcp:project")
3030
}
31-
31+
3232
// Get region from config or use default
3333
region := gcpConf.Get("region")
3434
if region == "" {
3535
region = "us-central1"
3636
}
37-
37+
3838
// Get credentials from config (base64 encoded service account JSON)
3939
credentials := gcpConf.Get("credentials")
4040
if credentials != "" {
@@ -45,7 +45,7 @@ func createGCPProvider(ctx *pulumi.Context, name string) (*gcp.Provider, error)
4545
}
4646
credentials = string(decodedCreds)
4747
}
48-
48+
4949
// Create a GCP provider with explicit credentials if provided
5050
if credentials != "" {
5151
return gcp.NewProvider(ctx, name, &gcp.ProviderArgs{
@@ -54,7 +54,7 @@ func createGCPProvider(ctx *pulumi.Context, name string) (*gcp.Provider, error)
5454
Credentials: pulumi.String(credentials),
5555
})
5656
}
57-
57+
5858
return nil, nil
5959
}
6060

internal/api/handlers/v0/edit.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func RegisterEditEndpoints(api huma.API, registry service.RegistryService, cfg *
5555

5656
// Get current server to check permissions against existing name
5757
currentServer, err := registry.GetByServerIDAndVersion(input.ServerID, input.Version)
58-
58+
5959
if err != nil {
6060
if errors.Is(err, database.ErrNotFound) {
6161
return nil, huma.Error404NotFound("Server not found")
@@ -83,7 +83,7 @@ func RegisterEditEndpoints(api huma.API, registry service.RegistryService, cfg *
8383
if versionID == "" {
8484
return nil, huma.Error500InternalServerError("Server version ID not found in metadata", nil)
8585
}
86-
86+
8787
updatedServer, err := registry.EditServer(versionID, input.Body)
8888
if err != nil {
8989
if errors.Is(err, database.ErrNotFound) {

internal/api/handlers/v0/edit_test.go

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import (
2020
"github.com/modelcontextprotocol/registry/pkg/model"
2121
)
2222

23-
2423
func TestEditServerEndpoint(t *testing.T) {
2524
// Create registry service and insert a common test server
2625
registryService := service.NewRegistryService(database.NewMemoryDB(), config.NewConfig())
@@ -86,13 +85,13 @@ func TestEditServerEndpoint(t *testing.T) {
8685
deletedServerID := deletedPublished.Meta.Official.ServerID
8786

8887
testCases := []struct {
89-
name string
90-
authHeader string
91-
requestBody interface{}
92-
serverID string
93-
version string
94-
expectedStatus int
95-
expectedError string
88+
name string
89+
authHeader string
90+
requestBody interface{}
91+
serverID string
92+
version string
93+
expectedStatus int
94+
expectedError string
9695
}{
9796
{
9897
name: "successful edit with valid token and permissions",
@@ -135,9 +134,9 @@ func TestEditServerEndpoint(t *testing.T) {
135134
name: "invalid authorization header format",
136135
authHeader: "InvalidFormat token123",
137136
requestBody: apiv0.ServerJSON{
138-
Name: "io.github.domdomegg/test-server",
139-
Description: "Test server",
140-
Version: "1.0.0",
137+
Name: "io.github.domdomegg/test-server",
138+
Description: "Test server",
139+
Version: "1.0.0",
141140
},
142141
serverID: testServerID,
143142
version: "1.0.0",
@@ -148,9 +147,9 @@ func TestEditServerEndpoint(t *testing.T) {
148147
name: "invalid token",
149148
authHeader: "Bearer invalid-token",
150149
requestBody: apiv0.ServerJSON{
151-
Name: "io.github.domdomegg/test-server",
152-
Description: "Test server",
153-
Version: "1.0.0",
150+
Name: "io.github.domdomegg/test-server",
151+
Description: "Test server",
152+
Version: "1.0.0",
154153
},
155154
serverID: testServerID,
156155
version: "1.0.0",
@@ -171,9 +170,9 @@ func TestEditServerEndpoint(t *testing.T) {
171170
return "Bearer " + token
172171
}(),
173172
requestBody: apiv0.ServerJSON{
174-
Name: "io.github.domdomegg/test-server",
175-
Description: "Updated test server",
176-
Version: "1.0.0",
173+
Name: "io.github.domdomegg/test-server",
174+
Description: "Updated test server",
175+
Version: "1.0.0",
177176
},
178177
serverID: testServerID,
179178
version: "1.0.0",
@@ -194,9 +193,9 @@ func TestEditServerEndpoint(t *testing.T) {
194193
return "Bearer " + token
195194
}(),
196195
requestBody: apiv0.ServerJSON{
197-
Name: "io.github.other/test-server",
198-
Description: "Updated test server",
199-
Version: "1.0.0",
196+
Name: "io.github.other/test-server",
197+
Description: "Updated test server",
198+
Version: "1.0.0",
200199
},
201200
serverID: otherServerID,
202201
version: "1.0.0",
@@ -217,9 +216,9 @@ func TestEditServerEndpoint(t *testing.T) {
217216
return "Bearer " + token
218217
}(),
219218
requestBody: apiv0.ServerJSON{
220-
Name: "io.github.domdomegg/nonexistent-server",
221-
Description: "Updated test server",
222-
Version: "1.0.0",
219+
Name: "io.github.domdomegg/nonexistent-server",
220+
Description: "Updated test server",
221+
Version: "1.0.0",
223222
},
224223
serverID: "550e8400-e29b-41d4-a716-446655440999", // Non-existent ID
225224
version: "1.0.0",
@@ -240,9 +239,9 @@ func TestEditServerEndpoint(t *testing.T) {
240239
return "Bearer " + token
241240
}(),
242241
requestBody: apiv0.ServerJSON{
243-
Name: "invalid-name-format", // Missing namespace/name format
244-
Description: "Test server",
245-
Version: "1.0.0",
242+
Name: "invalid-name-format", // Missing namespace/name format
243+
Description: "Test server",
244+
Version: "1.0.0",
246245
},
247246
serverID: testServerID,
248247
version: "1.0.0",
@@ -303,7 +302,6 @@ func TestEditServerEndpoint(t *testing.T) {
303302
assert.NoError(t, err)
304303
}
305304

306-
307305
// Create request
308306
url := "/v0/servers/" + tc.serverID
309307
if tc.version != "" {

internal/api/handlers/v0/publish.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,14 @@ func buildPermissionErrorMessage(attemptedResource string, permissions []auth.Pe
7575
permissionStrs = append(permissionStrs, perm.ResourcePattern)
7676
}
7777
}
78-
78+
7979
errorMsg := "You do not have permission to publish this server"
8080
if len(permissionStrs) > 0 {
8181
errorMsg += ". You have permission to publish: " + strings.Join(permissionStrs, ", ")
8282
} else {
8383
errorMsg += ". You do not have any publish permissions"
8484
}
8585
errorMsg += ". Attempting to publish: " + attemptedResource
86-
86+
8787
return errorMsg
8888
}

internal/api/handlers/v0/publish_integration_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,9 @@ func TestPublishIntegration(t *testing.T) {
160160

161161
t.Run("publish fails with invalid token", func(t *testing.T) {
162162
publishReq := apiv0.ServerJSON{
163-
Name: "io.github.domdomegg/test-server",
164-
Description: "Test server",
165-
Version: "1.0.0",
163+
Name: "io.github.domdomegg/test-server",
164+
Description: "Test server",
165+
Version: "1.0.0",
166166
}
167167

168168
body, err := json.Marshal(publishReq)
@@ -183,7 +183,7 @@ func TestPublishIntegration(t *testing.T) {
183183
publishReq := apiv0.ServerJSON{
184184
Name: "io.github.other/test-server",
185185
Description: "A test server",
186-
Version: "1.0.0",
186+
Version: "1.0.0",
187187
Repository: model.Repository{
188188
URL: "https://github.com/example/test-server",
189189
Source: "github",
@@ -219,8 +219,8 @@ func TestPublishIntegration(t *testing.T) {
219219
publishReq := apiv0.ServerJSON{
220220
Name: "io.github.domdomegg/airtable-mcp-server",
221221
Description: "A test server with MCPB package",
222-
Version: "1.7.2",
223-
Status: model.StatusActive,
222+
Version: "1.7.2",
223+
Status: model.StatusActive,
224224
Packages: []model.Package{
225225
{
226226
RegistryType: model.RegistryTypeMCPB,

0 commit comments

Comments
 (0)