Skip to content

fix: default legacy .mise.backend installs to non-explicit#8245

Merged
jdx merged 1 commit intojdx:mainfrom
jean-humann:fix/legacy-backend-explicit-default
Feb 18, 2026
Merged

fix: default legacy .mise.backend installs to non-explicit#8245
jdx merged 1 commit intojdx:mainfrom
jean-humann:fix/legacy-backend-explicit-default

Conversation

@jean-humann
Copy link
Contributor

Summary

  • Fix legacy .mise.backend files (2-line format) defaulting to explicit_backend = true, which prevents auto-migration to updated registry backends

Problem

mise install glab@1.85.3 fails with:

mise WARN  deprecated [ubi]: The ubi backend is deprecated
mise ERROR Failed to install gitlab:gitlab-org/cli@1.85.3: HTTP request to
  https://api.github.com/repos/gitlab-org/cli/releases/tags/1.85.3 returned an error status

The registry correctly maps glabgitlab:gitlab-org/cli, but the auto-migration logic in BackendArg::full() is blocked because legacy installs are marked as explicit_backend = true.

Root Cause

In src/toolset/install_state.rs, read_legacy_backend_meta() parses the old 2-line .mise.backend format:

glab
ubi:gitlab-org/cli[provider=gitlab,exe=glab]

Line 130 defaults missing third line to explicit:

let explicit_backend = lines.get(2).is_none_or(|v| *v == "1");
//                                  ^^^^^^^^^^^ None → true

This prevents the registry-based backend resolution in BackendArg::full() from running for any legacy install.

Fix

Change is_none_oris_some_and so legacy installs (which were always resolved from the registry, never explicitly chosen) default to explicit_backend = false:

let explicit_backend = lines.get(2).is_some_and(|v| *v == "1");

This allows the auto-migration logic to resolve them to current registry backends.

Test plan

  • Verify mise install glab@1.85.3 resolves to gitlab:gitlab-org/cli and installs from gitlab.com
  • Verify explicitly installed backends (3-line format with 1) still respect the explicit flag
  • Verify tools without legacy .mise.backend files are unaffected

Fixes #8244

Legacy `.mise.backend` files (2-line format without an explicit_backend
flag) were defaulting to `explicit_backend = true` because
`is_none_or()` returns true when the third line is absent. This
prevented auto-migration to updated registry backends.

For example, `glab` was stuck on the deprecated `ubi` backend (which
hits api.github.com and 404s) instead of migrating to the correct
`gitlab:gitlab-org/cli` backend from the registry.

Change from `is_none_or` to `is_some_and` so legacy installs default to
`explicit_backend = false`, allowing the auto-migration logic in
`BackendArg::full()` to resolve them to current registry backends.

Fixes jdx#8244
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @jean-humann, 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 issue preventing legacy mise installations from automatically migrating to updated registry backends. By correcting a boolean logic error in how explicit_backend is determined for older .mise.backend files, it ensures that these installations are no longer mistakenly marked as explicitly chosen, thereby allowing the system to correctly resolve and update them using the current registry.

Highlights

  • Legacy Backend Migration Fix: Corrected the logic for explicit_backend in legacy .mise.backend files to ensure they default to false, enabling proper auto-migration to updated registry backends.
Changelog
  • src/toolset/install_state.rs
    • Updated the logic for determining explicit_backend from is_none_or to is_some_and when parsing legacy .mise.backend files.
Activity
  • No human activity (comments, reviews, or progress updates) has been recorded for this pull request yet.
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

@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 fixes a bug in parsing legacy .mise.backend files. Previously, these files defaulted to explicit_backend = true, which prevented auto-migration to updated registry backends. The change from is_none_or to is_some_and ensures that legacy 2-line format files correctly default to explicit_backend = false, enabling the migration logic. The fix is concise, correct, and well-explained in the pull request description. No further changes are needed.

@jdx jdx merged commit 38663d7 into jdx:main Feb 18, 2026
34 checks passed
mise-en-dev added a commit that referenced this pull request Feb 19, 2026
### 🐛 Bug Fixes

- **(install)** use backend bin paths for per-tool postinstall hooks by
@jdx in [#8234](#8234)
- **(use)** write to config.toml instead of config.local.toml by @jdx in
[#8240](#8240)
- default legacy .mise.backend installs to non-explicit by @jean-humann
in [#8245](#8245)

### 🚜 Refactor

- **(config)** consolidate flat task_* settings into nested task.* by
@jdx in [#8239](#8239)
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Feb 22, 2026
## [2026.2.18](https://github.com/jdx/mise/compare/v2026.2.17..v2026.2.18) - 2026-02-21

### 🚀 Features

- **(install)** auto-lock all platforms after tool installation by @jdx in [#8277](jdx/mise#8277)

### 🐛 Bug Fixes

- **(config)** respect --yes flag for config trust prompts by @jdx in [#8288](jdx/mise#8288)
- **(exec)** strip shims from PATH on Unix to prevent infinite recursion by @jdx in [#8276](jdx/mise#8276)
- **(install)** validate --locked before --dry-run short-circuit by @altendky in [#8290](jdx/mise#8290)
- **(release)** refresh PATH after mise up in release-plz by @jdx in [#8292](jdx/mise#8292)
- **(schema)** replace unevaluatedProperties with additionalProperties by @jdx in [#8285](jdx/mise#8285)
- **(task)** avoid duplicated stderr on task failure in replacing mode by @jdx in [#8275](jdx/mise#8275)
- **(task)** use process groups to kill child process trees on Unix by @jdx in [#8279](jdx/mise#8279)
- **(task)** run depends_post tasks even when parent task fails by @jdx in [#8274](jdx/mise#8274)
- **(task)** suggest similar commands when mistyping a CLI subcommand by @jdx in [#8286](jdx/mise#8286)
- **(task)** execute monorepo subdirectory prepare steps from root by @jdx in [#8291](jdx/mise#8291)
- **(upgrade)** don't force-reinstall already installed versions by @jdx in [#8282](jdx/mise#8282)
- **(watch)** restore terminal state after watchexec exits by @jdx in [#8273](jdx/mise#8273)

### 📚 Documentation

- clarify that MISE_CEILING_PATHS excludes the ceiling directory itself by @jdx in [#8283](jdx/mise#8283)

### Chore

- replace gen-release-notes script with communique by @jdx in [#8289](jdx/mise#8289)

### New Contributors

- @altendky made their first contribution in [#8290](jdx/mise#8290)

### 📦 Aqua Registry Updates

#### New Packages (4)

- [`Skarlso/crd-to-sample-yaml`](https://github.com/Skarlso/crd-to-sample-yaml)
- [`kunobi-ninja/kunobi-releases`](https://github.com/kunobi-ninja/kunobi-releases)
- [`swanysimon/markdownlint-rs`](https://github.com/swanysimon/markdownlint-rs)
- [`tmux/tmux-builds`](https://github.com/tmux/tmux-builds)

#### Updated Packages (2)

- [`firecow/gitlab-ci-local`](https://github.com/firecow/gitlab-ci-local)
- [`k1LoW/runn`](https://github.com/k1LoW/runn)

## [2026.2.17](https://github.com/jdx/mise/compare/v2026.2.16..v2026.2.17) - 2026-02-19

### 🚀 Features

- **(prepare)** update mtime of outputs after command is run by @halms in [#8243](jdx/mise#8243)

### 🐛 Bug Fixes

- **(install)** use backend bin paths for per-tool postinstall hooks by @jdx in [#8234](jdx/mise#8234)
- **(use)** write to config.toml instead of config.local.toml by @jdx in [#8240](jdx/mise#8240)
- default legacy .mise.backend installs to non-explicit by @jean-humann in [#8245](jdx/mise#8245)

### 🚜 Refactor

- **(config)** consolidate flat task_* settings into nested task.* by @jdx in [#8239](jdx/mise#8239)

### Chore

- **(prepare)** refactor common code into ProviderBase by @halms in [#8246](jdx/mise#8246)

### 📦 Aqua Registry Updates

#### Updated Packages (1)

- [`namespacelabs/foundation/nsc`](https://github.com/namespacelabs/foundation/nsc)
risu729 pushed a commit to risu729/mise that referenced this pull request Feb 27, 2026
## Summary

- Fix legacy `.mise.backend` files (2-line format) defaulting to
`explicit_backend = true`, which prevents auto-migration to updated
registry backends

## Problem

`mise install glab@1.85.3` fails with:

```
mise WARN  deprecated [ubi]: The ubi backend is deprecated
mise ERROR Failed to install gitlab:gitlab-org/cli@1.85.3: HTTP request to
  https://api.github.com/repos/gitlab-org/cli/releases/tags/1.85.3 returned an error status
```

The registry correctly maps `glab` → `gitlab:gitlab-org/cli`, but the
auto-migration logic in `BackendArg::full()` is blocked because legacy
installs are marked as `explicit_backend = true`.

## Root Cause

In `src/toolset/install_state.rs`, `read_legacy_backend_meta()` parses
the old 2-line `.mise.backend` format:

```
glab
ubi:gitlab-org/cli[provider=gitlab,exe=glab]
```

Line 130 defaults missing third line to explicit:

```rust
let explicit_backend = lines.get(2).is_none_or(|v| *v == "1");
//                                  ^^^^^^^^^^^ None → true
```

This prevents the registry-based backend resolution in
`BackendArg::full()` from running for any legacy install.

## Fix

Change `is_none_or` → `is_some_and` so legacy installs (which were
always resolved from the registry, never explicitly chosen) default to
`explicit_backend = false`:

```rust
let explicit_backend = lines.get(2).is_some_and(|v| *v == "1");
```

This allows the auto-migration logic to resolve them to current registry
backends.

## Test plan

- [ ] Verify `mise install glab@1.85.3` resolves to
`gitlab:gitlab-org/cli` and installs from `gitlab.com`
- [ ] Verify explicitly installed backends (3-line format with `1`)
still respect the explicit flag
- [ ] Verify tools without legacy `.mise.backend` files are unaffected

Fixes jdx#8244
risu729 pushed a commit to risu729/mise that referenced this pull request Feb 27, 2026
### 🐛 Bug Fixes

- **(install)** use backend bin paths for per-tool postinstall hooks by
@jdx in [jdx#8234](jdx#8234)
- **(use)** write to config.toml instead of config.local.toml by @jdx in
[jdx#8240](jdx#8240)
- default legacy .mise.backend installs to non-explicit by @jean-humann
in [jdx#8245](jdx#8245)

### 🚜 Refactor

- **(config)** consolidate flat task_* settings into nested task.* by
@jdx in [jdx#8239](jdx#8239)
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.

2 participants