Repository navigation
refactor(update): one descriptor per lockfile tool - #221
Merged
Merged
Conversation
Each lockfile ecosystem now declares a single Tool descriptor beside its implementation: the managers that steer its fetches, the tool versions it resolves, whether it resolves them at all, and how its pins install. descriptor() maps Ecosystem exhaustively, so a new ecosystem fails to compile until it has one, and tools::defaults(), versions() and the driver's dispatch all read the descriptors instead of duplicating the inventory. - Job's targeted-vs-directory shape is a Scope enum; custom serde keeps the flat package/current/target wire fields so job identities and the hashes they feed stay byte-identical. - "Nearest file at or above a directory" is one upward()/nearest_dir() helper over snapshot paths, used by job(), versions(), .python-version, global.json and the pin readers. - versions() takes its tool list from the descriptors and now honours .tool-versions under mise's precedence (.mise.toml > mise.toml > .tool-versions, deeper over shallower); docs already described it. - defaults.toml is parsed once behind a cache and now also pins nix; mise.rs no longer re-parses the embedded file. - Cache partitions are a typed Partition whose Display reproduces the public/private-<hash>/installation-<id> directory names exactly, and prune() matches on parsed partitions. The GOFLAGS merge lives in caches.rs and the installation-or-CLI token fallback in one github_token(). - NodeContext is built once per (ecosystem, directory) group; the cargo, go and terraform bodies moved into their own modules; the discarded python bool is gone and Runner::prepare is deleted (tests use prepare_all). Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
There was a problem hiding this comment.
All reported issues were addressed across 22 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
Merged
sweepies
added a commit
that referenced
this pull request
Nov 10, 2026
…g every path (#234) * perf(update): find the nearest lockfile by walking up, not by scanning every path #221 replaced the directory walk #201 introduced with a filter over every path in the repository, once per dependency. On grafana, mastodon and sentry that put the warm policy phase at 1.3 s instead of 0.3 s. upward now walks from the directory to the root and looks each candidate up; it takes a lookup-only Paths trait, so it cannot scan again. * test(update): pin upward's root-first, name-ordered results
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.
Thirteenth in the untangle series.
Why
crates/update/src/lockfiles*stated per-ecosystem facts in many places that had to agree:versions()hardcoded about 15 tools that had to matchdefaults.toml,tools::defaults(),SEEDABLE, thecachesbins andnix::BUILDS.defaults.tomlwas parsed in four places.GOFLAGSmerge was split between two files by a literal key, and the installation-or-CLI-token fallback was duplicated.Jobencoded "targeted or whole directory" inOptionfields, built three ways..tool-versionswas honoured bymise.lockbut ignored for tool versions, so a repository pinningnodethere got lock runs on the default node.(Invocation, bool)value,NodeContextbuilt five times, and a test-onlyRunner::prepare.What
Tooldescriptor per lockfile ecosystem:steers,tools,versionsandinstall, behind one exhaustivedescriptor(Ecosystem).tools::defaults()andversions()'s tool list derive from the descriptors.defaults.tomlparsed once (OnceLock), with nix's pin moved into it.upward()/nearest_dir()replace the four implementations, with mise's precedence (.mise.toml>mise.toml>.tool-versionsin a directory, deeper over shallower).Scopeenum for jobs:Directory | Package { package, current, target }. It serializes to the old flat fields in the old order, so job identities, maintenance fingerprints, branches and plan hashes are byte-identical (pinned bylock_jobs_keep_their_serialized_field_layout).Partition:Public | Private(hash) | Installation(id), whoseDisplayreproduces today's directory names.pruneparses them.github_token) and theGOFLAGSmerge (caches::goflags).NodeContextandRunner::prepare.Behaviour change
.tool-versionspins now apply to lockfile tool versions, as the lockfiles guide already says. A test is added.Real-tool tests (
mise run test:tools): 18 passed.