Skip to content

feat(config): parse registry idiomatic version files - #11341

Merged
jdx merged 9 commits into
mainfrom
agent/idiomatic-file-parsing
Jul 26, 2026
Merged

feat(config): parse registry idiomatic version files#11341
jdx merged 9 commits into
mainfrom
agent/idiomatic-file-parsing

Conversation

@jdx

@jdx jdx commented Jul 26, 2026

Copy link
Copy Markdown
Owner

Summary

  • allow registry idiomatic_files entries to define version_regex, version_json_path, and version_expr parser metadata
  • reuse the existing HTTP/S3 version-list parser in-process for Aqua, GitHub, and other registry backends
  • preserve filename-only entries and backend-native parsing as compatibility fallbacks
  • support structured parsers in baked and floating registries
  • give configured parsers precedence over native parsing and support nested idiomatic paths
  • document the registry format, selection behavior, and supported tool catalog

Registry coverage

This PR adds idiomatic parsing for 11 registry tools:

  • Dagger: dagger.jsonengineVersion
  • Task: all standard Taskfile.yml / Taskfile.yaml casing variants → version
  • chezmoi: .chezmoiversion
  • CMake: CMakeLists.txtcmake_minimum_required(VERSION ...)
  • Earthly: EarthfileVERSION
  • golangci-lint: all four documented config formats → config major
  • GoReleaser: all six documented config paths → config major
  • Lefthook: YAML, TOML, JSON, and JSONC names, including nested .config/ paths → min_version
  • Pixi: pixi.toml and pyproject.tomlrequires-pixi
  • pre-commit: .pre-commit-config.yamlminimum_pre_commit_version
  • Ruff: ruff.toml and .ruff.tomlrequired-version

The catalog intentionally uses only exact versions, minimum/required versions, or configuration-format majors that are coupled to the compatible CLI major. It avoids unrelated project and schema version fields.

User impact

Users continue opting in per tool:

mise settings add idiomatic_version_file_enable_tools dagger task lefthook

Existing filename-only entries behave unchanged. Structured parsing runs in-process and does not execute plugin or shell code.

Popularity

  • Task: 29,815 mise downloads and 117 tracked versions
  • Dagger: 5,083 mise downloads and 935 tracked versions
  • Lefthook: 105,691 mise downloads and 218 tracked versions
  • chezmoi: 13,614 mise downloads and 255 tracked versions
  • The remaining additions are existing registry tools with established official configuration formats.

Validation

  • mise run lint
  • mise run lint-fix
  • mise run test:unit — 1,969 passed
  • cargo test registry_idiomatic_file
  • cargo test dynamic_registry
  • mise run test:e2e backend/test_registry_idiomatic_version_files — all 11 tools passed

This pull request was generated by an AI coding assistant.

Summary by CodeRabbit

  • New Features
    • Registry-backed tools can now configure idiomatic file version parsing using structured idiomatic_files entries (path + optional rules).
    • Added support for version_regex, version_json_path, and version_expr.
  • Bug Fixes
    • Improved idiomatic-version-file detection by matching registry-defined parsers via path-suffix specificity/precedence, with registry-first parsing fallback.
    • Registry rejects unknown idiomatic_files fields.
  • Documentation
    • Updated configuration and contributing docs with new idiomatic-version-file behavior and examples.
  • Schema
    • Updated the registry tool JSON schema for the new idiomatic_files shape.
  • Tests
    • Expanded backend and end-to-end coverage, including filename variants (e.g., Taskfile.yml vs Taskfile.yaml).

Note

Medium Risk
Changes affect config discovery and version resolution across many tools; incorrect regex/JSON paths could mis-resolve versions, though behavior remains opt-in via idiomatic_version_file_enable_tools and plain entries stay compatible.

Overview
Registry idiomatic_files can now be plain paths or tables with version_regex, version_json_path, and version_expr (same model as the HTTP backend). Build-time and runtime registry loading both accept the new shape; unknown table keys are rejected.

Parsing runs in-process via version_list::parse_version_list when a registry spec defines a parser. Registry parsers take precedence over backend-native idiomatic parsing; entries without parsers still fall back to plain-text or plugin behavior. Path matching uses suffix specificity (e.g. nested .config/goreleaser.yaml over generic names).

Discovery no longer keys only on file_name(): config detection and idiomatic tool resolution match full relative paths and pick the most specific registered filename.

