Skip to content

feat(ls-remote): add created_at timestamps to ls-remote --json for core plugins#7294

Merged
jdx merged 2 commits intomainfrom
feat/core-plugin-timestamps
Dec 14, 2025
Merged

feat(ls-remote): add created_at timestamps to ls-remote --json for core plugins#7294
jdx merged 2 commits intomainfrom
feat/core-plugin-timestamps

Conversation

@jdx
Copy link
Copy Markdown
Owner

@jdx jdx commented Dec 14, 2025

Summary

  • Add created_at timestamp support to mise ls-remote --json for 7 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 alongside version strings.

Example Output

$ mise ls-remote node --json | head -3
[{"version":"0.1.14","created_at":"2011-08-26"},{"version":"0.1.15","created_at":"2011-08-27"},{"version":"0.1.16","created_at":"2011-08-27"}]

Test plan

  • Run mise ls-remote node --json and verify created_at fields are populated
  • Run mise ls-remote zig --json and verify created_at fields are populated
  • Run mise ls-remote rust --json and verify created_at fields are populated (except nightly/beta/stable)
  • Run mise ls-remote bun --json and verify created_at fields are populated
  • Run mise ls-remote swift --json and verify created_at fields are populated
  • Run mise ls-remote elixir --json and verify created_at fields 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.

  • Backend:
    • Prefer versions host for metadata: call versions_host::list_versions(ba.short) first; fall back to _list_remote_versions_with_info.
    • Skip versions host for external plugins with non-default remotes (uses normalize_remote, full_to_url).
    • Cache remote versions via VersionCacheManager storing VersionInfo { version, created_at }.
  • Versions Host:
    • Switch to TOML endpoint https://mise-versions.jdx.dev/<tool>.toml; return Vec<VersionInfo> with created_at.
    • Add in-memory cache and rate-limit handling; trace/warn updates.
  • Core Plugins (timestamps added via _list_remote_versions_with_info):
    • node: read date from index.json and map to created_at.
    • zig: read date from download/index.json entries.
    • rust: use GitHub releases created_at (+ nightly/beta/stable without dates).
    • bun: use GitHub releases (strip bun-v prefix).
    • swift: use GitHub releases (strip swift-...-RELEASE).
    • erlang: use GitHub erlef/otp_builds when precompiled; kerl fallback without dates.
    • elixir: parse builds.txt (timestamp field) and map to created_at.
  • Registry:
    • Expose normalize_remote publicly.
  • Tests:
    • Update e2e/cli/test_ls_cache to expect requests to .../<tool>.toml.

Written by Cursor Bugbot for commit d49c2d2. This will update automatically on new commits. Configure here.

Copilot AI review requested due to automatic review settings December 14, 2025 20:24
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 returns Vec<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.

@jdx jdx changed the title feat(core): add created_at timestamps to ls-remote --json for core plugins feat(ls-remote): add created_at timestamps to ls-remote --json for core plugins Dec 14, 2025
Comment thread src/plugins/core/elixir.rs Outdated
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Dec 14, 2025

Hyperfine Performance

mise x -- echo

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%

@jdx jdx force-pushed the feat/core-plugin-timestamps branch from aa328c1 to 09ba2ac Compare December 14, 2025 20:44
Comment thread src/versions_host.rs Outdated
Comment thread src/versions_host.rs
@jdx jdx force-pushed the feat/core-plugin-timestamps branch from 09ba2ac to fb856c6 Compare December 14, 2025 20:55
} else {
None
}
})
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

@jdx jdx force-pushed the feat/core-plugin-timestamps branch 3 times, most recently from b43b06f to 304607f Compare December 14, 2025 21:17
Comment thread src/backend/mod.rs
…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>
@jdx jdx force-pushed the feat/core-plugin-timestamps branch from 304607f to 40827c9 Compare December 14, 2025 21:40
Comment thread src/versions_host.rs
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>
@jdx jdx enabled auto-merge (squash) December 14, 2025 21:59
@jdx jdx merged commit ff47a21 into main Dec 14, 2025
28 checks passed
@jdx jdx deleted the feat/core-plugin-timestamps branch December 14, 2025 21:59
jdx pushed a commit that referenced this pull request Dec 14, 2025
### 🚀 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)
jdx added a commit that referenced this pull request Dec 15, 2025
## 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>
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.

2 participants