Skip to content

fix: store tool options for all backends in metadata#6807

Merged
jdx merged 1 commit intojdx:mainfrom
roele:issues/backend-options
Oct 31, 2025
Merged

fix: store tool options for all backends in metadata#6807
jdx merged 1 commit intojdx:mainfrom
roele:issues/backend-options

Conversation

@roele
Copy link
Copy Markdown
Contributor

@roele roele commented Oct 29, 2025

The tool options should be stored in .mise.backend for all backends (except core). Since its introduction, new backends have been added which were not storing these. This might lead to misbehaviour on installation and upgrades etc. like querying the wrong api_url for example. This happens when the tool is read from disk (install state) instead of the configuration.


Note

Store tool options in backend metadata for all non-core backends and update tests/lookup accordingly.

  • Install State:
    • write_backend_meta now writes full_with_opts() for all backends except core, ensuring options are persisted in .mise.backend.
  • CLI / BackendArg:
    • Add tests verifying full_with_opts appends filtered options and preserves existing bracketed options.
  • Tool Stub:
    • find_tool_version now matches on tv.ba().short instead of full identifier.
  • E2E Tests:
    • Update lockfile expectations for github, gitlab, and http backends to include backend options (e.g., asset_pattern, bin_path, url) in backend field.

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

Copilot AI review requested due to automatic review settings October 29, 2025 21:51
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

This PR inverts the logic for writing backend metadata options. Previously, only specific backend prefixes (cargo:, go:, pipx:, ubi:) would persist their tool options in the .mise.backend file, while all other backends would not. Now, all backends except core: will persist their options.

Key Changes

  • Changed write_backend_meta() to use full_with_opts() by default for all backends except core:
  • Removed the hardcoded list of backend prefixes that should include options
  • Inverted the conditional logic to explicitly exclude only core: from option persistence

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

Comment thread src/toolset/install_state.rs
@roele roele force-pushed the issues/backend-options branch 2 times, most recently from 9a78254 to 739c603 Compare October 29, 2025 22:28
Comment thread e2e/backend/test_github_url_tracking
@roele roele force-pushed the issues/backend-options branch from 739c603 to 40a20ab Compare October 30, 2025 18:04
@jdx
Copy link
Copy Markdown
Owner

jdx commented Oct 31, 2025

bugbot run

Copy link
Copy Markdown

@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 826da30 into jdx:main Oct 31, 2025
29 checks passed
@roele roele deleted the issues/backend-options branch October 31, 2025 17:01
jdx pushed a commit that referenced this pull request Nov 1, 2025
### 🐛 Bug Fixes

- **(activate)** reset PATH when activate is called multiple times by
@jdx in [#6829](#6829)
- **(env)** preserve user-configured PATH entries from env._.path by
@jdx in [#6835](#6835)
- store tool options for all backends in metadata by @roele in
[#6807](#6807)

### 📚 Documentation

- fix usage spec syntax from 'option' to 'flag' by @jdx in
[#6834](#6834)

### 📦️ Dependency Updates

- update ghcr.io/jdx/mise:alpine docker digest to 7351bbe by
@renovate[bot] in [#6826](#6826)
- update ghcr.io/jdx/mise:deb docker digest to 3a847f2 by @renovate[bot]
in [#6828](#6828)
- update ghcr.io/jdx/mise:copr docker digest to 546dffb by
@renovate[bot] in [#6827](#6827)
- pin jdx/mise-action action to e3d7b8d by @renovate[bot] in
[#6825](#6825)
roele pushed a commit to roele/mise that referenced this pull request Nov 2, 2025
- tool options introduced with PR jdx#6807 lead to lookup failures in context of aqua and tool stubs
jdx pushed a commit that referenced this pull request Nov 3, 2025
…#6867)

As mentioned on
[Discord](https://discord.com/channels/1066429325269794907/1314301006992900117/1434277261770625155),
tool options introduced with PR #6807 lead to lookup failures in context
of aqua and tool stubs.

The following stub for example will fail to look up the binary because
the underlying `Backend:which` call fails.

```bash
#!/usr/bin/env -S mise tool-stub
version = "0.3.206"
tool = "flyctl"
bin = "flyctl"
```

```
  ❯ mise tool-stub test_flyctl
mise WARN  Error listing bin paths for aqua:superfly/flyctl[bin=flyctl]@0.3.206: registry not available: no aqua-registry found for superfly/flyctl[bin=flyctl]
mise ERROR Tool 'flyctl' does not have an executable named 'flyctl'. Available executables: flyctl, fly
mise ERROR Run with --verbose or MISE_VERBOSE=1 for more information
```

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Strip tool options during Aqua backend ID resolution to fix tool-stub
lookups and add an e2e test for flyctl.
> 
> - **Backend**:
> - **Aqua**: Use `BackendArg.full_without_opts()` in
`AquaBackend::from_arg` to strip option brackets when resolving `id`.
> - **Args**: Add `BackendArg::full_without_opts()` to return `full`
without `[opts]` while preserving existing `opts()` behavior.
> - **Tests**:
> - **e2e**: Add Aqua backend tool-stub test for `flyctl` (`0.3.206`)
verifying version output and refetch after `mise uninstall --all`.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
0c56957. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

Co-authored-by: mise-en-dev <release@mise.jdx.dev>
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.

4 participants