Skip to content

[plan] Fix Playwright version field to accept numeric types #8224

@github-actions

Description

@github-actions

Objective

Fix Playwright container version field to accept numeric types as advertised in schema, enabling version pinning with numeric values.

Context

The schema defines tools.playwright.version as "type": ["string", "number"] with examples including 1.41 and 20, but the implementation only handles strings. Numeric versions are silently ignored.

Location: pkg/parser/mcp.go:447

Current Implementation

if version, exists := toolConfig["version"]; exists {
    if versionStr, ok := version.(string); ok {  // ❌ Only string!
        // Version handling logic
    }
}

Recommended Fix

if version, exists := toolConfig["version"]; exists {
    var versionStr string
    switch v := version.(type) {
    case string:
        versionStr = v
    case int, int64, uint64:
        versionStr = fmt.Sprintf("%d", v)
    case float64:
        versionStr = fmt.Sprintf("%g", v)
    }
    if versionStr != "" {
        // Version handling logic
    }
}

Files to Modify

  • Update: pkg/parser/mcp.go (line 447)
  • Update: pkg/parser/mcp_test.go (add test cases)

Acceptance Criteria

  • String versions work: tools.playwright.version: "v1.41.0"
  • Integer versions work: tools.playwright.version: 20
  • Float versions work: tools.playwright.version: 1.41
  • Test cases cover all type scenarios
  • Playwright container configuration works with numeric versions

Estimated Effort

~10 minutes implementation
Related to #8221

AI generated by Plan Command for discussion #8218

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions