fix(gitlab): resolve tool options from config for aliased tools#8084
fix(gitlab): resolve tool options from config for aliased tools#8084
Conversation
Summary of ChangesHello @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 Highlights
Changelog
Activity
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
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_versionsto resolve tool options viaconfig.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.
There was a problem hiding this comment.
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.
f2e78e9 to
1b3c47a
Compare
1b3c47a to
2594027
Compare
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>
2594027 to
c77d3e1
Compare
Hyperfine Performance
|
| 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>
### 🚀 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)
### 🚀 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)
…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>
### 🚀 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)
### 🚀 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)
Summary
api_url(and other tool options likeversion_prefix) not being respected when usingtool_aliaswith gitlab/github/forgejo backends_list_remote_versions: Was usingself.ba.opts()which for aliased tools doesn't have config-defined options. Now usesconfig.get_tool_opts().install_version_: Same issue — was usingtv.request.options()which doesn't carry config options for aliased tools. Now usesconfig.get_tool_opts().strip_version_prefix: Was independently readingself.ba.opts(). Now takes opts as a parameter from the caller (which already has resolved opts).get_tool_opts: Was matching byba.shortonly, 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 viafull()and tries the resolved short name first.Fixes #8079
Verified
mise ls-remote treesizecorrectly queriesframagit.org(notgitlab.com) when using alias withapi_urlmise install treesize@1.0.0correctly downloads fromframagit.orgstrip_version_prefixpassTest plan
mise ls-remote treesizewith aliased gitlab tool + customapi_url→ queries correct instancemise install treesize@1.0.0with aliased gitlab tool + customapi_url→ installs from correct instancetest_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 bothls-remoteand installs.Updates
Config::get_tool_optsto resolve options by the backend’s resolved full name first (avoiding alias short-name misses), and threads resolved options throughstrip_version_prefixinstead of having it read backend-local opts. Adds an e2e GitLab regression test ensuringls-remoteandmise xwork through an alias.Written by Cursor Bugbot for commit 8c3ba8e. This will update automatically on new commits. Configure here.