Enrich ListRegistryEntries response with version metadata#754
Merged
Conversation
`GET /v1/registries/{name}/entries` returned only `(entryType, name,
version, sourceName)`. The admin UI that renders this view needs to
display the same per-version details available on
`GET /v1/sources/{name}/entries` — at minimum a human-readable title
and description.
Extend `ListEntriesByRegistry` to also select `v.title`,
`v.description`, `v.created_at`, `v.updated_at`, and expose them along
with `rs.position` (source priority within the registry) on
`RegistryEntryInfo`. Nullable columns map to empty strings via the
same pattern used in `impl_source.go`. The response shape stays flat
(one row per version) because this endpoint intentionally shows
cross-source rows unshadowed.
`/v1/sources/{name}/entries` and the upstream v0.1 consumer endpoints
are unchanged.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #754 +/- ##
==========================================
+ Coverage 60.40% 60.57% +0.16%
==========================================
Files 108 108
Lines 13041 10495 -2546
==========================================
- Hits 7878 6357 -1521
+ Misses 4610 3585 -1025
Partials 553 553 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GET /v1/registries/{name}/entriesnow returnstitle,description,createdAt,updatedAt, andpositionalongside the existingentryType,name,version, andsourceName.GET /v1/sources/{name}/entries, which the admin UI already relies on for the corresponding sources view..claude/rules/api.md§5 — so grouping stays a UI concern.Why
The admin UI lists all entries of a registry and needs to render title + description per entry. Those fields live on
entry_versionand were already selected byListEntriesBySource;ListEntriesByRegistrywas the only path that dropped them.createdAt/updatedAt/positionclose remaining metadata gaps between the two admin endpoints.The upstream v0.1 consumer endpoints (
/registry/{name}/v0.1/servers,/x/dev.toolhive/skills) already return description via their spec-shaped payloads — they are unchanged.Scope
database/queries/registry_entries.sql— extendListEntriesByRegistrySELECT.internal/db/sqlc/registry_entries.sql.go— regenerated.internal/service/service.go— new fields onRegistryEntryInfo.internal/service/db/impl_registry.go— map nullable columns, same pattern asimpl_source.go.internal/api/v1/routes_test.go— happy-path fixture + assertions cover the new fields.docs/thv-registry-api/*— swagger regenerated./v1/sources/{name}/entriesandSourceEntryInfoare untouched.positionis only added to the registry endpoint — it's the source's priority within a given registry (registry_source.position) and has no meaning in the source-centric view.Test plan
task lint-fix— cleantask testforinternal/api/v1/...andinternal/service/...— green (the only failure in the fulltask testrun was an unrelated testcontainers/docker timeout ininternal/sync/writer)task docker-up-detachedand hit the endpoint end-to-end:title,description,createdAt,updatedAt,positionall populate from the seeded file source;/v1/sources/{name}/entriesresponse shape unchanged.docs/thv-registry-api/swagger.yaml)🤖 Generated with Claude Code