Core plugins drop duplicated _idiomatic_filenames in favor of centralized registry/*.toml entries (including many language runtimes). New structured parsers are added for tools such as dagger, task, cmake, lefthook, goreleaser, pixi, ruff, and others; yarn gains .yvmrc in idiomatic files.

Docs explain registry parsers and minimum/major version semantics; the idiomatic-files table is regenerated from the baked registry via mise render-help. Schema, contributing guide, unit tests, and an e2e script cover the 11 structured tools.

Reviewed by Cursor Bugbot for commit 7e243d6. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Registry idiomatic files now support string or structured entries with version parsers. Schemas, TOML parsing, code generation, backend discovery and parsing, registry entries, tests, and documentation were updated.

Changes

Registry idiomatic files

Layer / File(s) Summary
Registry contract and code generation
src/registry.rs, schema/mise-registry-tool.json, build.rs
Registry entries support path-only strings or structured parser configurations, with validated fields and generated RegistryIdiomaticFile expressions.
Backend discovery and version parsing
src/backend/mod.rs, src/config/mod.rs
Backend parsing uses matching registry specifications, while idiomatic configuration matching supports relative and nested paths with specificity selection.
Registry entries, end-to-end coverage, and documentation
registry/*.toml, e2e/backend/test_registry_idiomatic_version_files, docs/configuration.md, docs/contributing.md
Registry manifests configure parser-backed idiomatic files; tests verify JSON, YAML, and filename variants; documentation describes configuration and enablement rules.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Backend
  participant Registry
  participant IdiomaticFile
  participant VersionParser
  Backend->>Registry: Find matching idiomatic file specification
  Registry-->>Backend: Return path and parser fields
  Backend->>IdiomaticFile: Read configured file
  IdiomaticFile-->>Backend: Return file contents
  Backend->>VersionParser: Parse contents with registry parser
  VersionParser-->>Backend: Return parsed versions
Loading

Poem

I hop through paths where versions hide,
With parser petals opened wide.
JSON leaves now yield their tune,
Registry stars light up the moon.
Squeak—structured files are blooming bright!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 37.50% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding config support for parsing registry idiomatic version files.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Registry idiomatic-version files now support structured parser metadata and nested-path matching.

  • Adds regex, JSON-path, and expression parsing metadata to baked and floating registry entries.
  • Routes discovered idiomatic files through configured registry parsers before backend-native fallbacks.
  • Preserves relative path components and selects the most specific matching registry path.
  • Adds registry catalog entries, schema validation, documentation generation, and end-to-end coverage.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains; the previously reported nested-directory parser bypass is fixed by preserving full discovered paths and matching structured registry entries with path-component-aware suffix selection.

Important Files Changed

Filename Overview
src/backend/mod.rs Adds in-process registry parser dispatch; full discovered paths are suffix-matched against structured specs, fixing the previously reported nested-path bypass.
src/config/config_file/mod.rs Reworks idiomatic-file detection to retain relative paths and choose matches by path-component specificity.
src/config/mod.rs Integrates path-aware idiomatic discovery and parsing into config loading.
src/registry.rs Extends baked and dynamic registry models to represent structured idiomatic-file parser metadata.
build.rs Generates structured idiomatic-file specifications while validating supported registry fields.
schema/mise-registry-tool.json Allows either filename strings or validated structured parser objects for idiomatic files.
e2e/backend/test_registry_idiomatic_version_files Covers structured parsing across the new tool catalog, including nested registry paths.

Reviews (9): Last reviewed commit: "fix(ci): satisfy clippy for idiomatic fi..." | Re-trigger Greptile

Comment thread src/backend/mod.rs Outdated

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/backend/mod.rs`:
- Around line 2128-2135: Update both wrappers, including
parse_idiomatic_file_with_options and the surrounding parse flow in the shown
function, to resolve and run a matching configured registry parser before the
native package.json parsing early return. Retain native parsing only when no
parser-bearing registry spec matches, and preserve the existing
parse_registry_idiomatic_file fallback behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: e337a5c9-803c-47a8-b4e4-3998c5cc1d6d

📥 Commits

Reviewing files that changed from the base of the PR and between 35de0e2 and 6062323.

📒 Files selected for processing (6)
  • build.rs
  • docs/configuration.md
  • docs/contributing.md
  • schema/mise-registry-tool.json
  • src/backend/mod.rs
  • src/registry.rs

Comment thread src/backend/mod.rs Outdated

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
e2e/backend/test_registry_idiomatic_version_files (1)

14-26: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Cover all configured Taskfile filename variants.

This test exercises Taskfile.yml and taskfile.yaml, but the registry also adds Taskfile.yaml and taskfile.yml. Add assertions for the two missing names so each configured discovery path is verified.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@e2e/backend/test_registry_idiomatic_version_files` around lines 14 - 26,
Extend the filename-variant coverage in the test around the existing Taskfile
assertions by also creating and validating both missing names, Taskfile.yaml and
taskfile.yml. Ensure each variant contains version 3.17 and is checked with the
same “mise tool task” assertion flow as the existing files.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@registry/task.toml`:
- Line 4: Update the Taskfile version_regex matcher in the registry entry to
prevent matching across lines: replace newline-permitting prefix components such
as \s* and [^0-9]* with equivalents restricted to horizontal whitespace and
non-newline characters, while preserving the existing version capture and
anchored version: line behavior. Apply the same correction to the related
Taskfile matchers on lines 4–7.

---

Nitpick comments:
In `@e2e/backend/test_registry_idiomatic_version_files`:
- Around line 14-26: Extend the filename-variant coverage in the test around the
existing Taskfile assertions by also creating and validating both missing names,
Taskfile.yaml and taskfile.yml. Ensure each variant contains version 3.17 and is
checked with the same “mise tool task” assertion flow as the existing files.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 10e9f418-1a47-4ef1-b60b-2592bb9e6349

📥 Commits

Reviewing files that changed from the base of the PR and between 6062323 and a515c45.

📒 Files selected for processing (3)
  • e2e/backend/test_registry_idiomatic_version_files
  • registry/dagger.toml
  • registry/task.toml

Comment thread registry/task.toml Outdated
@github-actions

github-actions Bot commented Jul 26, 2026

Copy link
Copy Markdown

Hyperfine Performance

mise x -- echo

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.7.14 x -- echo 16.7 ± 0.8 15.4 19.9 1.00
mise x -- echo 18.3 ± 1.5 16.7 38.2 1.09 ± 0.10

mise env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.7.14 env 16.1 ± 0.8 14.7 19.4 1.00
mise env 17.2 ± 0.8 15.9 21.1 1.07 ± 0.07

mise hook-env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.7.14 hook-env 16.7 ± 0.8 15.3 20.9 1.00
mise hook-env 18.0 ± 0.9 16.6 22.6 1.08 ± 0.07

mise ls

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.7.14 ls 14.4 ± 0.6 13.2 17.7 1.00
mise ls 16.2 ± 1.1 14.3 22.1 1.12 ± 0.09
⚠️ Inconclusive: ls measured 12% slower, but the relative uncertainty overlaps the 10% threshold.

xtasks/test/perf

Command mise-2026.7.14 mise Variance
install (cached) 159ms 174ms -8%
ls (cached) 62ms 64ms -3%
bin-paths (cached) 66ms 69ms -4%
task-ls (cached) 88ms 91ms -3%

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@registry/cmake.toml`:
- Line 8: Update the version_regex entry in the CMake registry configuration to
capture only the minimum version before an optional CMake policy range, so
cmake_minimum_required(VERSION 3.25...3.28) yields 3.25. If the generated
toolset must include the upper policy bound, handle that separately through
version_expr rather than expanding the capture.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: b543df93-f0b8-4b17-84a9-cfe6e85a4b66

📥 Commits

Reviewing files that changed from the base of the PR and between f4acbfc and 97d0ebc.

📒 Files selected for processing (12)
  • docs/configuration.md
  • docs/contributing.md
  • e2e/backend/test_registry_idiomatic_version_files
  • registry/chezmoi.toml
  • registry/cmake.toml
  • registry/earthly.toml
  • registry/golangci-lint.toml
  • registry/goreleaser.toml
  • registry/lefthook.toml
  • registry/pixi.toml
  • registry/pre-commit.toml
  • registry/ruff.toml
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/contributing.md

Comment thread registry/cmake.toml Outdated
Comment thread registry/golangci-lint.toml Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 018f41a. Configure here.

Comment thread src/config/mod.rs
@jdx
jdx enabled auto-merge (squash) July 26, 2026 22:22
@jdx
jdx merged commit 7181886 into main Jul 26, 2026
35 checks passed
@jdx
jdx deleted the agent/idiomatic-file-parsing branch July 26, 2026 22:52
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.

1 participant