Skip to content

Comments

fix(gitlab): resolve tool options from config for aliased tools#8084

Merged
jdx merged 2 commits intomainfrom
fix/gitlab-alias-api-url
Feb 10, 2026
Merged

fix(gitlab): resolve tool options from config for aliased tools#8084
jdx merged 2 commits intomainfrom
fix/gitlab-alias-api-url

Conversation

@jdx
Copy link
Owner

@jdx jdx commented Feb 10, 2026

Summary

  • Fix api_url (and other tool options like version_prefix) not being respected when using tool_alias with gitlab/github/forgejo backends
  • Three fixes:
    1. _list_remote_versions: Was using self.ba.opts() which for aliased tools doesn't have config-defined options. Now uses config.get_tool_opts().
    2. install_version_: Same issue — was using tv.request.options() which doesn't carry config options for aliased tools. Now uses config.get_tool_opts().
    3. strip_version_prefix: Was independently reading self.ba.opts(). Now takes opts as a parameter from the caller (which already has resolved opts).
    4. get_tool_opts: Was matching by ba.short only, which for aliased tools is the alias name (e.g., treesize), not the config key (e.g., gitlab-f-bibonne-treesize). Now resolves the alias via full() and tries the resolved short name first.

Fixes #8079

Verified

  • mise ls-remote treesize correctly queries framagit.org (not gitlab.com) when using alias with api_url
  • mise install treesize@1.0.0 correctly downloads from framagit.org
  • Unit tests for strip_version_prefix pass

Test plan

  • mise ls-remote treesize with aliased gitlab tool + custom api_url → queries correct instance
  • mise install treesize@1.0.0 with aliased gitlab tool + custom api_url → installs from correct instance
  • Unit tests pass (test_version_prefix_functionality)

🤖 Generated with Claude Code


Note

Medium Risk
Changes how GitHub/GitLab/Forgejo backends resolve per-tool options during version listing and installs, which can affect what URLs/tags are used for downloads. Scope is contained and covered by updated unit tests plus a new GitLab alias e2e regression test.

Overview
Fixes unified GitHub/GitLab/Forgejo backends to honor config-defined tool options when invoked via tool_alias (e.g., api_url, version_prefix, asset_pattern) for both ls-remote and installs.

Updates Config::get_tool_opts to resolve options by the backend’s resolved full name first (avoiding alias short-name misses), and threads resolved options through strip_version_prefix instead of having it read backend-local opts. Adds an e2e GitLab regression test ensuring ls-remote and mise x work through an alias.

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

Copilot AI review requested due to automatic review settings February 10, 2026 12:16
@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 addresses a critical bug where custom tool options, particularly api_url, were being ignored when users leveraged tool aliases for Gitlab, GitHub, or Forgejo backends. The fix ensures that the system correctly consults the configuration for tool-specific options, thereby allowing aliased tools to function as expected with their defined settings. This improves the reliability and flexibility of tool management within the application.

Highlights

  • Tool Option Resolution: Resolved an issue where tool options, such as api_url, were not correctly applied when using tool_alias with Gitlab, GitHub, and Forgejo backends.
  • Configuration Lookup: Modified the _list_remote_versions function to explicitly retrieve tool options from the configuration using config.get_tool_opts(), aligning with the approach used by s3 and http backends.
  • Fallback Mechanism: Implemented a fallback to self.ba.opts() if no specific tool options are found in the configuration for a given aliased tool.
Changelog
  • src/backend/github.rs
    • Updated the _list_remote_versions function to correctly retrieve tool options from the application configuration, ensuring api_url and other settings are respected for aliased tools.
Activity
  • A test plan was provided to verify mise ls-remote gitlab:FBibonne/treesize works with api_url set via tool_alias and to ensure existing GitHub/Gitlab/Forgejo backend tests pass.
  • The pull request description indicates it was generated with Claude Code.
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

Fixes unified Git backends (GitLab/GitHub/Forgejo) so tool options (e.g., api_url) are correctly resolved from config when using tool_alias, preventing unintended fallback to default hosts like gitlab.com.

Changes:

  • Update _list_remote_versions to resolve tool options via config.get_tool_opts() for aliased tools
  • Keep a fallback to self.ba.opts() when config has no tool options for the backend arg

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

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 an issue where tool options like api_url were not being respected for aliased tools in the GitHub, GitLab, and Forgejo backends. The change modifies _list_remote_versions to resolve tool options from the configuration, falling back to the backend arguments if not found. This aligns the behavior with other backends like s3 and http and correctly addresses the described problem. The implementation is clean and effective. Good work.

