feat(ls-remote): add created_at timestamps to ls-remote --json for core plugins#7294
feat(ls-remote): add created_at timestamps to ls-remote --json for core plugins#7294
Conversation
There was a problem hiding this comment.
Pull request overview
This PR enhances the mise ls-remote --json command by adding created_at timestamp fields to version metadata for 7 core plugins (Node.js, Zig, Rust, Bun, Swift, Erlang, and Elixir). Each plugin now implements _list_remote_versions_with_info() to provide structured version information including timestamps, while maintaining backward compatibility through the existing _list_remote_versions() method that extracts version strings from the enriched data.
Key changes:
- Introduced
_list_remote_versions_with_info()method that returnsVec<VersionInfo>containing version strings and optional timestamps - Modified
_list_remote_versions()to delegate to the new method and extract version strings - Each plugin extracts timestamps from their respective data sources (API responses, JSON indexes, or text files)
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/plugins/core/node.rs | Extracts date field from nodejs.org distribution index and maps to VersionInfo |
| src/plugins/core/zig.rs | Parses date field from ziglang.org index.json for each version |
| src/plugins/core/rust.rs | Extracts created_at from GitHub releases; special versions (nightly/beta/stable) have no timestamp |
| src/plugins/core/bun.rs | Extracts created_at from GitHub releases after stripping "bun-v" prefix |
| src/plugins/core/swift.rs | Extracts created_at from GitHub releases after filtering tag names |
| src/plugins/core/erlang.rs | Extracts created_at from GitHub releases when using prebuilt binaries; None when compiling from source |
| src/plugins/core/elixir.rs | Parses timestamps from builds.hex.pm builds.txt format |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Hyperfine Performance
|
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2025.12.6 x -- echo |
21.7 ± 0.7 | 20.7 | 27.7 | 1.00 |
mise x -- echo |
22.8 ± 0.5 | 21.2 | 26.5 | 1.05 ± 0.04 |
mise env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2025.12.6 env |
21.2 ± 0.4 | 20.4 | 25.6 | 1.00 |
mise env |
22.1 ± 0.5 | 21.0 | 24.1 | 1.04 ± 0.03 |
mise hook-env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2025.12.6 hook-env |
21.3 ± 0.4 | 20.3 | 22.7 | 1.00 |
mise hook-env |
22.4 ± 0.5 | 21.1 | 23.7 | 1.05 ± 0.03 |
mise ls
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2025.12.6 ls |
17.9 ± 0.4 | 17.0 | 20.2 | 1.00 |
mise ls |
18.9 ± 0.5 | 17.7 | 22.8 | 1.06 ± 0.03 |
xtasks/test/perf
| Command | mise-2025.12.6 | mise | Variance |
|---|---|---|---|
| install (cached) | 113ms | 114ms | +0% |
| ls (cached) | 67ms | 68ms | -1% |
| bin-paths (cached) | 75ms | 74ms | +1% |
| task-ls (cached) | 443ms | 452ms | -1% |
aa328c1 to
09ba2ac
Compare
09ba2ac to
fb856c6
Compare
| } else { | ||
| None | ||
| } | ||
| }) |
There was a problem hiding this comment.
Bug: Elixir parsing may drop versions with fewer fields
The parsing logic now requires at least 3 whitespace-separated fields per line in builds.txt, whereas the old code only required 2 fields (using split_once(' ')). If any lines in the Elixir builds.txt file have only "version hash" format without a timestamp field, those versions will be silently filtered out and not included in the available versions list. The filter_map returns None for lines with parts.len() < 3, effectively dropping those versions.
b43b06f to
304607f
Compare
…ugins Add created_at timestamp support to the following core plugins: - Node.js: extracts date from nodejs.org/dist/index.json - Zig: extracts date from ziglang.org/download/index.json - Rust: extracts created_at from GitHub releases - Bun: extracts created_at from GitHub releases - Swift: extracts created_at from GitHub releases - Erlang: extracts created_at from GitHub releases (when compile=false) - Elixir: extracts timestamp from builds.hex.pm/builds/elixir/builds.txt Each plugin now implements _list_remote_versions_with_info() to provide version metadata. This allows `mise ls-remote --json` to include created_at timestamps for these tools. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
304607f to
40827c9
Compare
The versions host has a .toml endpoint that includes created_at timestamps. Use this instead of plain text to ensure timestamps are available when the versions host succeeds. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
### 🚀 Features - **(java)** add created_at support to ls-remote --json by @jdx in [#7297](#7297) - **(ls-remote)** add created_at timestamps to ls-remote --json for more backends by @jdx in [#7295](#7295) - **(ls-remote)** add created_at timestamps to ls-remote --json for core plugins by @jdx in [#7294](#7294) - **(registry)** add --json flag to registry command by @jdx in [#7290](#7290) - **(ruby)** add created_at timestamps to ls-remote --json by @jdx in [#7296](#7296) ### 🐛 Bug Fixes - **(spm)** recursively update submodules after checkout by @JFej in [#7292](#7292) - prioritize raw task output over task_output setting by @skorfmann in [#7286](#7286) ### New Contributors - @skorfmann made their first contribution in [#7286](#7286) - @JFej made their first contribution in [#7292](#7292)
## Summary Add the ability to filter tool versions by release date, similar to npm's `--before` flag. This enables reproducible builds and supply-chain security by ensuring only versions released before a certain date are considered. **Features:** - New `install_before` setting (env: `MISE_INSTALL_BEFORE`) - New `--before` CLI flag for `install`, `upgrade`, and `use` commands - Supports absolute dates (`2024-06-01`) and relative durations (`90d`, `1y`) - Only filters fuzzy version requests (`node@20`, `latest`) - explicit versions like `node@22.5.0` are not filtered **Usage examples:** ```bash # Install node version released before June 2024 mise install node@20 --before 2024-06-01 # Use relative duration (90 days ago) mise upgrade --before 90d # Set globally via environment variable export MISE_INSTALL_BEFORE="2024-06-01" mise install node@latest ``` **Depends on:** #7294 (for versions_host timestamps) ## Test plan - [x] Unit tests pass - [x] E2E test added (`test_install_before`) - [ ] Manual testing with various date formats - [ ] Test with backends that provide timestamps 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Adds date-aware version resolution/filtering across install/upgrade/use via `--before` and `MISE_INSTALL_BEFORE`, with docs, schema, man, completions, and tests updated. > > - **Core resolution**: > - Introduce `ResolveOptions.before_date` and date parsing (`parse_into_timestamp`). > - Add backend helpers: `list_versions_matching_with_opts` and `latest_version_with_opts` using `VersionInfo.created_at`. > - Apply date filter in `ToolVersion::resolve`, `latest_version_with_opts`, and outdated checks. > - **CLI**: > - Add `--before <BEFORE>` to `install`, `upgrade`, and `use`; wire through install/upgrade flows. > - Respect explicit pinned versions when filtering. > - **Settings/Schema**: > - New `settings.install_before` (env: `MISE_INSTALL_BEFORE`) in `settings.toml` and `schema/mise.json`. > - **Docs/UX**: > - Update `docs/cli/*`, `man/man1/mise.1`, `mise.usage.kdl`, and Fig completions to document `--before`. > - **Backends**: > - Use `VersionInfo::filter_by_date`; core Rust plugin and outdated logic accept `ResolveOptions`. > - **Tests**: > - Add e2e `e2e/cli/test_install_before` for flag and env behavior. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit c1f3020. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Summary
created_attimestamp support tomise ls-remote --jsonfor 7 core plugins:datefrom nodejs.org/dist/index.jsondatefrom ziglang.org/download/index.jsoncreated_atfrom GitHub releasescreated_atfrom GitHub releasescreated_atfrom GitHub releasescreated_atfrom GitHub releases (whencompile=false)Each plugin now implements
_list_remote_versions_with_info()to provide version metadata alongside version strings.Example Output
Test plan
mise ls-remote node --jsonand verifycreated_atfields are populatedmise ls-remote zig --jsonand verifycreated_atfields are populatedmise ls-remote rust --jsonand verifycreated_atfields are populated (except nightly/beta/stable)mise ls-remote bun --jsonand verifycreated_atfields are populatedmise ls-remote swift --jsonand verifycreated_atfields are populatedmise ls-remote elixir --jsonand verifycreated_atfields are populated🤖 Generated with Claude Code
Note
Adds created_at timestamps to ls-remote --json by preferring the versions host TOML endpoint and implementing _list_remote_versions_with_info across core plugins.
versions_host::list_versions(ba.short)first; fall back to_list_remote_versions_with_info.normalize_remote,full_to_url).VersionCacheManagerstoringVersionInfo { version, created_at }.https://mise-versions.jdx.dev/<tool>.toml; returnVec<VersionInfo>withcreated_at._list_remote_versions_with_info):node: readdatefromindex.jsonand map tocreated_at.zig: readdatefromdownload/index.jsonentries.rust: use GitHub releasescreated_at(+ nightly/beta/stable without dates).bun: use GitHub releases (stripbun-vprefix).swift: use GitHub releases (stripswift-...-RELEASE).erlang: use GitHuberlef/otp_buildswhen precompiled; kerl fallback without dates.elixir: parsebuilds.txt(timestamp field) and map tocreated_at.normalize_remotepublicly.e2e/cli/test_ls_cacheto expect requests to.../<tool>.toml.Written by Cursor Bugbot for commit d49c2d2. This will update automatically on new commits. Configure here.