Skip to content

registry: fix flutter version sorting#8818

Merged
jdx merged 1 commit intojdx:mainfrom
roele:issues/8812
Mar 30, 2026
Merged

registry: fix flutter version sorting#8818
jdx merged 1 commit intojdx:mainfrom
roele:issues/8812

Conversation

@roele
Copy link
Copy Markdown
Contributor

@roele roele commented Mar 29, 2026

As mentioned in #8812

Copilot AI review requested due to automatic review settings March 29, 2026 15:13
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 refactors the Flutter registry configuration by replacing a generic URL template with explicit platform-specific definitions and updating the version expression to strip the '-stable' suffix. A review comment correctly identifies that support for windows-arm64 was unintentionally dropped in this transition and provides a suggestion to restore it.

url = 'https://storage.googleapis.com/flutter_infra_release/releases/stable/macos/flutter_macos_arm64_{{ version }}-stable.zip'

[backends.options.platforms.windows-x64]
url = 'https://storage.googleapis.com/flutter_infra_release/releases/stable/windows/flutter_windows_{{ version }}-stable.zip'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

The previous generic url also generated URLs for windows-arm64. By switching to explicit platform definitions, support for windows-arm64 seems to have been unintentionally dropped. To prevent a regression, please consider adding a definition for it.

Suggested change
url = 'https://storage.googleapis.com/flutter_infra_release/releases/stable/windows/flutter_windows_{{ version }}-stable.zip'
url = 'https://storage.googleapis.com/flutter_infra_release/releases/stable/windows/flutter_windows_{{ version }}-stable.zip'
[backends.options.platforms.windows-arm64]
url = 'https://storage.googleapis.com/flutter_infra_release/releases/stable/windows/flutter_windows_arm64_{{ version }}-stable.zip'

Copy link
Copy Markdown
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 the Flutter registry entry to improve version ordering for stable releases by normalizing the version strings used for sorting.

Changes:

  • Strip the -stable suffix from Flutter release versions before applying sortVersions().
  • Simplify download URL templates to use the normalized version and append -stable in the archive name.
  • Replace the prior shared URL template with explicit per-platform URLs (linux/macos/windows).

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

Comment on lines 6 to 8
[backends.options]
version_expr = 'fromJSON(body).releases | filter({ #.channel == "stable" }) | map({ #.version }) | sortVersions()'
version_expr = 'fromJSON(body).releases | filter({ #.channel == "stable" }) | map({ replace(#.version, "-stable", "") }) | sortVersions()'
version_list_url = "https://storage.googleapis.com/flutter_infra_release/releases/releases_linux.json"
Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

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

The PR description is about version sorting, but this hunk also removes the shared url template (and related comments) and switches to fully platform-specific URLs. If that broader change isn’t intentional, consider keeping the existing shared url and only adjusting version_expr/replace usage to minimize behavioral drift.

Copilot uses AI. Check for mistakes.

[backends.options.platforms.windows-x64]
url = 'https://storage.googleapis.com/flutter_infra_release/releases/stable/windows/flutter_windows_{{ version }}-stable.zip'

Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

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

Removing the previous shared url (which used arch(..., arm64="_arm64")) drops implicit support for additional platforms like windows-arm64. If Flutter does provide those archives (or if this registry entry previously intended to support them), please add an explicit windows-arm64 platform URL or restore the shared URL+arch mapping to avoid a regression on ARM64 Windows.

Suggested change
[backends.options.platforms.windows-arm64]
url = 'https://storage.googleapis.com/flutter_infra_release/releases/stable/windows/flutter_windows_arm64_{{ version }}-stable.zip'

Copilot uses AI. Check for mistakes.
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 29, 2026

Greptile Summary

This PR fixes a version-sorting regression for the http:flutter backend by normalising version strings — stripping any "-stable" suffix — before passing them to sortVersions(). It also replaces the previous single generic URL template (which used os() / arch() helpers) with explicit [backends.options.platforms.*] entries for linux-x64, macos-x64, macos-arm64, and windows-x64, which is a cleaner and more readable approach consistent with other registry entries. The speculative linux-arm64 entry (which was already annotated as unsupported) is removed.

