Conversation
Remove the `format` field and ToolHive format code path entirely. With only the upstream MCP registry format remaining, the field carried no information and added unnecessary complexity. Database: migration 000021 drops the `format` column and `registry_format_check` constraint from the `source` table. All SQL queries updated to remove format references. Go code: delete `SourceFormatToolHive`/`SourceFormatUpstream` constants, `Format` field from `SourceConfig`, `SourceCreateRequest`, `SourceInfo`, and `FetchResult`. Remove the `validateToolhiveFormatAndParse` function, `ValidateInlineDataWithFormat`, toolhive branch in `ValidateData`, and `converters` dependency. Simplify `ProcessInlineSourceData` signature. Tests: delete `testutils_toolhive.go` and its tests, replace toolhive-format test fixtures with upstream equivalents, update all mock expectations and struct literals. Configs/docs: remove `format:` from all example configs, Helm values, and documentation. Regenerate swagger docs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Implementation PlanThis is the plan that was used to implement this PR. ContextThe registry server supports two data formats: Approach: Hard-drop format entirely. Remove the Phase 1: Database MigrationCreate Up migration: ALTER TABLE source DROP CONSTRAINT registry_format_check;
ALTER TABLE source DROP COLUMN format;Note: Constraint is still named Down migration: ALTER TABLE source ADD COLUMN format TEXT;
ALTER TABLE source ADD CONSTRAINT registry_format_check
CHECK (format IS NULL OR format IN ('toolhive', 'upstream'));Phase 2: SQL QueriesRemove After editing, run Phase 3: Remove Format from Go Types
Phase 4: Remove ToolHive Test Utilities
Phase 5: Update TestsRemove Phase 6: Update Configs, Charts, and DocsRemove Phase 7: Dependency Cleanup and Verification
Backward Compatibility
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #724 +/- ##
=======================================
Coverage ? 60.28%
=======================================
Files ? 106
Lines ? 10244
Branches ? 0
=======================================
Hits ? 6176
Misses ? 3527
Partials ? 541 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
The `examples/config-docker-with-managed.yaml` example was added with a `format: upstream` field that is being removed by #724 (drop ToolHive registry format support). Drop the field here to avoid a merge conflict with that branch — regardless of merge order. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Three test fixtures still declared their inline file data in the old
ToolHive format (`{"servers":{}}` at root), which has been unsupported
since #724. They now emit the upstream format
(`{"meta":{...},"data":{"servers":[...]}}`) and include a placeholder
server entry because the validator rejects empty server lists.
Fixes the `TestAuthzIntegration_SourceCRUD` integration failure and the
`admin_claims_test.go` suite — both were failing with "meta is required"
/ "data is required" before, and then "upstream registry must contain
at least one server" once the envelope was added.
Three test fixtures still declared their inline file data in the old
ToolHive format (`{"servers":{}}` at root), which has been unsupported
since #724. They now emit the upstream format
(`{"meta":{...},"data":{"servers":[...]}}`) and include a placeholder
server entry because the validator rejects empty server lists.
Fixes the `TestAuthzIntegration_SourceCRUD` integration failure and the
`admin_claims_test.go` suite — both were failing with "meta is required"
/ "data is required" before, and then "upstream registry must contain
at least one server" once the envelope was added.
Summary
formatfield and ToolHive format code path entirely — with only the upstream MCP registry format remaining, the field carried no information and added unnecessary complexityformatcolumn from thesourceDB table via migration 000021toolhive-core/registry/convertersdependency and all toolhive parsing/validation codeformatfrom all configs, Helm values, docs, API types, and test infrastructureWhat changed
Database: Migration 000021 drops the
formatcolumn andregistry_format_checkconstraint from thesourcetable. All SQL queries insource.sqlupdated (8 queries).Go types removed:
SourceFormatToolHive/SourceFormatUpstreamconstants,Formatfield fromSourceConfig,SourceCreateRequest,SourceInfo,FetchResult, andsourceRow.ProcessInlineSourceDatasignature simplified from 4 args to 3.Code paths removed:
validateToolhiveFormatAndParse,ValidateInlineDataWithFormat, toolhive branch inValidateData, format validation in config/service layers, format dispatch in source handlers.Tests: Deleted
testutils_toolhive.go(216 lines) and its test file (347 lines). Replaced toolhive-format test fixtures with upstream equivalents across ~20 test files.Configs/docs: Removed
format:from all example configs, Helm chart values, CI values, and documentation. Regenerated swagger docs.Net: +267 / -1,601 lines across 68 files.
Backward compatibility
format:field are silently ignored (standard Viper behavior)"format"in JSON have the field silently dropped (standard Go JSON decoder)formatfield no longer appears in API responses (SourceInfo)Test plan
task lint-fix— 0 issuestask test— all tests passtask build— binary buildsformatcolumn gone, no format constraints, source data correctformatfield in source responses"format": "toolhive"in API request is silently ignored (201 success)Fixes #723
🤖 Generated with Claude Code