Skip to content

Comments

fix(install): use version_expr for Flutter to fix version resolution#8081

Merged
jdx merged 1 commit intomainfrom
fix/flutter-version-resolution
Feb 10, 2026
Merged

fix(install): use version_expr for Flutter to fix version resolution#8081
jdx merged 1 commit intomainfrom
fix/flutter-version-resolution

Conversation

@jdx
Copy link
Owner

@jdx jdx commented Feb 10, 2026

Summary

  • Flutter's Google API returns releases in newest-first order, which causes mise install flutter to resolve to an old version (3.22.1) instead of the latest (3.38.x)
  • Switch from version_json_path to version_expr with sortVersions() to ensure proper ascending semver order
  • Adds a unit test for the Flutter version_expr parsing

Fixes #7863 (comment)

Also submitted jdx/expr.rs#23 to fix braceless predicate parsing in expr.rs (Go expr-lang compatibility), which is why this PR uses {#.channel == "stable"} with braces.

Test plan

  • Unit test test_parse_flutter_with_version_expr verifies correct filtering and sorting
  • All existing tests pass
  • Linting passes

🤖 Generated with Claude Code


Note

Low Risk
Low risk: registry config change and a new unit test; behavior change is limited to how Flutter versions are extracted/sorted from the upstream JSON.

Overview
Fixes Flutter version resolution by switching the registry backend from version_json_path to a version_expr that filters stable releases and applies sortVersions() so installs pick the latest stable version.

Adds a unit test (test_parse_flutter_with_version_expr) to validate the expr-based filtering/sorting behavior against Flutter-style JSON.

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

Copilot AI review requested due to automatic review settings February 10, 2026 11:53
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @jdx, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request resolves an issue with Flutter version resolution in mise by switching to version_expr and adding a unit test to ensure correct version ordering. This change ensures that the latest stable version of Flutter is installed.

Highlights

  • Version Resolution: Addresses an issue where mise install flutter was resolving to an older version of Flutter due to the order of releases returned by Google's API.
  • Version Expression: Switched from version_json_path to version_expr using sortVersions() to ensure proper ascending semver order for Flutter versions.
  • Unit Test: Added a unit test (test_parse_flutter_with_version_expr) to verify the correct filtering and sorting of Flutter versions.
Changelog
  • registry/flutter.toml
    • Switched from version_json_path to version_expr to ensure proper semver sorting of Flutter versions.
  • src/backend/version_list.rs
    • Added a unit test to verify correct parsing of Flutter versions using version_expr.
Activity
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

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

Updates Flutter’s version resolution to correctly select the latest stable release by using an expression-based extractor that filters + semver-sorts versions.

Changes:

  • Switch Flutter registry entry from version_json_path to version_expr using sortVersions().
  • Add a unit test validating version_expr filtering (stable-only) and ascending semver ordering.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/backend/version_list.rs Adds a regression/unit test to ensure version_expr correctly filters and sorts Flutter releases.
registry/flutter.toml Updates Flutter backend config to use version_expr with filtering + semver sorting so “latest” resolves correctly.

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

@@ -4,7 +4,7 @@ description = "Flutter is an open source framework for building beautiful, nativ
full = "http:flutter"

[backends.options]
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

The version_expr is non-trivial and encodes an important behavioral assumption (stable-only filtering + ascending semver order so resolution picks the latest). Consider adding a brief comment above version_expr explaining (1) why sorting is necessary for Flutter’s newest-first API response and (2) why the predicate uses braces for expr-lang compatibility, so future maintainers don’t ‘simplify’ it back and reintroduce the bug.

Suggested change
[backends.options]
[backends.options]
# Note: Flutter's releases API returns newest-first; we filter to "stable" and then sort
# versions in ascending semver so resolution sees the latest correctly. The { ... } lambdas
# are required for expr-lang compatibility; do not simplify this predicate shape.

Copilot uses AI. Check for mistakes.
Comment on lines 361 to 366
let versions = parse_version_list(
content,
None,
None,
Some(r#"sortVersions(map(filter(fromJSON(body).releases, {#.channel == "stable"}), {#.version}))"#),
)
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

This test embeds the same version_expr string that is now also in registry/flutter.toml. To reduce the risk of them drifting out of sync, consider defining a local const FLUTTER_VERSION_EXPR: &str = ...; in the test module (or otherwise centralizing it for tests) and referencing that constant here.

Copilot uses AI. Check for mistakes.
Flutter's API returns releases in newest-first order, which causes
`mise install flutter` to resolve to an old version (3.22.1) instead
of latest (3.38.x). Switch from version_json_path to version_expr
with sortVersions() to ensure proper ascending semver order.

Fixes #7863 (comment)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jdx jdx force-pushed the fix/flutter-version-resolution branch from 71fb1b3 to 9af283d Compare February 10, 2026 11:55
Copy link
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 fixes an issue with Flutter version resolution by switching from version_json_path to version_expr. This allows for proper sorting of versions, as the Flutter API returns them in newest-first order. The change is accompanied by a new unit test that validates the filtering and sorting logic. The changes look good and effectively address the problem. I have one minor suggestion to improve the readability of the new test case.

Comment on lines +352 to +366
fn test_parse_flutter_with_version_expr() {
let content = r#"{
"releases": [
{"version": "3.38.7", "channel": "stable"},
{"version": "3.41.0-0.0.pre", "channel": "beta"},
{"version": "3.38.6", "channel": "stable"},
{"version": "1.0.0", "channel": "stable"}
]
}"#;
let versions = parse_version_list(
content,
None,
None,
Some(r#"fromJSON(body).releases | filter({#.channel == "stable"}) | map({#.version}) | sortVersions()"#),
)
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

To improve readability, consider extracting the complex version_expr string into a constant. This makes the parse_version_list call cleaner and the expression easier to manage.

Suggested change
fn test_parse_flutter_with_version_expr() {
let content = r#"{
"releases": [
{"version": "3.38.7", "channel": "stable"},
{"version": "3.41.0-0.0.pre", "channel": "beta"},
{"version": "3.38.6", "channel": "stable"},
{"version": "1.0.0", "channel": "stable"}
]
}"#;
let versions = parse_version_list(
content,
None,
None,
Some(r#"fromJSON(body).releases | filter({#.channel == "stable"}) | map({#.version}) | sortVersions()"#),
)
fn test_parse_flutter_with_version_expr() {
const FLUTTER_VERSION_EXPR: &str = r#"sortVersions(map(filter(fromJSON(body).releases, {#.channel == "stable"}), {#.version}))"#;
let content = r#"{
"releases": [
{"version": "3.38.7", "channel": "stable"},
{"version": "3.41.0-0.0.pre", "channel": "beta"},
{"version": "3.38.6", "channel": "stable"},
{"version": "1.0.0", "channel": "stable"}
]
}"#;
let versions = parse_version_list(
content,
None,
None,
Some(FLUTTER_VERSION_EXPR),
)

@github-actions
Copy link

Hyperfine Performance

mise x -- echo

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.2.8 x -- echo 21.4 ± 0.3 20.8 22.7 1.00
mise x -- echo 21.5 ± 0.6 20.9 28.3 1.01 ± 0.03

mise env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.2.8 env 20.8 ± 0.2 20.4 22.1 1.00
mise env 21.1 ± 0.4 20.4 22.4 1.01 ± 0.02

mise hook-env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.2.8 hook-env 21.5 ± 0.3 20.9 23.4 1.00
mise hook-env 21.7 ± 0.4 21.1 25.8 1.01 ± 0.03

mise ls

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.2.8 ls 19.8 ± 0.3 19.3 21.2 1.00
mise ls 19.8 ± 0.3 19.3 21.2 1.00 ± 0.02

xtasks/test/perf

Command mise-2026.2.8 mise Variance
install (cached) 117ms 117ms +0%
ls (cached) 73ms 74ms -1%
bin-paths (cached) 76ms 76ms +0%
task-ls (cached) 532ms 536ms +0%

@jdx jdx merged commit d304e03 into main Feb 10, 2026
63 of 67 checks passed
@jdx jdx deleted the fix/flutter-version-resolution branch February 10, 2026 12:28
jdx pushed a commit that referenced this pull request Feb 12, 2026
### 🚀 Features

- **(activate)** add shims directory as fallback when auto-install is
enabled by @ctaintor in [#8106](#8106)
- **(env)** add `tools` variable to tera template context by @jdx in
[#8108](#8108)
- **(set)** add --stdin flag for multiline environment variables by @jdx
in [#8110](#8110)

### 🐛 Bug Fixes

- **(backend)** improve conda patchelf and dependency resolution for
complex packages by @jdx in
[#8087](#8087)
- **(ci)** fix validate-new-tools grep pattern for test field by @jdx in
[#8100](#8100)
- **(config)** make MISE_OFFLINE work correctly by gracefully skipping
network calls by @jdx in [#8109](#8109)
- **(github)** skip v prefix for "latest" version by @jdx in
[#8105](#8105)
- **(gitlab)** resolve tool options from config for aliased tools by
@jdx in [#8084](#8084)
- **(install)** use version_expr for Flutter to fix version resolution
by @jdx in [#8081](#8081)
- **(registry)** add Linux support for tuist by @fortmarek in
[#8102](#8102)
- **(release)** write release notes to file instead of capturing stdout
by @jdx in [#8086](#8086)
- **(upgrade)** tools are not uninstalled properly due to outdated
symlink by @roele in [#8099](#8099)
- **(upgrade)** ensure uninstallation failure does not leave invalid
symlinks by @roele in [#8101](#8101)
- SLSA for in-toto statement with no signatures by @gerhard in
[#8094](#8094)
- Vfox Plugin Auto-Installation for Environment Directives by @pose in
[#8035](#8035)

### 📚 Documentation

- use mise activate for PowerShell in getting-started by @rileychh in
[#8112](#8112)

### 📦 Registry

- add conda backend for mysql by @jdx in
[#8080](#8080)
- add conda backends for 10 asdf-only tools by @jdx in
[#8083](#8083)
- added podman-tui by @tony-sol in
[#8098](#8098)

### Chore

- sort settings.toml alphabetically and add test by @jdx in
[#8111](#8111)

### New Contributors

- @ctaintor made their first contribution in
[#8106](#8106)
- @rileychh made their first contribution in
[#8112](#8112)
- @fortmarek made their first contribution in
[#8102](#8102)
- @pose made their first contribution in
[#8035](#8035)
- @gerhard made their first contribution in
[#8094](#8094)

## 📦 Aqua Registry Updates

#### New Packages (2)

- [`entireio/cli`](https://github.com/entireio/cli)
-
[`rmitchellscott/reManager`](https://github.com/rmitchellscott/reManager)

#### Updated Packages (1)

- [`atuinsh/atuin`](https://github.com/atuinsh/atuin)
jdx pushed a commit that referenced this pull request Feb 12, 2026
### 🚀 Features

- **(activate)** add shims directory as fallback when auto-install is
enabled by @ctaintor in [#8106](#8106)
- **(env)** add `tools` variable to tera template context by @jdx in
[#8108](#8108)
- **(set)** add --stdin flag for multiline environment variables by @jdx
in [#8110](#8110)

### 🐛 Bug Fixes

- **(backend)** improve conda patchelf and dependency resolution for
complex packages by @jdx in
[#8087](#8087)
- **(ci)** fix validate-new-tools grep pattern for test field by @jdx in
[#8100](#8100)
- **(config)** make MISE_OFFLINE work correctly by gracefully skipping
network calls by @jdx in [#8109](#8109)
- **(github)** skip v prefix for "latest" version by @jdx in
[#8105](#8105)
- **(gitlab)** resolve tool options from config for aliased tools by
@jdx in [#8084](#8084)
- **(install)** use version_expr for Flutter to fix version resolution
by @jdx in [#8081](#8081)
- **(registry)** add Linux support for tuist by @fortmarek in
[#8102](#8102)
- **(release)** write release notes to file instead of capturing stdout
by @jdx in [#8086](#8086)
- **(upgrade)** tools are not uninstalled properly due to outdated
symlink by @roele in [#8099](#8099)
- **(upgrade)** ensure uninstallation failure does not leave invalid
symlinks by @roele in [#8101](#8101)
- SLSA for in-toto statement with no signatures by @gerhard in
[#8094](#8094)
- Vfox Plugin Auto-Installation for Environment Directives by @pose in
[#8035](#8035)

### 📚 Documentation

- use mise activate for PowerShell in getting-started by @rileychh in
[#8112](#8112)

### 📦 Registry

- add conda backend for mysql by @jdx in
[#8080](#8080)
- add conda backends for 10 asdf-only tools by @jdx in
[#8083](#8083)
- added podman-tui by @tony-sol in
[#8098](#8098)

### Chore

- sort settings.toml alphabetically and add test by @jdx in
[#8111](#8111)

### New Contributors

- @ctaintor made their first contribution in
[#8106](#8106)
- @rileychh made their first contribution in
[#8112](#8112)
- @fortmarek made their first contribution in
[#8102](#8102)
- @pose made their first contribution in
[#8035](#8035)
- @gerhard made their first contribution in
[#8094](#8094)

## 📦 Aqua Registry Updates

#### New Packages (2)

- [`entireio/cli`](https://github.com/entireio/cli)
-
[`rmitchellscott/reManager`](https://github.com/rmitchellscott/reManager)

#### Updated Packages (1)

- [`atuinsh/atuin`](https://github.com/atuinsh/atuin)
lucasew pushed a commit to lucasew/CONTRIB-mise that referenced this pull request Feb 18, 2026
…dx#8081)

## Summary
- Flutter's Google API returns releases in newest-first order, which
causes `mise install flutter` to resolve to an old version (3.22.1)
instead of the latest (3.38.x)
- Switch from `version_json_path` to `version_expr` with
`sortVersions()` to ensure proper ascending semver order
- Adds a unit test for the Flutter version_expr parsing

Fixes
jdx#7863 (comment)

Also submitted jdx/expr.rs#23 to fix braceless
predicate parsing in expr.rs (Go expr-lang compatibility), which is why
this PR uses `{#.channel == "stable"}` with braces.

## Test plan
- [x] Unit test `test_parse_flutter_with_version_expr` verifies correct
filtering and sorting
- [x] All existing tests pass
- [x] Linting passes

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Low risk: registry config change and a new unit test; behavior change
is limited to how Flutter versions are extracted/sorted from the
upstream JSON.
> 
> **Overview**
> Fixes Flutter version resolution by switching the registry backend
from `version_json_path` to a `version_expr` that filters `stable`
releases and applies `sortVersions()` so installs pick the latest stable
version.
> 
> Adds a unit test (`test_parse_flutter_with_version_expr`) to validate
the expr-based filtering/sorting behavior against Flutter-style JSON.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
9af283d. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
lucasew pushed a commit to lucasew/CONTRIB-mise that referenced this pull request Feb 18, 2026
### 🚀 Features

- **(activate)** add shims directory as fallback when auto-install is
enabled by @ctaintor in [jdx#8106](jdx#8106)
- **(env)** add `tools` variable to tera template context by @jdx in
[jdx#8108](jdx#8108)
- **(set)** add --stdin flag for multiline environment variables by @jdx
in [jdx#8110](jdx#8110)

### 🐛 Bug Fixes

- **(backend)** improve conda patchelf and dependency resolution for
complex packages by @jdx in
[jdx#8087](jdx#8087)
- **(ci)** fix validate-new-tools grep pattern for test field by @jdx in
[jdx#8100](jdx#8100)
- **(config)** make MISE_OFFLINE work correctly by gracefully skipping
network calls by @jdx in [jdx#8109](jdx#8109)
- **(github)** skip v prefix for "latest" version by @jdx in
[jdx#8105](jdx#8105)
- **(gitlab)** resolve tool options from config for aliased tools by
@jdx in [jdx#8084](jdx#8084)
- **(install)** use version_expr for Flutter to fix version resolution
by @jdx in [jdx#8081](jdx#8081)
- **(registry)** add Linux support for tuist by @fortmarek in
[jdx#8102](jdx#8102)
- **(release)** write release notes to file instead of capturing stdout
by @jdx in [jdx#8086](jdx#8086)
- **(upgrade)** tools are not uninstalled properly due to outdated
symlink by @roele in [jdx#8099](jdx#8099)
- **(upgrade)** ensure uninstallation failure does not leave invalid
symlinks by @roele in [jdx#8101](jdx#8101)
- SLSA for in-toto statement with no signatures by @gerhard in
[jdx#8094](jdx#8094)
- Vfox Plugin Auto-Installation for Environment Directives by @pose in
[jdx#8035](jdx#8035)

### 📚 Documentation

- use mise activate for PowerShell in getting-started by @rileychh in
[jdx#8112](jdx#8112)

### 📦 Registry

- add conda backend for mysql by @jdx in
[jdx#8080](jdx#8080)
- add conda backends for 10 asdf-only tools by @jdx in
[jdx#8083](jdx#8083)
- added podman-tui by @tony-sol in
[jdx#8098](jdx#8098)

### Chore

- sort settings.toml alphabetically and add test by @jdx in
[jdx#8111](jdx#8111)

### New Contributors

- @ctaintor made their first contribution in
[jdx#8106](jdx#8106)
- @rileychh made their first contribution in
[jdx#8112](jdx#8112)
- @fortmarek made their first contribution in
[jdx#8102](jdx#8102)
- @pose made their first contribution in
[jdx#8035](jdx#8035)
- @gerhard made their first contribution in
[jdx#8094](jdx#8094)

## 📦 Aqua Registry Updates

#### New Packages (2)

- [`entireio/cli`](https://github.com/entireio/cli)
-
[`rmitchellscott/reManager`](https://github.com/rmitchellscott/reManager)

#### Updated Packages (1)

- [`atuinsh/atuin`](https://github.com/atuinsh/atuin)
lucasew pushed a commit to lucasew/CONTRIB-mise that referenced this pull request Feb 18, 2026
### 🚀 Features

- **(activate)** add shims directory as fallback when auto-install is
enabled by @ctaintor in [jdx#8106](jdx#8106)
- **(env)** add `tools` variable to tera template context by @jdx in
[jdx#8108](jdx#8108)
- **(set)** add --stdin flag for multiline environment variables by @jdx
in [jdx#8110](jdx#8110)

### 🐛 Bug Fixes

- **(backend)** improve conda patchelf and dependency resolution for
complex packages by @jdx in
[jdx#8087](jdx#8087)
- **(ci)** fix validate-new-tools grep pattern for test field by @jdx in
[jdx#8100](jdx#8100)
- **(config)** make MISE_OFFLINE work correctly by gracefully skipping
network calls by @jdx in [jdx#8109](jdx#8109)
- **(github)** skip v prefix for "latest" version by @jdx in
[jdx#8105](jdx#8105)
- **(gitlab)** resolve tool options from config for aliased tools by
@jdx in [jdx#8084](jdx#8084)
- **(install)** use version_expr for Flutter to fix version resolution
by @jdx in [jdx#8081](jdx#8081)
- **(registry)** add Linux support for tuist by @fortmarek in
[jdx#8102](jdx#8102)
- **(release)** write release notes to file instead of capturing stdout
by @jdx in [jdx#8086](jdx#8086)
- **(upgrade)** tools are not uninstalled properly due to outdated
symlink by @roele in [jdx#8099](jdx#8099)
- **(upgrade)** ensure uninstallation failure does not leave invalid
symlinks by @roele in [jdx#8101](jdx#8101)
- SLSA for in-toto statement with no signatures by @gerhard in
[jdx#8094](jdx#8094)
- Vfox Plugin Auto-Installation for Environment Directives by @pose in
[jdx#8035](jdx#8035)

### 📚 Documentation

- use mise activate for PowerShell in getting-started by @rileychh in
[jdx#8112](jdx#8112)

### 📦 Registry

- add conda backend for mysql by @jdx in
[jdx#8080](jdx#8080)
- add conda backends for 10 asdf-only tools by @jdx in
[jdx#8083](jdx#8083)
- added podman-tui by @tony-sol in
[jdx#8098](jdx#8098)

### Chore

- sort settings.toml alphabetically and add test by @jdx in
[jdx#8111](jdx#8111)

### New Contributors

- @ctaintor made their first contribution in
[jdx#8106](jdx#8106)
- @rileychh made their first contribution in
[jdx#8112](jdx#8112)
- @fortmarek made their first contribution in
[jdx#8102](jdx#8102)
- @pose made their first contribution in
[jdx#8035](jdx#8035)
- @gerhard made their first contribution in
[jdx#8094](jdx#8094)

## 📦 Aqua Registry Updates

#### New Packages (2)

- [`entireio/cli`](https://github.com/entireio/cli)
-
[`rmitchellscott/reManager`](https://github.com/rmitchellscott/reManager)

#### Updated Packages (1)

- [`atuinsh/atuin`](https://github.com/atuinsh/atuin)
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