Skip to content

Re-export toolhive-core schemas as release assets#4983

Closed
rdimitrov wants to merge 1 commit intomainfrom
re-export-toolhive-core-schemas
Closed

Re-export toolhive-core schemas as release assets#4983
rdimitrov wants to merge 1 commit intomainfrom
re-export-toolhive-core-schemas

Conversation

@rdimitrov
Copy link
Copy Markdown
Member

Summary

Adds four schema JSON files (from stacklok/toolhive-core at the go.mod-pinned version) as release assets on every toolhive release:

  • toolhive-legacy-registry.schema.json
  • upstream-registry.schema.json
  • publisher-provided.schema.json
  • skill.schema.json

Motivation

Downstream consumers that need these schemas — notably stacklok/docs-website — currently perform a two-repo dance:

  1. Fetch toolhive's go.mod at the release tag
  2. Extract the github.com/stacklok/toolhive-core vX.Y.Z line
  3. Call gh release download against a different repo (toolhive-core)

Re-exporting the schemas here replaces that with a single gh release download against toolhive's release. The source of truth (which schemas go with which toolhive version) is now explicit rather than derived.

Paired with PR #4982 (CRD manifests as release asset). Together these two PRs eliminate all cross-repo and clone-based logic in docs-website PR #748, letting the docs regen pipeline work purely off gh release download.

What's in this PR

  • .github/workflows/releaser.yml: new "Download toolhive-core schemas at pinned version" step. Parses github.com/stacklok/toolhive-core from go.mod, downloads the four schema files into build/.
  • .goreleaser.yaml: four new release.extra_files entries so goreleaser uploads them.

Test plan

  • Verify on a test release that all four schemas appear as release assets
  • Confirm the go.mod-derived version matches what toolhive was compiled against
  • Confirm the existing release assets are unaffected

Local smoke test (requires a toolhive-core release token for gh release download):

```
CORE_VERSION=$(grep 'github.com/stacklok/toolhive-core' go.mod | awk '{print $2}' | head -1)
mkdir -p /tmp/build
gh release download "$CORE_VERSION" --repo stacklok/toolhive-core \
--pattern "*.schema.json" --dir /tmp/build
ls /tmp/build
```

Notes

If toolhive ever switches to a release model where the binaries aren't compiled against a concrete toolhive-core version (e.g., a replace directive in go.mod for development), this step would need a fallback. Not a concern today — the go.mod always pins a concrete version at release tags.

🤖 Generated with Claude Code

Reads the toolhive-core version from go.mod at release time, downloads
the four JSON schema files from that version of stacklok/toolhive-core,
and ships them alongside toolhive's own release assets.

Motivation: downstream consumers (notably stacklok/docs-website)
currently have to replicate this logic: read go.mod, derive the core
version, then fetch from a different repo's release. Re-exporting the
schemas here makes toolhive's release self-contained — one `gh release
download` call gets everything.

Paired with #4982 (CRD
manifests as release asset); together these eliminate the need for
docs-website to clone toolhive or hit a second repo during its
release-doc regeneration.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@rdimitrov rdimitrov requested a review from JAORMX as a code owner April 21, 2026 17:32
@github-actions github-actions Bot added the size/XS Extra small PR: < 100 lines changed label Apr 21, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.63%. Comparing base (63ee62a) to head (f1ec71a).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4983      +/-   ##
==========================================
- Coverage   69.63%   69.63%   -0.01%     
==========================================
  Files         552      552              
  Lines       55951    55951              
==========================================
- Hits        38962    38959       -3     
- Misses      13991    13993       +2     
- Partials     2998     2999       +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.

@rdimitrov
Copy link
Copy Markdown
Member Author

Consolidated into #4982 — both release-asset improvements are thematically the same ("ship more docs artifacts alongside each release") and easier to review together. No changes dropped; PR #4982 now contains both commits.

@rdimitrov rdimitrov closed this Apr 21, 2026
@rdimitrov rdimitrov deleted the re-export-toolhive-core-schemas branch April 21, 2026 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XS Extra small PR: < 100 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant