• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stacklok / toolhive / 19818082525
59%

Build:
DEFAULT BRANCH: main
Ran 01 Dec 2025 09:42AM UTC
Jobs 1
Files 388
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

01 Dec 2025 09:40AM UTC coverage: 50.025% (+0.04%) from 49.99%
19818082525

push

github

web-flow
Fix vMCP error on partially set operational config (#2813)

* Add integration test for partial operational config

Add a test case that loads YAML with partial operational config
(timeouts set, failure_handling omitted). This would have crashed
before the fix with "invalid health_check_interval: time: invalid
duration \"\"" because the old code unconditionally parsed empty
duration strings.

* Add operational config defaults to prevent vMCP crash

Problem:
Users specifying partial operational config in VirtualMCPServer CRD or
CLI YAML files caused vMCP to crash. For example:

```yaml
operational:
    timeouts:
	default: 45s
    # failure_handling not specified
```

This crashed with: "invalid health_check_interval: time: invalid duration \"\""

Root cause:
- The old transformOperational() unconditionally parsed duration fields
without checking for empty strings
- Kubernetes kubebuilder defaults only apply to fields present in YAML,
not nested objects that are omitted entirely
- Both CLI (YAML loader) and K8s (converter) paths were affected

Design decision - Centralized defaults vs runtime defaults:
We chose to centralize operational defaults in the config package rather
than handle zero values at runtime (like composite tools do with workflow
timeouts). The rationale:

Alternative considered:

A minimal fix would have been just adding empty-string guards:

```go
      if raw.FailureHandling.HealthCheckInterval != "" {
          healthCheckInterval, err = time.ParseDuration(...)
      }
```

This would fix the crash but leave zero values in config, requiring
downstream code to handle them. The centralized defaults approach is
more robust for partial configs.

* Simplify YAML loader by removing rawOperational

Remove the intermediate rawOperational struct and transformOperational
function. The code now unmarshals directly into OperationalConfig,
leveraging Duration.UnmarshalYAML for duration parsing.

This simplification is possible because:
- Duration... (continued)

35 of 35 new or added lines in 3 files covered. (100.0%)

11 existing lines in 2 files now uncovered.

25668 of 51310 relevant lines covered (50.03%)

60.93 hits per line

Uncovered Existing Lines

Lines Coverage ∆ File
2
94.67
-1.33% pkg/vmcp/composer/dag_executor.go
9
75.69
-0.11% cmd/thv-operator/api/v1alpha1/virtualmcpserver_webhook.go
Jobs
ID Job ID Ran Files Coverage
1 19818082525.1 01 Dec 2025 09:42AM UTC 388
50.03
GitHub Action Run
Source Files on build 19818082525
  • Tree
  • List 388
  • Changed 9
  • Source Changed 7
  • Coverage Changed 9
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #19818082525
  • b6db38f0 on github
  • Prev Build on main (#19808956701)
  • Next Build on main (#19819140098)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc