Skip to content

fix(github): use registry platform options during install#8492

Merged
jdx merged 1 commit intomainfrom
fix/flyway-asset-pattern
Mar 7, 2026
Merged

fix(github): use registry platform options during install#8492
jdx merged 1 commit intomainfrom
fix/flyway-asset-pattern

Conversation

@jdx
Copy link
Copy Markdown
Owner

@jdx jdx commented Mar 7, 2026

Summary

  • Fixed registry-defined platform-specific options (like asset_pattern) being silently ignored during tool installation
  • Tools like flyway would select the wrong asset (e.g., alpine instead of linux-x64) because:
    1. backend_options() stored serialized TOML table strings as toml::Value::String instead of parsing them back to toml::Value::Table, so get_nested_string() couldn't navigate the nested platform structure
    2. install_version_() fell back to tv.request.options() (user config only) instead of self.ba.opts() (which merges registry options)

Test plan

  • cargo test passes (registry, github, tool_version_options tests)
  • mise install flyway@12.0.3 now downloads flyway-commandline-12.0.3-linux-x64.tar.gz instead of alpine variant
  • All linters pass

🤖 Generated with Claude Code


Note

Medium Risk
Changes option parsing and install-time option precedence, which can alter which release asset URL gets selected/downloaded for some tools and platforms.

Overview
Ensures tool installation uses the merged backend options (including registry defaults) instead of falling back to request-only options when Config::get_tool_opts has no override, so platform-specific settings like asset_pattern are honored during asset resolution.

Updates RegistryTool::backend_options() to parse option values that are serialized TOML tables back into toml::Value::Table, preserving nested structures (e.g., platforms.*) rather than flattening them into strings.

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

Two bugs prevented registry-defined platform-specific options (like
`asset_pattern`) from being applied during installation:

1. `backend_options()` stored serialized TOML table strings as
   `toml::Value::String` instead of parsing them back to
   `toml::Value::Table`, so `get_nested_string()` couldn't navigate
   the nested platform structure.

2. `install_version_()` fell back to `tv.request.options()` (user
   config only) instead of `self.ba.opts()` (which merges registry
   options), so registry-defined options never reached the install path.

This caused tools like flyway to select the wrong asset (e.g., alpine
instead of linux-x64) because the platform-specific `asset_pattern`
from the registry was silently ignored.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 addresses a critical bug in how platform-specific configuration options from tool registries were processed during installation. Previously, these options were not correctly applied, leading to tools downloading incompatible or incorrect assets. The changes ensure that registry-defined options, especially those with nested structures, are properly parsed and merged with user configurations, guaranteeing that the correct assets are selected and installed for various platforms.

Highlights

  • Registry Options Handling: Fixed an issue where registry-defined platform-specific options, such as "asset_pattern", were silently ignored during tool installation.
  • Incorrect Asset Selection: Resolved a problem where tools like Flyway would select incorrect assets (e.g., alpine instead of linux-x64) due to two main causes: backend_options() incorrectly stored serialized TOML table strings as simple strings, preventing navigation of nested platform structures, and install_version_() incorrectly fell back to user-only configuration instead of merging registry options.
Changelog
  • src/backend/github.rs
    • Modified the install_version_ function to ensure that tool options are sourced from the merged backend options (self.ba.opts()) rather than just user-defined request options (tv.request.options()).
  • src/registry.rs
    • Updated the backend_options function to attempt parsing backend option values as TOML tables if they represent nested structures, preserving their original type instead of always storing them as simple strings.
Activity
  • cargo test passes, including registry, github, and tool_version_options tests.
  • mise install flyway@12.0.3 now correctly downloads flyway-commandline-12.0.3-linux-x64.tar.gz instead of the alpine variant.
  • All linters pass.
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
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 correctly addresses an issue where platform-specific options from the tool registry were being ignored during installation. The changes are well-targeted and effectively resolve the problem. First, by modifying src/registry.rs, it ensures that serialized TOML tables in registry options are properly parsed, preserving nested structures needed for platform-specific configurations. Second, the update in src/backend/github.rs guarantees that the installation process uses the fully merged options, including registry defaults, rather than just the user-provided request options. The implementation is clean and robust. I have no further comments.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 7, 2026

Greptile Summary

This PR fixes two related bugs that caused registry-defined platform-specific options (like asset_pattern) to be silently ignored during tool installation, leading to wrong asset selection (e.g., flyway downloading an alpine tarball instead of linux-x64).

Changes:

  • src/registry.rsbackend_options() now attempts to parse option values with toml::from_str and preserves the result as a toml::Value::Table when the raw string represents a TOML table. Previously every value was wrapped in toml::Value::String, preventing get_nested_string() from navigating nested platform structures.
  • src/backend/github.rs (install_version_) — The fallback when get_tool_opts() returns None is changed from tv.request.options() (user config only) to self.ba.opts(), which merges registry-defined options with user options.

Potential issue: resolve_lock_info (line 327 of github.rs) was not updated and still uses tv.request.options(). Since this function drives cross-platform lockfile generation by calling resolve_asset_url_for_target, it will pick the wrong asset URL for any platform where the registry defines platform-specific options — writing incorrect lockfile entries even though installation itself now works correctly.

Confidence Score: 3/5

  • Safe to merge for basic installation, but cross-platform lockfile generation remains broken for registry-defined platform options.
  • The core install path is fixed and tested (flyway now picks the right asset). However, resolve_lock_info — which populates the lockfile for other platforms — still uses the incomplete tv.request.options(). This means multi-platform lockfiles for tools like flyway will still contain wrong URLs for non-current platforms, which is a correctness bug in the lockfile workflow.
  • src/backend/github.rs — specifically resolve_lock_info at line 327

Important Files Changed

Filename Overview
src/backend/github.rs Fixes the install path to use merged registry+user options (self.ba.opts()), but resolve_lock_info on line 327 still uses tv.request.options() — the same incomplete options the fix was meant to address, which will cause incorrect URLs to be written to lockfiles for tools with registry-defined platform options.
src/registry.rs Correctly fixes TOML table parsing for nested platform options; however the is_table() guard silently discards type information for non-table TOML scalars (integers, booleans, arrays), which could cause issues if such values appear in the registry in the future.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[install_version_ called] --> B[get_tool_opts from config]
    B -->|Some opts| C[Use config opts]
    B -->|None| D{Before fix vs After fix}
    D -->|Before: tv.request.options\nuser options only| E[Missing registry platform options]
    D -->|After: self.ba.opts\nregistry + user merged| F[Platform options resolved correctly]
    F --> G[resolve_asset_url with correct opts]
    G --> H[Downloads correct asset e.g. linux-x64]

    I[resolve_lock_info called\ncross-platform lockfile gen] --> J[tv.request.options\nSTILL user options only - unfixed]
    J --> K[resolve_asset_url_for_target with incomplete opts]
    K --> L[Wrong asset URL written to lockfile for other platforms]

    M[backend_options in registry.rs] -->|Before fix| N[toml::Value::String for all values\nnested tables unnavigable]
    M -->|After fix| O[toml::from_str parses tables correctly\nplatform-specific options navigable]
Loading

Comments Outside Diff (1)

  1. src/backend/github.rs, line 327-328 (link)

    Same stale-options bug in resolve_lock_info

    resolve_lock_info still uses tv.request.options() (user config only) instead of self.ba.opts() (registry + user options merged). This is the exact same issue fixed in install_version_() on line 257, but left unaddressed here.

    Since resolve_lock_info is responsible for cross-platform lockfile generation, it calls resolve_asset_url_for_target with the same incomplete options. For a tool like flyway, where registry-defined platform options select the correct asset (e.g., linux-x64 vs alpine), the lockfile would record the wrong URL for other platforms — defeating the purpose of a lockfile.

    Fix in Claude Code

Fix All in Claude Code

Last reviewed commit: f2833dd

Comment on lines +136 to +139
let value = match toml::from_str::<toml::Value>(v) {
Ok(parsed) if parsed.is_table() => parsed,
_ => toml::Value::String(v.to_string()),
};
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.

Non-table TOML scalars are silently demoted to strings

The guard if parsed.is_table() means valid non-table TOML literals (booleans, integers, floats, and arrays) will be stored as toml::Value::String rather than their native types. For example, if a registry entry ever sets a numeric or boolean option (e.g., timeout = 30), toml::from_str::<toml::Value>("30") returns Ok(Integer(30)) but because !parsed.is_table() it falls through to String("30"), losing type information.

A more future-proof guard would be to only fall back to String when parsing fails outright:

Suggested change
let value = match toml::from_str::<toml::Value>(v) {
Ok(parsed) if parsed.is_table() => parsed,
_ => toml::Value::String(v.to_string()),
};
let value = if let Ok(parsed) = toml::from_str::<toml::Value>(&format!("v={v}"))
&& let Some(v) = parsed.get("v")
&& !v.is_str()
{
v.clone()
} else {
toml::Value::String(v.to_string())
};

Or, more simply, only skip the table guard by falling back to String for everything that isn't a table or array, since those are the only composite types that need reconstruction. This is a low-risk style concern for now, but worth addressing before adding integer/boolean registry options.

Fix in Claude Code

@jdx jdx enabled auto-merge (squash) March 7, 2026 04:10
@jdx jdx merged commit 872a284 into main Mar 7, 2026
38 checks passed
@jdx jdx deleted the fix/flyway-asset-pattern branch March 7, 2026 04:19
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 7, 2026

Hyperfine Performance

mise x -- echo

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.3.3 x -- echo 23.5 ± 0.7 22.8 33.5 1.00 ± 0.03
mise x -- echo 23.4 ± 0.3 22.7 24.9 1.00

mise env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.3.3 env 23.0 ± 0.7 22.3 29.8 1.00
mise env 23.1 ± 0.5 22.2 25.0 1.00 ± 0.04

mise hook-env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.3.3 hook-env 23.8 ± 0.3 23.1 25.7 1.00
mise hook-env 24.0 ± 0.5 23.3 27.6 1.01 ± 0.03

mise ls

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.3.3 ls 23.1 ± 0.5 22.4 30.2 1.01 ± 0.03
mise ls 22.9 ± 0.3 22.2 25.9 1.00

xtasks/test/perf

Command mise-2026.3.3 mise Variance
install (cached) 152ms 151ms +0%
ls (cached) 83ms 82ms +1%
bin-paths (cached) 85ms 85ms +0%
task-ls (cached) 807ms 810ms +0%

mise-en-dev added a commit that referenced this pull request Mar 7, 2026
### 🚀 Features

- **(github)** keep exe extensions on Windows by @iki in
[#8424](#8424)
- **(task)** add `interactive` field for exclusive terminal access by
@jdx in [#8491](#8491)
- add header comment to generated lockfiles by @ivy in
[#8481](#8481)
- runtime musl/glibc detection for correct libc variant selection by
@jdx in [#8490](#8490)

### 🐛 Bug Fixes

- **(github)** use registry platform options during install by @jdx in
[#8492](#8492)
- **(http)** store tool opts as native TOML to fix platform switching by
@jdx in [#8448](#8448)
- **(installer)** error if MISE_INSTALL_PATH is a directory by @jdx in
[#8468](#8468)
- **(prepare)** resolve sources/outputs relative to `dir` when set by
@jdx in [#8472](#8472)
- **(ruby)** fetch precompiled binary by release tag instead of listing
all releases by @jdx in [#8488](#8488)
- **(schema)** support structured objects in task depends by @risu729 in
[#8463](#8463)
- **(task)** replace println!/eprintln! with calm_io in task output
macros by @vmaleze in [#8485](#8485)
- handle scoped npm package names without backend prefix by @jdx in
[#8477](#8477)

### 📦️ Dependency Updates

- update ghcr.io/jdx/mise:copr docker digest to c485c4c by
@renovate[bot] in [#8484](#8484)
- update ghcr.io/jdx/mise:alpine docker digest to 8118bc7 by
@renovate[bot] in [#8483](#8483)

### 📦 Registry

- disable sd version test by @jdx in
[#8489](#8489)

### New Contributors

- @ivy made their first contribution in
[#8481](#8481)
- @iki made their first contribution in
[#8424](#8424)

## 📦 Aqua Registry Updates

#### New Packages (5)

- [`datadog-labs/pup`](https://github.com/datadog-labs/pup)
- [`k1LoW/mo`](https://github.com/k1LoW/mo)
- [`rtk-ai/rtk`](https://github.com/rtk-ai/rtk)
-
[`suzuki-shunsuke/docfresh`](https://github.com/suzuki-shunsuke/docfresh)
- [`yashikota/exiftool-go`](https://github.com/yashikota/exiftool-go)

#### Updated Packages (6)

- [`cloudflare/cloudflared`](https://github.com/cloudflare/cloudflared)
- [`mozilla/sccache`](https://github.com/mozilla/sccache)
- [`owenlamont/ryl`](https://github.com/owenlamont/ryl)
- [`spinel-coop/rv`](https://github.com/spinel-coop/rv)
-
[`technicalpickles/envsense`](https://github.com/technicalpickles/envsense)
- [`weaviate/weaviate`](https://github.com/weaviate/weaviate)
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