@jdx jdx force-pushed the fix/gitlab-alias-api-url branch from f2e78e9 to 1b3c47a Compare February 10, 2026 12:26
Copy link

@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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is ON, but a Cloud Agent failed to start.

@jdx jdx force-pushed the fix/gitlab-alias-api-url branch from 1b3c47a to 2594027 Compare February 10, 2026 12:41
When using a tool_alias with a gitlab backend that has api_url set,
_list_remote_versions was using self.ba.opts() which resolves the alias
to a full name without the [api_url=...] brackets, causing api_url to
default to gitlab.com. Now uses config.get_tool_opts() to look up
options from the config, matching the approach used by s3 and http
backends.

Fixes #8079

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jdx jdx force-pushed the fix/gitlab-alias-api-url branch from 2594027 to c77d3e1 Compare February 10, 2026 12:54
@github-actions
Copy link

github-actions bot commented Feb 10, 2026

Hyperfine Performance

mise x -- echo

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.2.9 x -- echo 21.6 ± 0.4 21.0 26.7 1.00
mise x -- echo 22.0 ± 1.7 21.2 53.1 1.02 ± 0.08

mise env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.2.9 env 21.1 ± 0.3 20.4 22.0 1.00
mise env 21.6 ± 1.1 20.8 31.2 1.02 ± 0.05

mise hook-env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.2.9 hook-env 21.7 ± 0.4 21.1 25.4 1.00
mise hook-env 22.2 ± 0.6 21.4 29.3 1.02 ± 0.03

mise ls

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.2.9 ls 19.8 ± 0.2 19.3 21.0 1.00
mise ls 20.1 ± 0.3 19.5 21.2 1.01 ± 0.02

xtasks/test/perf

Command mise-2026.2.9 mise Variance
install (cached) 124ms 120ms +3%
ls (cached) 74ms 74ms +0%
bin-paths (cached) 77ms 78ms -1%
task-ls (cached) 534ms 541ms -1%

Regression test for #8079.
Verifies that ls-remote and install work correctly when a gitlab
tool is referenced via a tool_alias.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jdx jdx merged commit 415e629 into main Feb 10, 2026
49 of 51 checks passed
@jdx jdx deleted the fix/gitlab-alias-api-url branch February 10, 2026 15:23
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
…8084)

## Summary
- Fix `api_url` (and other tool options like `version_prefix`) not being
respected when using `tool_alias` with gitlab/github/forgejo backends
- Three fixes:
1. **`_list_remote_versions`**: Was using `self.ba.opts()` which for
aliased tools doesn't have config-defined options. Now uses
`config.get_tool_opts()`.
2. **`install_version_`**: Same issue — was using `tv.request.options()`
which doesn't carry config options for aliased tools. Now uses
`config.get_tool_opts()`.
3. **`strip_version_prefix`**: Was independently reading
`self.ba.opts()`. Now takes opts as a parameter from the caller (which
already has resolved opts).
4. **`get_tool_opts`**: Was matching by `ba.short` only, which for
aliased tools is the alias name (e.g., `treesize`), not the config key
(e.g., `gitlab-f-bibonne-treesize`). Now resolves the alias via `full()`
and tries the resolved short name first.

Fixes jdx#8079

## Verified
- `mise ls-remote treesize` correctly queries `framagit.org` (not
`gitlab.com`) when using alias with `api_url`
- `mise install treesize@1.0.0` correctly downloads from `framagit.org`
- Unit tests for `strip_version_prefix` pass

## Test plan
- [x] `mise ls-remote treesize` with aliased gitlab tool + custom
`api_url` → queries correct instance
- [x] `mise install treesize@1.0.0` with aliased gitlab tool + custom
`api_url` → installs from correct instance
- [x] Unit tests pass (`test_version_prefix_functionality`)

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

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Changes how GitHub/GitLab/Forgejo backends resolve per-tool options
during version listing and installs, which can affect what URLs/tags are
used for downloads. Scope is contained and covered by updated unit tests
plus a new GitLab alias e2e regression test.
> 
> **Overview**
> Fixes unified GitHub/GitLab/Forgejo backends to **honor config-defined
tool options when invoked via `tool_alias`** (e.g., `api_url`,
`version_prefix`, `asset_pattern`) for both `ls-remote` and installs.
> 
> Updates `Config::get_tool_opts` to resolve options by the backend’s
*resolved full name* first (avoiding alias short-name misses), and
threads resolved options through `strip_version_prefix` instead of
having it read backend-local opts. Adds an e2e GitLab regression test
ensuring `ls-remote` and `mise x` work through an alias.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
8c3ba8e. 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