Skip to content

fix(backend): filter pre-release versions with latest + install_before#7631

Merged
jdx merged 1 commit intojdx:mainfrom
koh-sh:fix/install-before-prerelease-filter
Jan 10, 2026
Merged

fix(backend): filter pre-release versions with latest + install_before#7631
jdx merged 1 commit intojdx:mainfrom
koh-sh:fix/install-before-prerelease-filter

Conversation

@koh-sh
Copy link
Contributor

@koh-sh koh-sh commented Jan 10, 2026

Summary

Fix pre-release versions being installed when using latest with install_before option.

Description

When installing a tool with latest without install_before, versions with suffixes like -dev or -beta are correctly excluded.

However, when install_before is set, these pre-release versions were also being considered as candidates. I believe the intended behavior is to only select stable versions, consistent with the behavior when install_before is not set.

P.S. The install_before option is a fantastic feature that I personally find very useful. Thank you!

Test

~/github/mise (git)-[fix/install-before-prerelease-filter] [2026-01-10 16:11:38]
% mise -v
              _                                        __
   ____ ___  (_)_______        ___  ____        ____  / /___ _________
  / __ `__ \/ / ___/ _ \______/ _ \/ __ \______/ __ \/ / __ `/ ___/ _ \
 / / / / / / (__  )  __/_____/  __/ / / /_____/ /_/ / / /_/ / /__/  __/
/_/ /_/ /_/_/____/\___/      \___/_/ /_/     / .___/_/\__,_/\___/\___/
                                            /_/                 by @jdx
2026.1.1 macos-arm64 (2026-01-08)
~/github/mise (git)-[fix/install-before-prerelease-filter] [2026-01-10 16:11:41]
% mise install ruby@latest -n
mise ruby@4.0.0                        ⇢ already installed
~/github/mise (git)-[fix/install-before-prerelease-filter] [2026-01-10 16:11:46]
% mise install ruby@latest --before 3d -n
mise ruby@4.1-dev                      ⇢ would install
~/github/mise (git)-[fix/install-before-prerelease-filter] [2026-01-10 16:11:49]
% mise run build
[build] $ cargo build --all-features
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 1.14s
~/github/mise (git)-[fix/install-before-prerelease-filter] [2026-01-10 16:11:55]
% ./target/debug/mise install ruby@latest -n
mise ruby@4.0.0                        ⇢ already installed
~/github/mise (git)-[fix/install-before-prerelease-filter] [2026-01-10 16:12:04]
% ./target/debug/mise install ruby@latest --before 3d -n
mise ruby@4.0.0                        ⇢ already installed
~/github/mise (git)-[fix/install-before-prerelease-filter] [2026-01-10 16:12:10]
%

Note

Ensures latest + --before resolves to a stable version (no pre-releases).

  • In latest_version_with_opts, replace manual date-filtering with list_versions_matching_with_opts("latest", before) and select via find_match_in_list
  • Aligns behavior with regular latest resolution by reusing the same matching/filtering path for date-constrained queries

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

Copilot AI review requested due to automatic review settings January 10, 2026 07:14
Copy link
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 fixes a bug where pre-release versions (e.g., versions with -dev, -beta, -rc suffixes) were being selected when using latest with the install_before option, which is inconsistent with the behavior when install_before is not set.

Changes:

  • Modified the latest_version_with_opts method to use list_versions_matching_with_opts instead of manual date filtering, ensuring pre-release versions are properly excluded

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jdx
Copy link
Owner

jdx commented Jan 10, 2026

bugbot run

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no bugs!

@jdx jdx merged commit 35bf233 into jdx:main Jan 10, 2026
41 of 42 checks passed
jdx pushed a commit that referenced this pull request Jan 13, 2026
### 🐛 Bug Fixes

- **(backend)** filter pre-release versions with latest + install_before
by @koh-sh in [#7631](#7631)
- **(docs)** formatting in configuration hierarchy section by
@jonathanagustin in [#7638](#7638)
- **(npm)** migrate npm publish to OIDC trusted publishing by @jdx in
[#7607](#7607)
- **(registry)** correct checkmake version test pattern by @jdx in
[#7632](#7632)
- **(release)** handle empty grep result in aqua-registry changelog by
@jdx in
[f45b4c6](f45b4c6)
- **(self-update)** self-update fails across year boundary due to semver
mismatch by @jdx in [#7611](#7611)
- **(tasks)** fix tool inheritance from intermediate parents by @chadxz
in [#7637](#7637)
- add `-test` to VERSION_REGEX prerelease filter by @belgio99 in
[#7647](#7647)

### 📚 Documentation

- **(tasks)** remove documentation for unimplemented features by
@turbocrime in [#7599](#7599)
- update `mise aliases` references to `mise tool-alias` by @muzimuzhi in
[#7615](#7615)
- use call operator in PowerShell profile example by @shina1024 in
[#7639](#7639)
- replace ASCII .pub key with binary .gpg for signed-by on Ubuntu/Debian
by @gmalinowski in [#7649](#7649)

### 🛡️ Security

- **(security)** prevent code execution from untrusted fork in
registry-comment workflow by @jdx in
[4a2441e](4a2441e)

### ◀️ Revert

- Revert "fix(release): handle empty grep result in aqua-registry
changelog" by @jdx in
[522ffdc](522ffdc)
- Revert "chore(release): include manually updated aqua-registry entries
in the changelog " by @jdx in
[1ebb943](1ebb943)

### 📦️ Dependency Updates

- update ghcr.io/jdx/mise:alpine docker digest to fbfffcf by
@renovate[bot] in [#7619](#7619)
- lock file maintenance by @renovate[bot] in
[#7646](#7646)

### 📦 Registry

- add hatoo/oha tool by @jylenhof in
[#7633](#7633)

### Chore

- **(registry)** fix registry comment workflow by @risu729 in
[#7554](#7554)
- **(release)** include manually updated aqua-registry entries in the
changelog by @risu729 in [#7603](#7603)

### New Contributors

- @belgio99 made their first contribution in
[#7647](#7647)
- @gmalinowski made their first contribution in
[#7649](#7649)
- @chadxz made their first contribution in
[#7637](#7637)
- @shina1024 made their first contribution in
[#7639](#7639)
- @jonathanagustin made their first contribution in
[#7638](#7638)
- @turbocrime made their first contribution in
[#7599](#7599)

## 📦 Aqua Registry Updates

#### New Packages (3)

- [`ampcode/zvelte-check`](https://github.com/ampcode/zvelte-check)
- [`nickel-lang/nickel`](https://github.com/nickel-lang/nickel)
- [`openshift/rosa`](https://github.com/openshift/rosa)
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.

3 participants