Skip to content

fix(ls-remote): omit rolling/prerelease from JSON when false#9439

Merged
jdx merged 2 commits intomainfrom
claude/interesting-einstein-47e723
Apr 27, 2026
Merged

fix(ls-remote): omit rolling/prerelease from JSON when false#9439
jdx merged 2 commits intomainfrom
claude/interesting-einstein-47e723

Conversation

@jdx
Copy link
Copy Markdown
Owner

@jdx jdx commented Apr 27, 2026

Summary

  • mise ls-remote --json previously emitted "rolling":false,"prerelease":false on every entry, e.g. {"version":"1.0.0","rolling":false,"prerelease":false} — noisy for the vast majority of versions where neither flag carries signal.
  • Skip serialization of rolling and prerelease when false, matching the existing pattern used for the optional created_at, release_url, and checksum fields on VersionInfo.
  • #[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 set rolling: true (e.g. rust nightly/beta/stable) or prerelease: 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 backends
  • cargo test --all-features --bin mise — 785 passed, 0 failed
  • Manual: mise ls-remote dummy --json → fields omitted when false

🤖 Generated with Claude Code


Note

Low Risk
Low risk: only adjusts serde serialization for two boolean fields while preserving #[serde(default)] for backward-compatible deserialization.

Overview
VersionInfo now skips serializing rolling and prerelease when they are false, so JSON outputs and cached remote-version entries no longer include noisy "rolling":false/"prerelease":false fields.

Deserialization behavior is preserved via #[serde(default)], with a small helper (is_false) added to support the skip_serializing_if predicate.

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

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-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 27, 2026

Greptile Summary

This PR updates VersionInfo JSON serialization to omit rolling and prerelease fields when they are false, reducing noise in mise ls-remote --json output. It adds a small is_false serde helper and preserves #[serde(default)] for backwards-compatible deserialization of cached entries.

Confidence Score: 5/5

Safe to merge — serialization-only change with no behavioral impact; backward compatibility preserved via #[serde(default)].

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

Filename Overview
src/backend/mod.rs Adds skip_serializing_if = "is_false" to rolling and prerelease fields on VersionInfo, with a small is_false helper; #[serde(default)] retained for clean backward-compatible deserialization.

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
Loading

Reviews (2): Last reviewed commit: "Merge branch 'main' into claude/interest..." | Re-trigger Greptile

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

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.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 27, 2026

Hyperfine Performance

mise x -- echo

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%

@jdx jdx merged commit 8aa079c into main Apr 27, 2026
36 checks passed
@jdx jdx deleted the claude/interesting-einstein-47e723 branch April 27, 2026 21:51
mise-en-dev added a commit that referenced this pull request Apr 28, 2026
### 🚀 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>
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