Skip to content

feat(ls-remote): add prereleases setting and --prerelease flag#9415

Merged
jdx merged 2 commits intomainfrom
feat/ls-remote-prerelease-flag
Apr 26, 2026
Merged

feat(ls-remote): add prereleases setting and --prerelease flag#9415
jdx merged 2 commits intomainfrom
feat/ls-remote-prerelease-flag

Conversation

@jdx
Copy link
Copy Markdown
Owner

@jdx jdx commented Apr 26, 2026

Summary

Companion to #9329, which added per-tool prerelease = true opt-in for the github: and aqua: backends. That covers the case where a user wants pre-releases for one specific tool. This PR adds the global escape hatch — equivalent to setting prerelease = true on every tool — for consumers that mirror the full release catalog or want pre-release tags to surface in ls-remote without per-tool config.

The motivating case: the versions host pipeline calls mise ls-remote --json for every tracked tool to populate docs/*.toml. Per-tool config there isn't viable (≈900 tools), but without a global opt-in, mise filters every prerelease before emitting JSON, and the versions host can't carry the new prerelease = true field that jdx/mise-versions#135 just plumbed through.

Changes

  • New setting prereleases (MISE_PRERELEASES) in settings.toml. Layered into include_prereleases() ahead of the per-tool option, so flipping it acts like prerelease = true on every tool. Has no effect on backends that don't carry an upstream prerelease flag (e.g. github_tag version source — git tags don't carry the prerelease bit).

  • New --prerelease flag on mise ls-remote. Calls a small Settings::override_with helper that merges into the existing CLI_SETTINGS partial — Settings::reset replaces wholesale, which would clobber overrides installed earlier in startup like --offline / --quiet. The merge approach lets a subcommand layer one extra override on top.

  • Test for the global-setting path alongside the existing per-tool test in backend::tests.

Test plan

  • cargo test --bin mise backend:: — 193 pass
  • cargo test --bin mise config::settings — 22 pass (incl. test_settings_toml_is_sorted)
  • Smoke: mise ls-remote --help shows the new flag, mise ls-remote --json --prerelease github:cli/cli runs without error
  • CI

Compatibility

  • Default behavior unchanged: prereleases = false, prereleases stay filtered. All existing tool configs continue to work.
  • The per-tool prerelease = true option is unaffected — both paths feed into the same include_prereleases() helper, which now ORs them together.

Note

Medium Risk
Medium risk because it changes version filtering behavior and settings layering/caching for remote version listings (and latest/fuzzy resolution via include_prereleases), which could affect tool resolution outputs across backends when enabled.

Overview
Adds a new global prereleases setting (MISE_PRERELEASES) that, when enabled, makes include_prereleases() opt into upstream pre-release versions regardless of per-tool prerelease options.

Extends mise ls-remote with --prerelease, implemented by merging a CLI-layer settings override (Settings::override_with) so the flag can be applied without clobbering other startup overrides.

Updates generated CLI docs/usage spec accordingly and adds a regression test ensuring the global setting enables prerelease inclusion by default.

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

Companion to #9329. That PR added per-tool `prerelease = true` opt-in
for `github:` and `aqua:` backends; this PR adds a global escape hatch
so consumers that mirror the full release catalog (the versions host's
update pipeline, internal CI, anyone querying `ls-remote` ad-hoc
without per-tool config) can include pre-releases without listing every
tool.

- New `prereleases` setting (`MISE_PRERELEASES`). Layered into
  `include_prereleases()` ahead of the per-tool option, so flipping it
  acts like `prerelease = true` on every tool. Has no effect on backends
  that don't carry an upstream prerelease flag (e.g. `github_tag`).

- New `--prerelease` flag on `mise ls-remote`. Sets the setting for the
  duration of the command via a small `Settings::override_with` helper
  that merges into the existing `CLI_SETTINGS` partial — `Settings::reset`
  would clobber overrides installed earlier in startup like `--offline`
  and `--quiet`.

- Test for the global-setting path alongside the existing per-tool
  test in `backend::tests`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 26, 2026

Greptile Summary

Adds a global prereleases setting (MISE_PRERELEASES) and a --prerelease flag on mise ls-remote so that pre-release versions surface without per-tool config — the motivating case being the mise-versions pipeline that tracks ~900 tools. The implementation is clean: include_prereleases short-circuits on the global setting, Settings::override_with merges the flag into CLI_SETTINGS without clobbering earlier startup overrides, and default behavior is unchanged.

Confidence Score: 5/5

Safe to merge — default behavior is unchanged (prereleases still filtered by default) and the new flag/setting is purely opt-in.

No P0/P1 findings. The locking strategy in override_with is correct (consistent acquire order with try_get/reset), the override is applied before Config::get(), and the sorted-settings invariant is maintained. All changed files are straightforward additions.

No files require special attention.

Important Files Changed

Filename Overview
src/config/settings.rs Adds Settings::override_with helper that merges a partial into CLI_SETTINGS without clobbering other startup overrides (e.g. --offline); locking order (CLI_SETTINGS mutex → BASE_SETTINGS write) is consistent with try_get and reset, so no deadlock risk.
src/cli/ls_remote.rs Adds --prerelease flag to LsRemote; override is applied before Config::get() so the setting is active for all subsequent backend calls; asdf.rs companion updated correctly with prerelease: false.
src/backend/mod.rs Extends include_prereleases to short-circuit on Settings::get().prereleases before the per-tool option check; new regression test correctly uses Settings::reset to bracket the global-setting path.
settings.toml Adds [prereleases] block with description, docs, env var MISE_PRERELEASES, and type Bool; inserted in alphabetical order consistent with the sorted-settings test.
schema/mise.json Adds prereleases boolean property to the JSON schema with a clear description; correctly placed alphabetically.
src/cli/asdf.rs Adds prerelease: false to the LsRemote struct literal to satisfy the new required field; no functional change to the asdf compatibility shim.
docs/cli/ls-remote.md Generated doc updated to describe --prerelease flag; usage signature simplified to [FLAGS].

Sequence Diagram

sequenceDiagram
    participant User
    participant LsRemote
    participant Settings
    participant Backend

    User->>LsRemote: mise ls-remote --prerelease github:cli/cli
    LsRemote->>Settings: override_with(|s| s.prereleases = Some(true))
    Note over Settings: CLI_SETTINGS mutex locked<br/>partial.prereleases = Some(true)<br/>BASE_SETTINGS cleared
    LsRemote->>Settings: Config::get() → Settings::get()
    Settings-->>LsRemote: Arc<Settings> (prereleases=true)
    LsRemote->>Backend: list_remote_versions()
    Backend->>Settings: include_prereleases(&opts)
    Note over Settings: Settings::get().prereleases == true<br/>→ returns true immediately
    Backend-->>LsRemote: Vec<VersionInfo> (pre-releases included)
    LsRemote-->>User: output with pre-release versions
Loading

Reviews (2): Last reviewed commit: "[autofix.ci] apply automated fixes" | Re-trigger Greptile

jdx added a commit to jdx/mise-versions that referenced this pull request Apr 26, 2026
…140)

## Summary

Sibling to #135. That PR plumbed `prerelease = true` through the TOML
pipeline, but on its own the field is dead code: `mise ls-remote --json`
filters pre-release tags out before emitting JSON unless the caller has
opted in. With ~900 tools, per-tool config isn't viable.

[jdx/mise#9415](jdx/mise#9415) adds a global
`MISE_PRERELEASES` env var (and a matching `--prerelease` CLI flag) that
flips the filter for every tool at once.

## Changes

- **`.github/workflows/update.yml`** — set `MISE_PRERELEASES: "1"` at
the job env level. Covers the host-side `mise ls-remote --json` call in
`generate_toml_file` (the JSON path that actually feeds
`generate-toml.js`).

- **`scripts/update.sh`** — forward `-e MISE_PRERELEASES` into the
Docker container. Covers the plain-text `docker run jdxcode/mise -y
ls-remote` call in `fetch()`.

## Verification (after deploy)

After the next run, expect to see `prerelease = true` flags on tools
whose upstream releases are flagged as pre-releases — e.g. tools with
`-rc1` / `-beta` / `-dev.N` GitHub releases. Until then: zero hits,
despite #135 being merged. Confirmed against the most recent run
([24968319913](https://github.com/jdx/mise-versions/actions/runs/24968319913))
which touched 646 tools through the JSON path with zero `prerelease =
true` flags emitted.

## Sequencing

Optimistic — depends on:

1. A mise release containing jdx/mise#9415 in the host mise installed by
`aube install` / `mise.run`. (Today's host mise = v2026.4.23, which has
#9329 but not #9415.)
2. A rebuild of the `jdxcode/mise` Docker image with the same release
for the plain-text fallback path.

Until both ship, `MISE_PRERELEASES` is silently ignored — same TOML
output as today, no regression. Safe to merge whenever; it activates on
its own as soon as the upstream pieces land.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Low risk: only toggles an environment flag and forwards it into the
Dockerized `mise ls-remote` call, changing which versions are included
but not altering control flow or security-sensitive logic.
> 
> **Overview**
> Enables global inclusion of prerelease tags during the automated
versions update run by setting `MISE_PRERELEASES=1` in the `update`
GitHub Actions workflow.
> 
> Also forwards `MISE_PRERELEASES` into the `docker run jdxcode/mise ...
ls-remote` invocation in `scripts/update.sh`, allowing downstream TOML
generation to populate the new `prerelease = true` metadata when
upstream marks releases as prereleases.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
b8f30b5. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jdx jdx enabled auto-merge (squash) April 26, 2026 23:20
@github-actions
Copy link
Copy Markdown

Hyperfine Performance

mise x -- echo

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.4.22 x -- echo 21.8 ± 0.4 21.1 26.5 1.00
mise x -- echo 22.1 ± 0.4 21.5 26.6 1.02 ± 0.02

mise env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.4.22 env 21.4 ± 0.6 20.8 26.5 1.00
mise env 21.8 ± 1.0 21.0 31.7 1.02 ± 0.05

mise hook-env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.4.22 hook-env 22.1 ± 0.4 21.3 26.4 1.00
mise hook-env 22.4 ± 0.3 21.7 25.0 1.01 ± 0.02

mise ls

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.4.22 ls 22.3 ± 0.3 21.7 24.9 1.00
mise ls 22.9 ± 0.3 22.3 24.5 1.03 ± 0.02

xtasks/test/perf

Command mise-2026.4.22 mise Variance
install (cached) 164ms 158ms +3%
ls (cached) 78ms 81ms -3%
bin-paths (cached) 80ms 81ms -1%
task-ls (cached) 817ms 794ms +2%

@jdx jdx merged commit ced0e35 into main Apr 26, 2026
48 of 51 checks passed
@jdx jdx deleted the feat/ls-remote-prerelease-flag branch April 26, 2026 23:42
mise-en-dev added a commit that referenced this pull request Apr 27, 2026
### 🚀 Features

- **(ls-remote)** add `prereleases` setting and `--prerelease` flag by
@jdx in [#9415](#9415)

### 🐛 Bug Fixes

- **(http)** retry transient HTTP failures with backoff and warn on
rescue by @jdx in [#9414](#9414)
- **(release)** purge mise.en.dev CDN zone after each S3 publish by @jdx
in [#9416](#9416)

### 📚 Documentation

- prefix GitHub star count with ★ glyph by @jdx in
[#9417](#9417)
- update intro messaging by @jdx in
[#9418](#9418)
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