Skip to content

feat: add options field to BackendListVersionsCtx#8875

Merged
jdx merged 4 commits intojdx:mainfrom
esteve:add-options-backend-ctxs
Apr 4, 2026
Merged

feat: add options field to BackendListVersionsCtx#8875
jdx merged 4 commits intojdx:mainfrom
esteve:add-options-backend-ctxs

Conversation

@esteve
Copy link
Copy Markdown
Contributor

@esteve esteve commented Apr 3, 2026

This PR adds an options field to BackendListVersionsCtx and updates the other two backends so that their options field can store arbitrary TOML values.

@esteve
Copy link
Copy Markdown
Contributor Author

esteve commented Apr 3, 2026

I'm working on a Pixi backend (https://github.com/esteve/mise-backend-pixi) that supports setting the Pixi channels to download tools from (https://github.com/esteve/mise-backend-pixi?tab=readme-ov-file#custom-conda-channels).

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 3, 2026

Greptile Summary

This PR completes the options story for all three vfox backend hook contexts: it adds an options: IndexMap<String, toml::Value> field to BackendListVersionsContext (which previously had none), and upgrades the existing options field in BackendInstallContext and BackendExecEnvContext from IndexMap<String, String> to IndexMap<String, toml::Value>. The net effect is that Lua hook functions now receive rich, type-preserving values (arrays, nested tables, integers, booleans) instead of everything being flattened to strings.

Confidence Score: 5/5

Safe to merge — purely additive for BackendListVersions and a well-contained type promotion for the other two contexts, with no logic errors found.

All three hook contexts are now consistent; toml dependency resolves to the same version as the main crate; opts_as_strings() is still used by other backends; unit tests cover the new serialisation paths; docs are updated. No P0 or P1 findings.

No files require special attention.

Important Files Changed

Filename Overview
crates/vfox/src/hooks/backend_list_versions.rs Adds options field to BackendListVersionsContext with full Lua serialization and comprehensive unit tests.
src/backend/vfox.rs Updates all three call sites to pass toml::Value opts directly, removing the old string-conversion paths.
crates/vfox/src/vfox.rs Updates backend method signatures to accept IndexMap<String, toml::Value> consistently.
docs/backend-plugin-development.md Documents new ctx.options field and TOML-to-Lua type mapping.

Reviews (5): Last reviewed commit: "Merge branch 'main' into add-options-bac..." | Re-trigger Greptile

Comment thread crates/vfox/src/hooks/backend_list_versions.rs
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 enhances the vfox backend by transitioning tool options from simple strings to toml::Value types, enabling support for complex data structures like arrays and tables in Lua hooks. The changes span across context definitions, method signatures, and documentation, with new unit tests added for the BackendListVersionsContext serialization. A critical feedback item identifies a missing clone in src/backend/vfox.rs that would otherwise cause a compilation error when attempting to move options from a reference.

Comment thread src/backend/vfox.rs
tv.install_path(),
tv.download_path(),
tool_opts.opts_as_strings(),
tool_opts.opts,
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.

high

The tool_opts.opts field needs to be cloned here because vfox.backend_install takes ownership of the IndexMap, but tool_opts is a reference obtained from tv.request.options(). This will likely cause a compilation error as you cannot move out of a reference.

Suggested change
tool_opts.opts,
tool_opts.opts.clone(),

esteve added 2 commits April 3, 2026 19:34
…ntexts so that options can store data types other than strings (toml::Value)

Signed-off-by: Esteve Fernandez <esteve@apache.org>
Signed-off-by: Esteve Fernandez <esteve@apache.org>
@esteve esteve force-pushed the add-options-backend-ctxs branch from 90e5a86 to 82978be Compare April 3, 2026 17:34
@esteve esteve changed the title fix: add options field to BackendListVersionsCtx feat: add options field to BackendListVersionsCtx Apr 3, 2026
@jdx jdx merged commit 40dda6d into jdx:main Apr 4, 2026
20 checks passed
jdx pushed a commit that referenced this pull request Apr 5, 2026
### 🚀 Features

