Repository navigation
fix(lookup): refused lookups say what the Count saw, naming mise tool options - #326
Merged
Merged
Conversation
… options The datasource's 'cannot read X from the registry Y' read badly whenever Y was a reason rather than a registry URL. It is now 'cannot look up X where the repository says it comes from: Y', which reads with a URL, a setting or a clause. mise names the options on a tool's entry that fail its lookup, drops the repeated tool name, and refuses bracketed tool options for what they are. A name the Count will not repeat is left out of the sentence instead of replaced by a placeholder.
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.
The Count's run on his own repository printed lookup failures that read badly. This PR rewrites the whole sentence, not just the fragments.
Before / after
Changes
cannot read {package} from the registry {value}. Every manager'sRegistry::Unusablevalue fills that slot, and most values are descriptions rather than registries:uv --no-index,[tool.uv.sources] in pyproject.toml,no source in Gemfile, the mise reasons. The new sentence iscannot look up {package} where the repository says it comes from: {value}. It reads correctly whether the value is a URL, a setting, a noun phrase or a clause. No recorded registry strings change, so the corpus snapshots and cache keys are untouched.has options that may move …. The[settings]reason is now a clause:settings in mise.toml may move ….origins::shownnow returnsOption<&str>. It still repeats only short[A-Za-z0-9._-]text that a repository wrote, so that safety property is kept. Callers now leave the name out (a source,a uv setting in …,a Poetry source without a URL,a setting in .bundle/config) instead of inserting(a name the Count does not repeat).[is refused with its own message. Other characters say… is not allowed in a tool name.rustandnu-lintentries plus multi-key, unsafe-key and settings cases. There are also tests for the bracket refusal and the datasource sentence.corpus:snapshotproduces no diff. No docs page quoted these strings.Are the refusals right?
rust(profile = "minimal",components = "clippy,rustfmt",mr_boxington = true): refusing this entry is correct, becausemr_boxingtonis not an option mise's rust core plugin knows, and fail-closed applies. However,profile,componentsandtargetscannot move the install source. mise'sRustOptions(src/plugins/core/rust.rs) only passes them torustup toolchain installas install arguments; the dist server comes fromRUSTUP_DIST_SERVER. On their own they should not fail the lookup. Follow-up: allow-listprofile,componentsandtargetsfor the rust core tool.forgejo:wvhulle/nu-lint(api_url = "https://codeberg.org/api/v1"):api_urlis exactly the option that moves the source, so refusing is correct in general. Here, though, the value equals the forgejo backend's documented default (https://codeberg.org/api/v1), so the effective source does not change. Follow-up (optional): treat anapi_urlequal to the backend's default as absent. The comparison must be exact.github:…[bin=gh-actions-lock]: per mise's github backend docs,binonly names the executable of a single-binary download and cannot change the host. Ignoring it would be safe. That is not true of all bracket options:api_urlmoves the host, andversion_prefix,matchingand friends change whatls-remotelists or which asset is picked. Follow-up: strip an allow-list of bracket options that cannot change the source or the version listing (bin,rename_exe) beforecheck, and refuse everything else. This PR does not change the policy.