Key changes:

  • version_expr now applies replace(#.version, "-stable", "") before sortVersions() so that any historical entries with the "-stable" suffix in the version field do not corrupt the sort order.
  • URL templates are simplified to {{ version }}-stable.<ext> since the version variable is already clean after the replace in version_expr.
  • Explicit platform sections replace the old generic arch()/os() interpolation.
  • The speculative linux-arm64 entry is dropped; the macos-x64, macos-arm64, and windows-x64 entries are now first-class entries rather than relying on the generic template.

Confidence Score: 5/5

Safe to merge — the fix correctly normalises version strings to unblock sorting, and all platform URL templates produce the same archive filenames as before.

All findings are P2 style suggestions (a missing comment explaining intent, and a note about potential linux-arm64 / windows-arm64 entries). There are no logic errors, no broken URLs, and no data-loss scenarios. The semantic change is equivalent to the old approach for modern releases and correct for legacy entries.

No files require special attention.

Important Files Changed

Filename Overview
registry/flutter.toml Fixes version sorting by stripping "-stable" suffix from version strings before calling sortVersions(); replaces the generic catch-all URL template with explicit per-platform entries for macos-x64, macos-arm64, and windows-x64, and removes the speculative linux-arm64 entry.

Sequence Diagram

sequenceDiagram
    participant mise
    participant FlutterAPI as Flutter Releases JSON<br/>(releases_linux.json)
    participant Storage as GCS Storage

    mise->>FlutterAPI: GET version_list_url
    FlutterAPI-->>mise: JSON body with releases[]
    mise->>mise: filter({ #.channel == "stable" })
    mise->>mise: map({ replace(#.version, "-stable", "") })
    mise->>mise: sortVersions() → clean list e.g. ["3.27.0", ...]

    Note over mise: User selects version e.g. 3.27.0

    alt linux-x64
        mise->>Storage: GET flutter_linux_3.27.0-stable.tar.xz
    else macos-x64
        mise->>Storage: GET flutter_macos_3.27.0-stable.zip
    else macos-arm64
        mise->>Storage: GET flutter_macos_arm64_3.27.0-stable.zip
    else windows-x64
        mise->>Storage: GET flutter_windows_3.27.0-stable.zip
    end

    Storage-->>mise: archive download
Loading

Reviews (1): Last reviewed commit: "registry: fix flutter version sorting" | Re-trigger Greptile


[backends.options]
version_expr = 'fromJSON(body).releases | filter({ #.channel == "stable" }) | map({ #.version }) | sortVersions()'
version_expr = 'fromJSON(body).releases | filter({ #.channel == "stable" }) | map({ replace(#.version, "-stable", "") }) | sortVersions()'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 replace is a no-op for current releases

According to the live Flutter releases JSON at storage.googleapis.com/flutter_infra_release/releases/releases_linux.json, current stable-channel release entries contain a plain version string (e.g. "3.27.0") with no "-stable" suffix — the suffix appears only in the archive filename, not the version field. The replace(#.version, "-stable", "") call is therefore a no-op for all modern releases.

If the motivation was that older historical entries in the JSON do carry the suffix (which would explain the broken sorting), a brief inline comment documenting that intent would help future maintainers understand why the replace is there at all:

Suggested change
version_expr = 'fromJSON(body).releases | filter({ #.channel == "stable" }) | map({ replace(#.version, "-stable", "") }) | sortVersions()'
version_expr = 'fromJSON(body).releases | filter({ #.channel == "stable" }) | map({ replace(#.version, "-stable", "") }) | sortVersions()' # some older entries have "-stable" in the version field

Comment on lines 10 to +21
# Linux uses .tar.xz instead of .zip
[backends.options.platforms.linux-x64]
url = 'https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_{{ version | replace(from="-stable", to="") }}-stable.tar.xz'
url = 'https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_{{ version }}-stable.tar.xz'

# Note: Flutter doesn't officially provide linux-arm64 builds, but use correct format if they add support
[backends.options.platforms.linux-arm64]
url = 'https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_arm64_{{ version | replace(from="-stable", to="") }}-stable.tar.xz'
[backends.options.platforms.macos-x64]
url = 'https://storage.googleapis.com/flutter_infra_release/releases/stable/macos/flutter_macos_{{ version }}-stable.zip'

[backends.options.platforms.macos-arm64]
url = 'https://storage.googleapis.com/flutter_infra_release/releases/stable/macos/flutter_macos_arm64_{{ version }}-stable.zip'

[backends.options.platforms.windows-x64]
url = 'https://storage.googleapis.com/flutter_infra_release/releases/stable/windows/flutter_windows_{{ version }}-stable.zip'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Missing linux-arm64 and windows-arm64 platform entries

The previous code included a (speculative) linux-arm64 entry with a note that Flutter didn't officially support it. Flutter has been progressively shipping official Linux ARM64 builds since the 3.x era, and as of recent stable releases they appear in the releases_linux.json feed. Removing the entry means Linux ARM64 users will silently fall through to the asdf: / vfox: backends rather than using the fast HTTP backend.

Similarly, Flutter now ships experimental Windows ARM64 archives, so a windows-arm64 entry may be warranted.

If official ARM64 artifacts exist in the JSON today it may be worth re-adding the entry (or at least leaving a # TODO comment):

# Uncomment when Flutter ships official linux-arm64 builds in the releases JSON
# [backends.options.platforms.linux-arm64]
# url = 'https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_arm64_{{ version }}-stable.tar.xz'

@YogiLiu
Copy link
Copy Markdown

YogiLiu commented Mar 30, 2026

Thx.

Related #7863 .

@jdx jdx merged commit 491b5ec into jdx:main Mar 30, 2026
36 of 39 checks passed
@roele roele deleted the issues/8812 branch March 30, 2026 19:58
mise-en-dev added a commit that referenced this pull request Mar 31, 2026
### 🚀 Features

- **(python)** add GitHub provenance verification for prebuilt binaries
by @malept in [#8820](#8820)

### 🐛 Bug Fixes

- **(ci)** use rustls-native-roots for Windows CI build by @jdx in
[#8822](#8822)
- **(go)** improve version fetching logic to support deeply nested
sub-modules by @roele in [#8823](#8823)
- **(shim)** prevent infinite recursion when system shims dir is on PATH
by @andrewthauer in [#8816](#8816)
- go backend missing supports_lockfile_url() override by
@palootcenas-outreach in [#8790](#8790)
- strip shims from PATH in credential and template subprocesses by
@antonioacg in [#8802](#8802)

### 📚 Documentation

- fix typo in shims documentation for fish by @roele in
[#8798](#8798)

### 📦️ Dependency Updates

- update ghcr.io/jdx/mise:alpine docker digest to 3e6d001 by
@renovate[bot] in [#8794](#8794)
- pin dependencies by @renovate[bot] in
[#8793](#8793)

### 📦 Registry

- fix flutter version sorting by @roele in
[#8818](#8818)
- add svgo (npm:svgo) by @3w36zj6 in
[#8817](#8817)

### New Contributors

- @antonioacg made their first contribution in
[#8802](#8802)
- @palootcenas-outreach made their first contribution in
[#8790](#8790)

## 📦 Aqua Registry Updates

#### New Packages (3)

- [`RasKrebs/sonar`](https://github.com/RasKrebs/sonar)
- [`emacs-eask/cli`](https://github.com/emacs-eask/cli)
-
[`superradcompany/microsandbox`](https://github.com/superradcompany/microsandbox)

#### Updated Packages (4)

- [`dimo414/bkt`](https://github.com/dimo414/bkt)
- [`lxc/incus`](https://github.com/lxc/incus)
-
[`shinagawa-web/gomarklint`](https://github.com/shinagawa-web/gomarklint)
- [`updatecli/updatecli`](https://github.com/updatecli/updatecli)
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.

5 participants