- **(ci)** auto-convert external PRs to draft mode by @jdx in
[#8896](#8896)
- **(deps)** add `depends` field for user-specified tool dependencies by
@cprecioso in [#8776](#8776)
- **(dotnet)** support runtime-only installs by @fragon10 in
[#8524](#8524)
- **(npm)** apply install_before to transitive dependencies by @risu729
in [#8851](#8851)
- **(task)** allow passing arguments to task dependencies via
{{usage.*}} templates by @jdx in
[#8893](#8893)
- add options field to BackendListVersionsCtx by @esteve in
[#8875](#8875)

### 🐛 Bug Fixes

- **(backend)** filter PEP 440 .dev versions in fuzzy version matching
by @richardthe3rd in [#8849](#8849)
- **(ci)** update COPR BuildRequires rust version to match MSRV 1.88 by
@jdx in [#8911](#8911)
- **(ci)** add Ruby build dependencies to e2e Docker image by @jdx in
[#8910](#8910)
- **(ci)** add missing build dependencies to e2e Docker image by @jdx in
[#8912](#8912)
- **(ci)** add missing build dependencies to e2e Docker image by @jdx in
[#8914](#8914)
- **(ci)** use Node 24 LTS for corepack e2e test by @jdx in
[#8915](#8915)
- **(ci)** add libxml2 and pkg-config to e2e Docker image by @jdx in
[#8917](#8917)
- **(ci)** add libxml2-dev to e2e image and disable Swift SPM tests by
@jdx in [#8918](#8918)
- **(docs)** use sans-serif font for badges by @jdx in
[#8887](#8887)
- **(env)** parse --env=VALUE and -E=VALUE flag forms correctly by @jdx
in [#8889](#8889)
- **(exec)** use i64::from() for seccomp syscall numbers to survive
autofix by @jdx in [#8882](#8882)
- **(github)** preserve tool options like filter_bins when version
specified via CLI by @jdx in
[#8888](#8888)
- **(github)** use alias-specific options when tool_alias has its own
config by @jdx in [#8892](#8892)
- **(install)** add locked_verify_provenance setting and detect github
attestations at lock time by @jdx in
[#8901](#8901)
- **(lock)** prune stale version entries during filtered `mise lock
<tool>` runs by @altendky in
[#8599](#8599)
- **(python)** use lockfile URL for precompiled installs by @hehaoqian
in [#8750](#8750)
- **(release)** verify all build targets succeed before releasing by
@jdx in [#8886](#8886)
- **(ruby)** support build revisions for precompiled binaries in
mise.lock by @jdx in [#8900](#8900)
- **(swift)** fall back to Ubuntu 24.04 for unsupported Ubuntu versions
by @jdx in [#8916](#8916)
- **(zsh)** avoid duplicate trust warning after cd by @timothysparg in
[#8898](#8898)
- update flake.lock and add fix for rust-bindgen to default.nix by
@esteve in [#8874](#8874)
- when direnv diff is empty, do not try to parse it by @yaleman in
[#8857](#8857)
- skip trust check for plain .tool-versions in task list by @dportalesr
in [#8876](#8876)

### 🚜 Refactor

- **(go)** rename go_* settings to go.* namespace by @jdbruijn in
[#8598](#8598)

### 📚 Documentation

- **(tasks)** clarify task_config.includes behavior by @risu729 in
[#8905](#8905)

### 🧪 Testing

- **(ci)** run e2e tests inside Docker containers by @jdx in
[#8899](#8899)

### 📦️ Dependency Updates

- bump ubi from 0.8 to 0.9 by @jdx in
[#8906](#8906)
- bump zip from 3 to 8 by @jdx in
[#8908](#8908)
- update lockfile deps (hold back rattler) by @jdx in
[#8909](#8909)
- update bun.lock by @jdx in
[#8913](#8913)

### 📦 Registry

- add turso
([github:tursodatabase/turso-cli](https://github.com/tursodatabase/turso-cli))
by @kenn in [#8884](#8884)
- remove carp test by @jdx in
[#8894](#8894)

### Chore

- **(ci)** add workflow to warn PRs modifying vendored aqua-registry by
@jdx in [#8897](#8897)
- **(ci)** use github.token for draft conversion in auto-draft workflow
by @jdx in [#8903](#8903)
- remove deprecated settings older than 12 months by @jdx in
[#8904](#8904)

### New Contributors

- @dportalesr made their first contribution in
[#8876](#8876)
- @timothysparg made their first contribution in
[#8898](#8898)
- @hehaoqian made their first contribution in
[#8750](#8750)
- @jdbruijn made their first contribution in
[#8598](#8598)
- @cprecioso made their first contribution in
[#8776](#8776)
- @yaleman made their first contribution in
[#8857](#8857)
- @kenn made their first contribution in
[#8884](#8884)
- @fragon10 made their first contribution in
[#8524](#8524)

## 📦 Aqua Registry Updates

#### New Packages (6)

- [`ahkohd/oyo`](https://github.com/ahkohd/oyo)
- [`bellicose100xp/jiq`](https://github.com/bellicose100xp/jiq)
- [`kurama/dealve-tui`](https://github.com/kurama/dealve-tui)
- [`micahkepe/jsongrep`](https://github.com/micahkepe/jsongrep)
- [`textfuel/lazyjira`](https://github.com/textfuel/lazyjira)
- [`ubugeeei/vize`](https://github.com/ubugeeei/vize)

#### Updated Packages (1)

- [`sigstore/cosign`](https://github.com/sigstore/cosign)
@esteve esteve deleted the add-options-backend-ctxs branch April 7, 2026 11:55
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