Skip to content

perf(versions-host): fetch version lists from static assets#10361

Merged
jdx merged 1 commit into
mainfrom
codex/use-static-version-assets
Jun 12, 2026
Merged

perf(versions-host): fetch version lists from static assets#10361
jdx merged 1 commit into
mainfrom
codex/use-static-version-assets

Conversation

@jdx

@jdx jdx commented Jun 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • fetch mise-versions TOML lists from /data/{tool}.toml so Cloudflare can serve them as static assets
  • keep GitHub metadata, attestations, and install tracking on the existing API routes
  • update the ls cache e2e guard for the new static asset URL

Validation

  • cargo fmt --check
  • cargo test versions_host
  • mise run test:e2e e2e/cli/test_ls_cache
  • live smoke: isolated target/debug/mise -v ls-remote bat logged GET https://mise-versions.jdx.dev/data/bat.toml 200 OK and version_list tool=bat outcome=success

This PR was generated by an AI coding assistant.


Note

Low Risk
Narrow URL-path change with a unit test and e2e update; depends on the host serving the same TOML at the new path.

Overview
Version list TOML for mise-versions is now loaded from /data/{tool}.toml instead of /tools/{tool}.toml, via a new version_list_url helper, so lists can be served as static CDN assets while parsing and caching behavior stay the same.

GitHub release metadata, attestations, and install tracking still use the existing /api/... routes. The test_ls_cache e2e assertion was updated to expect the new URL when checking that mise ls does not refetch the versions host after cache warming.

Reviewed by Cursor Bugbot for commit 56444eb. Bugbot is set up for automated code reviews on this repo. Configure here.

Summary by CodeRabbit

  • Refactor

    • Streamlined version metadata endpoint resolution to improve cache handling and consistency.
  • Tests

    • Updated validation tests to ensure proper cache detection for version metadata.

@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The PR migrates the versions TOML endpoint from /tools/{tool}.toml to /data/{tool}.toml by extracting URL construction into a version_list_url helper, updating its call site in list_versions, adding a unit test for the helper, and aligning the e2e cache test to verify the new endpoint.

Changes

Version list endpoint migration

Layer / File(s) Summary
Version list URL helper and unit test
src/versions_host.rs
New version_list_url helper builds the static /data/{tool}.toml asset URL; unit test validates the URL format for "node".
list_versions integration
src/versions_host.rs
list_versions now calls version_list_url(tool) instead of using an inline format! string.
E2E cache test endpoint validation
e2e/cli/test_ls_cache
Cache reuse check updated to detect requests to the new /data/bat.toml endpoint instead of /tools/bat.toml.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

  • jdx/mise#10256: Both PRs touch src/versions_host.rs's list_versions flow—this PR refactors URL construction to the /data/{tool}.toml endpoint, while that PR updates list_versions to emit structured logs around versions-host request outcomes.

Poem

🐰 A helper hops through code with grace,
URLs find their rightful place,
From /tools to /data we now go,
The versions flow, and tests all know!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: fetching version lists from static assets instead of the previous dynamic endpoint, which is the core optimization described across both modified files.
Docstring Coverage ✅ Passed Docstring coverage is 83.33% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps

greptile-apps Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR switches the version-list fetch URL from the dynamic /tools/{tool}.toml route to the static /data/{tool}.toml route on mise-versions.jdx.dev, allowing Cloudflare to serve those payloads as static assets. All other endpoints (GitHub metadata, attestations, install tracking) stay on their existing /api/ routes.

  • src/versions_host.rs: URL construction extracted into version_list_url, comment updated, and a unit test added for the new path; error handling, TOML parsing, caching, and rate-limiting logic are entirely untouched.
  • e2e/cli/test_ls_cache: The "must not re-fetch" guard is updated from /tools/bat.toml to /data/bat.toml to match the new URL.

Confidence Score: 5/5

Safe to merge — the change is a one-line URL path swap with a clean fallback (404 → Ok(None)) if the server-side path isn't live yet.

The diff is minimal: a URL constant changes, a small helper function is introduced, and both a unit test and an e2e guard are updated to match. Error handling, TOML parsing, in-process caching, and rate-limiting are all untouched. The 404 fallback means the client degrades gracefully even if the new /data/ path isn't deployed server-side yet.

No files require special attention.

Important Files Changed

Filename Overview
src/versions_host.rs URL for version list fetches changed from /tools/{tool}.toml to /data/{tool}.toml; URL logic extracted into version_list_url helper with a unit test; all parsing, caching, and error-handling logic is unchanged.
e2e/cli/test_ls_cache Negative guard updated from /tools/bat.toml to /data/bat.toml to match the new static asset path; no logic change to the test flow.

Reviews (1): Last reviewed commit: "perf(versions-host): fetch version lists..." | Re-trigger Greptile

@jdx jdx enabled auto-merge (squash) June 12, 2026 22:01
@jdx jdx merged commit ac042eb into main Jun 12, 2026
34 checks passed
@jdx jdx deleted the codex/use-static-version-assets branch June 12, 2026 22:02
@github-actions

Copy link
Copy Markdown

Hyperfine Performance

mise x -- echo

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.6.4 x -- echo 38.3 ± 10.1 22.8 82.1 1.70 ± 0.46
mise x -- echo 22.6 ± 1.3 20.1 31.2 1.00
✅ Performance improvement for x -- echo is 70%

mise env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.6.4 env 21.6 ± 1.2 19.3 27.8 1.00
mise env 25.0 ± 8.1 20.4 106.3 1.16 ± 0.38
⚠️ Inconclusive: env measured 16% slower, but hyperfine reported statistical outliers.

mise hook-env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.6.4 hook-env 40.8 ± 13.9 21.5 97.9 1.25 ± 0.67
mise hook-env 32.7 ± 13.5 20.7 98.9 1.00
✅ Performance improvement for hook-env is 25%

mise ls

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.6.4 ls 18.8 ± 1.4 15.6 25.8 1.00
mise ls 18.9 ± 1.1 16.1 25.6 1.00 ± 0.09

xtasks/test/perf

Command mise-2026.6.4 mise Variance
install (cached) 274ms ✅ 233ms +17%
ls (cached) 138ms 141ms -2%
bin-paths (cached) 225ms ✅ 187ms +20%
task-ls (cached) 303ms 275ms +10%

✅ Performance improvement: install cached is 17%
✅ Performance improvement: bin-paths cached is 20%

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant