Skip to content

Add RegistryServerName to RunConfig for registry entry tracking#4696

Open
JAORMX wants to merge 1 commit intomainfrom
worktree-registry-server-name
Open

Add RegistryServerName to RunConfig for registry entry tracking#4696
JAORMX wants to merge 1 commit intomainfrom
worktree-registry-server-name

Conversation

@JAORMX
Copy link
Copy Markdown
Collaborator

@JAORMX JAORMX commented Apr 9, 2026

Summary

  • Running workloads need to be mapped back to their registry entry by name so downstream consumers (e.g. the registry export endpoint from RFC: Workload upgrade detection and application toolhive-rfcs#68) can look up server metadata without re-resolving the image reference.
  • Add a RegistryServerName field to RunConfig following the exact same pattern as RegistryAPIURL and RegistryURL: builder option, resolver helper, wiring through all three call sites (CLI, API, MCP handler), and regenerated OpenAPI docs.

Type of change

  • New feature

Test plan

  • Unit tests (task test)
  • Linting (task lint-fix)

Changes

File Change
pkg/runner/config.go Add RegistryServerName field with JSON/YAML tags
pkg/runner/config_builder.go Add WithRegistryServerName builder option and ResolveRegistryServerName helper
cmd/thv/app/run_flags.go Wire resolved name through CLI call site
pkg/api/v1/workload_service.go Wire resolved name through API call site
pkg/mcp/server/run_server.go Wire resolved name through MCP handler call site
pkg/runner/config_builder_test.go Table-driven tests for builder option and resolver
pkg/mcp/server/handler_test.go Extend existing registry URL test to cover server name
docs/server/* Regenerated OpenAPI docs

Does this introduce a user-facing change?

No. The field is populated automatically during server creation and serialized in RunConfig state. No new CLI flags or API parameters are added.

Generated with Claude Code

Running workloads need to be mapped back to their registry entry by
name so that downstream consumers (e.g. the registry export endpoint)
can look up server metadata. Add a RegistryServerName field to
RunConfig following the same pattern as RegistryAPIURL and RegistryURL:
builder option, resolver helper, wiring through all three call sites,
and regenerated OpenAPI docs.

Part of stacklok/toolhive-rfcs#68

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions github-actions bot added the size/S Small PR: 100-299 lines changed label Apr 9, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 9, 2026

Codecov Report

❌ Patch coverage is 76.92308% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.71%. Comparing base (3c5da31) to head (03aeacf).

Files with missing lines Patch % Lines
pkg/mcp/server/run_server.go 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4696      +/-   ##
==========================================
+ Coverage   68.66%   68.71%   +0.04%     
==========================================
  Files         509      509              
  Lines       52987    52999      +12     
==========================================
+ Hits        36384    36418      +34     
+ Misses      13782    13761      -21     
+ Partials     2821     2820       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/S Small PR: 100-299 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants