Repository navigation
feat(mise): look up tools whose entries carry options, passing them to mise - #329
Merged
Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
count-patchula | 93c9c08 | Commit Preview URL Branch Preview URL |
Nov 14 2026, 10:59 PM |
…o mise
The Count refused a mise tool whose entry set options (`rust = { version,
profile, components }`, a forgejo tool with `api_url`) or whose name
carried them in brackets (`github:org/tool[bin=tool]`). Now the options
travel with the tool to the pinned mise, which applies them to the listing
exactly as it does when installing.
- Extraction writes the entry's options (every key but `version`) into the
package in mise's bracket syntax, sorted and canonical; a bracketed name
is passed as written. An entry with both, or an option the canonical
form cannot hold, fails its lookup without repeating what it holds.
- `patchula_mise::check` validates options too: no leading `-` in keys or
string values, no `@`, no control characters, a length limit, and only
the canonical TOML form or mise's legacy `key=value` form.
- mise sends `MISE_GITHUB_TOKEN` to any host shaped like a GitHub API, so a
tool whose options hold a `:` (and so may name a host) gets no token;
its listing is public, keyed apart by its options. Any tool with options
is one whose source the Count cannot place for the scope rule.
- The `mise-ls-remote` scope carries the options (state version 3).
- http/s3 tools are skipped only when the entry lacks `version_list_url`
(or `version_prefix`), since those options are now passed.
- A rule's `packages` matches the bare tool name as well.
…d unreproducible layering refused - A tool whose options name another host gets the same token as any other lookup from its repository: under #327 that token reaches no further than the repository whose own entry wrote the options. A public key's token is minted for a repository that asked for exactly that tool and options (options are part of the lookup key), which a test pins. - Options that point mise at a cloud instance-metadata endpoint are refused: a URL whose host is, or resolves to, a link-local address (169.254.0.0/16, fe80::/10), fd00:ec2::254, metadata.google.internal or metadata. Such endpoints hand out the machine's own credentials. mise resolves again and follows redirects, which this does not catch. - The sandbox gives the s3 backend's AWS SDK no credentials: config and credential files in the scratch home, AWS_EC2_METADATA_DISABLED=true. - mise does not merge a tool's options across configuration files (the highest-precedence entry replaces the others whole, checked with the pinned mise), so each entry keeps its own; an array lists with its first request's options. A task's tool is refused when it or its [tools] entry in the task's hierarchy has table options, since mise layers the two by version in a way the Count does not reproduce. - The http/s3 skip reads the parsed options (s3 per platform too), and a refused entry fails its lookup rather than look skipped. - Legacy bracket values TOML would read as non-strings are refused; strings holding `"` are written as TOML literal strings.
sweepies
force-pushed
the
fix/mise-tool-options
branch
from
November 14, 2026 22:59
3183a1d to
93c9c08
Compare
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #327 (
fix/mise-scoped-token); retarget tomainwhen it merges.What changes
The Count used to refuse mise tools whose entries carry options. Now he passes those options to the pinned mise, which applies them to
ls-remotejust as it does at install time. There is no per-backend table, and mise ignores keys it doesn't read (e.g.mr_boxington).Mechanism: bracket syntax on the tool argument
Checked against mise 2026.10.11:
InlineBackendArg, the same layer it gives an entry's own table options.MISE_NO_CONFIG, so I didn't take that route.MISE_NO_CONFIG,MISE_NO_ENV,MISE_NO_HOOKSandMISE_AUTO_INSTALL=0all stay on.Extraction
packageas canonical, sorted brackets:rust[components="clippy,rustfmt",mr_boxington=true,profile="minimal"]. A name that already has brackets is passed as written."is written as a TOML literal string ('…'). mise reads that form; checked with deepsource'surl.mise.tomlplusmise.local.toml,mise.tomlplus.tool-versions, and a child folder. mise does not merge a tool's options across configuration files: the highest-precedence entry replaces the others whole, options included. So each entry is looked up with its own options.[tools]entry's options under the task's own, choosing by version (apply_config_options_to_runtime_arg). The Count doesn't reproduce that, so a task tool is refused when it, or its[tools]entry in the task's configuration hierarchy, has table options. Brackets on a task tool's name are part of the backend argument and pass.version_list_url(orversion_prefix). s3 also checks the per-platform forms mise reads (platforms.<os>-<arch>.*,platform_*). A refused entry now fails its lookup rather than being reported as skipped.Argument hygiene (applies to every repository)
-in the name, option keys or string values.@outside an npm scope.key=valueform. Legacy values that TOML would read as numbers, booleans or dates (1e5,0x10,1_0,true,1979-05-27) are refused. asdf and vfox stay refused.Tokens and scope
api_url, e.g. a GitHub Enterprise server), and mise hands its GitHub token to any GitHub-API-shaped host. The token is the one fix(lookup): mise lists a repository's tools with a token scoped to it #327 gives the lookup, which reaches no further than the repository, so options get it like any other lookup.publiclisting is always fetched with the token of a repository whose own entry asked for that exact tool and options.mise_viaskeys on the full lookup key, and options are part of the package, so one repository's options never carry another repository's token. A new engine test pins this.github_sourcesreturnsNonefor any tool with options, so its listing is shared only from public repositories.ListingScopegainsoptions, andmise-ls-remotegoes to version 3.Instance-metadata endpoints refused
169.254.0.0/16orfe80::/10(IPv4-mapped forms too),fd00:ec2::254,metadata.google.internalormetadatais refused. Any spelling the URL parser normalises (decimal or hex IPv4) is caught. A host that doesn't resolve is refused too, since the Count can't check it. There is no private-range or https-only restriction.AWS_*variable is inherited, its config and credential files point into the scratch home, andAWS_EC2_METADATA_DISABLED=truestops the default chain from fetching the machine's role.Other
A rule's
packagesmatches the bare tool name too (packages: ["rust"]selectsrust[profile=…]).Verification
patchula lookup --here --default-config --jsonexits 0 with no lookup failures. rust, both nu-lint entries and gh-actions-lock (intasks.tomlandcrates/tools/src/lockfiles/defaults.toml) look up. nu-lint is offered 1.9.2; rust and gh-actions-lock are current. http:deepsource is skipped as before (noversion_list_url).osfor another platform.minimum_release_agein brackets filters the listing, as at install.mise tool --jsonin scratch directories).url.patchula-mise,-manager,-datasource,-engine,-notes,-lookup,-updateand-toolspass on the VM. Workspace clippy with-D warningsis clean. The metadata-address tests use IP literals and fixed names, so they need no network; the unresolvable-host test uses.invalid.extract,files,config,config-files,catalog,catalog-controls,changelog,notes-adapter,notes-source-{npm,crates,pypi},notes-adapter-listing,parsed-postgres-sgmlandparsed-go-history.Docs:
guide/managers.md,guide/sources.md,internals/cache.md,renovate/departures.md.