fix(ls-remote): omit rolling/prerelease from JSON when false#9439
Conversation
These fields were always emitted in `mise ls-remote --json`, producing
noisy output like `{"version":"1.0.0","rolling":false,"prerelease":false}`
for the vast majority of versions where neither flag carries signal.
Skip serialization when the value is `false`, matching the existing
pattern used for the optional `created_at`, `release_url`, and `checksum`
fields. `#[serde(default)]` is preserved so previously-written cache
entries still deserialize cleanly.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Greptile SummaryThis PR updates Confidence Score: 5/5Safe to merge — serialization-only change with no behavioral impact; backward compatibility preserved via Single-file, two-line attribute change with an idiomatic serde helper. No logic changes, no security implications, and deserialization remains fully backward compatible. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[VersionInfo serialized to JSON] --> B{rolling == false?}
B -- Yes --> C[Omit rolling field]
B -- No --> D[Emit rolling: true]
A --> E{prerelease == false?}
E -- Yes --> F[Omit prerelease field]
E -- No --> G[Emit prerelease: true]
C --> H[Compact JSON output]
D --> H
F --> H
G --> H
Reviews (2): Last reviewed commit: "Merge branch 'main' into claude/interest..." | Re-trigger Greptile |
There was a problem hiding this comment.
Code Review
This pull request modifies the VersionInfo struct in src/backend/mod.rs to skip serialization of the rolling and prerelease boolean fields when they are false. A helper function is_false was added to facilitate this logic. I have no further feedback to provide.
Hyperfine Performance
|
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.4.24 x -- echo |
23.6 ± 0.2 | 23.0 | 24.5 | 1.00 |
mise x -- echo |
24.2 ± 0.3 | 23.6 | 27.4 | 1.02 ± 0.02 |
mise env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.4.24 env |
23.1 ± 0.5 | 22.5 | 28.4 | 1.00 |
mise env |
23.5 ± 0.2 | 22.9 | 24.8 | 1.02 ± 0.02 |
mise hook-env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.4.24 hook-env |
23.8 ± 0.2 | 23.2 | 25.3 | 1.00 |
mise hook-env |
24.4 ± 0.3 | 23.7 | 25.4 | 1.02 ± 0.01 |
mise ls
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.4.24 ls |
24.0 ± 0.3 | 23.4 | 27.9 | 1.00 |
mise ls |
24.7 ± 0.3 | 24.1 | 26.1 | 1.03 ± 0.02 |
xtasks/test/perf
| Command | mise-2026.4.24 | mise | Variance |
|---|---|---|---|
| install (cached) | 159ms | 165ms | -3% |
| ls (cached) | 81ms | 84ms | -3% |
| bin-paths (cached) | 83ms | 85ms | -2% |
| task-ls (cached) | 785ms | 781ms | +0% |
### 🚀 Features - **(task)** add --name-only flag to mise tasks ls by @jdx in [#9435](#9435) ### 🐛 Bug Fixes - **(Dockerfile)** install copr-cli via dnf for better dependency management by @bestagi in [#9421](#9421) - **(aqua)** drop empty-releases fallback to tags by @jdx in [#9443](#9443) - **(docs)** fix theme flicker on docs by @vhespanha in [#9427](#9427) - **(lockfile)** update global lockfile on upgrade by @jdx in [#9442](#9442) - **(ls-remote)** omit rolling/prerelease from JSON when false by @jdx in [#9439](#9439) - **(task)** support usage refs in dependency template tags by @jdx in [#9424](#9424) - **(task)** populate usage.cmd for subcommand-only tasks; share make_usage_ctx by @jdx in [#9431](#9431) - **(task)** resolve sandbox allow_read/allow_write against task dir by @jdx in [#9428](#9428) ### 📚 Documentation - **(site)** add self-hosted page tracker via Cloudflare Worker, drop GoatCounter by @jdx in [#9430](#9430) ### New Contributors - @vhespanha made their first contribution in [#9427](#9427) --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Summary
mise ls-remote --jsonpreviously emitted"rolling":false,"prerelease":falseon every entry, e.g.{"version":"1.0.0","rolling":false,"prerelease":false}— noisy for the vast majority of versions where neither flag carries signal.rollingandprereleasewhenfalse, matching the existing pattern used for the optionalcreated_at,release_url, andchecksumfields onVersionInfo.#[serde(default)]is preserved so previously-written remote-versions cache entries still deserialize cleanly.After this change, dummy output is
[{"version":"1.0.0"},{"version":"1.1.0"},{"version":"2.0.0"}]. Backends that legitimately setrolling: true(e.g.rustnightly/beta/stable) orprerelease: true(github/aqua) still emit the field.Test plan
mise run test:e2e cli/test_ls_remote— all assertions pass, including the existing"created_at"checks for github/npm/cargo/pipx backendscargo test --all-features --bin mise— 785 passed, 0 failedmise ls-remote dummy --json→ fields omitted when false🤖 Generated with Claude Code
Note
Low Risk
Low risk: only adjusts
serdeserialization for two boolean fields while preserving#[serde(default)]for backward-compatible deserialization.Overview
VersionInfonow skips serializingrollingandprereleasewhen they arefalse, so JSON outputs and cached remote-version entries no longer include noisy"rolling":false/"prerelease":falsefields.Deserialization behavior is preserved via
#[serde(default)], with a small helper (is_false) added to support theskip_serializing_ifpredicate.Reviewed by Cursor Bugbot for commit db84b9f. Bugbot is set up for automated code reviews on this repo. Configure here.