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

stacklok / toolhive / 21485790118
60%

Build:
DEFAULT BRANCH: main
Ran 29 Jan 2026 04:23PM UTC
Jobs 1
Files 484
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

29 Jan 2026 04:15PM UTC coverage: 60.439% (-0.03%) from 60.472%
21485790118

push

github

web-flow
fix(vmcp) - template validation with functions (#3492)

While I was working on stacklok/docs-website#367, I attempted to validate the documented composite tool which used the fromJson function. However, the ValidateTemplate function in composite_validation.go was parsing templates without registering the custom template functions available at runtime. This caused validation to reject valid templates with errors like:

function "fromJson" not defined
This PR fixes template validation failing for composite tools that use custom template functions like fromJson, json, and quote.

Solution: Consolidate template function definitions into a shared FuncMap() in pkg/templates/funcs.go. Both validation and runtime now import from this single source of truth, ensuring parity between what validates and what executes.


Changes
In commit 1:

Add e2e test that verifies VirtualMCPServer with fromJson templates becomes ready. This fails without the following commit.
In commit 2:

Add pkg/templates/funcs.go with shared FuncMap() containing json, quote, and fromJson
Update pkg/vmcp/composer/template_expander.go to use templates.FuncMap()
Update pkg/vmcp/config/composite_validation.go to use templates.FuncMap() in ValidateTemplate
Update pkg/templates/references.go to use FuncMap() in ExtractReferences

23 of 25 new or added lines in 4 files covered. (92.0%)

33 existing lines in 3 files now uncovered.

39209 of 64874 relevant lines covered (60.44%)

77.02 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
2
90.91
pkg/templates/funcs.go

Uncovered Existing Lines

Lines Coverage ∆ File
8
25.0
-4.44% pkg/client/manager.go
11
68.42
-14.47% pkg/client/discovery.go
14
66.48
-7.69% pkg/client/config.go
Jobs
ID Job ID Ran Files Coverage
1 21485790118.1 29 Jan 2026 04:23PM UTC 484
60.44
GitHub Action Run
Source Files on build 21485790118
  • Tree
  • List 484
  • Changed 8
  • Source Changed 3
  • Coverage Changed 8
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #21485790118
  • 3daefd3d on github
  • Prev Build on main (#21484983596)
  • Next Build on main (#21485843449)
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