Skip to content

fix(oci): write a tool with several versions once in the embedded config - #14200

Merged
jdx merged 1 commit into
jdx:mainfrom
JamBalaya56562:fix-oci-multi-version-config
Oct 8, 2026
Merged

jdx merged 1 commit into
jdx:mainfrom
JamBalaya56562:fix-oci-multi-version-config

Conversation

@JamBalaya56562

@JamBalaya56562 JamBalaya56562 commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

mise oci build writes the project's resolved tools into the image as /etc/mise/config.toml. A tool pinned to several versions got one name = "version" line per version. That is a duplicate key, so mise inside the container could not read its own config:

[tools]
java = ["liberica-25", "liberica-17"]
maven = "3.9.16"

became

# Auto-generated by `mise oci build`. Do not edit.
[tools]
java = "liberica-25.0.4+9"
java = "liberica-17.0.20+10"
maven = "3.9.16"

and mise tools in the container failed with Invalid TOML in config file … duplicate key.

Now each tool is written once. A tool with several versions becomes an array, in the order they were resolved, because the first one takes precedence on PATH. A tool with one version is still a string, and the keys keep the short tool name, as before.

This takes over #12732 by @nitschSB, which pr-closer closed after 7 days of failing checks. Those were GitHub API rate limits on the fork run. They are credited as co-author, and the change is theirs. They later re-opened it as #13761, keyed by the full backend name instead (core:java), and closed that one themselves. Greptile and CodeRabbit both flagged that variant: the image keeps installs under the short name's directory, so a full-name key would make mise look in the wrong place. This keeps #12732's short-name keys.

Greptile's remaining finding on #12732 was that its tests built the grouped map by hand, so the grouping step itself went untested. The new repeated_tool_versions_group_into_one_key test feeds resolved tool versions through the grouping and checks two things: a repeated version collapses, and first-seen order holds.

Validation

  • Unit tests in src/oci/builder.rs: a single version renders as a string, several versions render as an ordered array, and repeated resolved versions group into one key.
  • With mise 2026.10.4 in a Debian container, jq = ["1.7.1", "1.6"] and mise oci build --from scratch --no-mise embedded jq = "1.7.1" followed by jq = "1.6". The fixed build is covered by the unit tests above on CI; the end-to-end build was not run with it.

AI-assisted β€” Tool: Claude Code; model: anthropic/claude-opus-5-5; version: unavailable.

πŸ€– Generated with Claude Code

Summary by CodeRabbit

  • Improvements
    • Embedded tool configuration now groups versions by tool, preserves their order, and avoids duplicate versions. Single versions appear as a string; multiple versions appear as an ordered list.

Co-authored-by: nitschSB <mario.melcher@seitenbau.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack β†’

No actionable comments were generated in the recent review. πŸŽ‰

ℹ️ Recent review info
βš™οΈ Run configuration
  • Configuration used: Repository YAML (base), Central YAML (inherited), Organization UI (inherited)
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b7971235-4c1b-4304-a482-bdac3cf00469
πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between c270ec0 and a9d7f61.

πŸ“’ Files selected for processing (1)
  • src/oci/builder.rs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.


πŸ“ Walkthrough

Walkthrough

The embedded mise.toml generator groups versions by backend short name, removes duplicate versions, and preserves first-seen order. It renders one distinct version as a string and multiple versions as an ordered array. Tests cover these output shapes and repeated versions.

Changes

Embedded configuration

Layer / File(s) Summary
Group and render tool versions
src/oci/builder.rs
The generator groups each tool’s distinct versions in first-seen order. It renders a single version as a string and multiple versions as an ordered array. Tests check both shapes, ordering, and duplicate removal.

Priority: βž– Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: jdx

Merge Risk: βšͺ Minimal Β· up to a9d7f

The change is mergeable after normal checks; no actionable risk remains identified.

πŸš₯ Pre-merge checks | βœ… 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
βœ… Passed checks (4 passed)
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: grouping a tool's multiple versions under one key in the embedded OCI configuration.
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.
  • Fix all pre-merge checks with AI
  • Autopilot Β· Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@jdx
jdx enabled auto-merge (squash) October 8, 2026 23:30
@jdx
jdx merged commit 35c67fd into jdx:main Oct 8, 2026
62 checks passed
@JamBalaya56562
JamBalaya56562 deleted the fix-oci-multi-version-config branch October 8, 2026 23:53
mise-en-dev added a commit that referenced this pull request Oct 9, 2026
<!-- entire-trail-link-start -->
https://entire.io/gh/jdx/mise/trails/585
<!-- entire-trail-link-end -->

### πŸš€ Features

- **(bootstrap)** offer to install git and ssh before cloning a
repository by @jdx in [#14188](#14188)
- **(config)** allow local paths in include by @jdx in
[#14178](#14178)
- **(dotfiles)** add `mise dot save --re-encrypt` by @jdx in
[#14210](#14210)
- **(dotfiles)** show unsaved changes in `mise dot status` by @jdx in
[#14209](#14209)
- **(task)** include working-tree changes in --affected and drop the
experimental gate by @jdx in
[#14214](#14214)
- **(vars)** ask once and remember [vars] answers per machine with mise
vars prompt by @jdx in [#14190](#14190)

### πŸ› Bug Fixes

- **(config)** do not panic for a config file at the filesystem root by
@jdx in [#14182](#14182)
- **(dotfiles)** don't say nothing is configured when history tracks
entries by @jdx in [#14206](#14206)
- **(dotfiles)** stop re-warning about approved plaintext files by @jdx
in [#14204](#14204)
- **(dotfiles)** ask the plaintext question only of a terminal by @jdx
in [#14205](#14205)
- **(dotfiles)** name the checkpoints rollback and undo restore and
record by @jdx in [#14207](#14207)
- **(dotfiles)** don't credit rollback to a checkpoint past a truncated
change list by @jdx in [#14211](#14211)
- **(dotfiles)** list every encrypted file a sync cannot unlock by @jdx
in [#14208](#14208)
- **(dotnet)** validate the SDK being installed, not the active one by
@jdx in [#14189](#14189)
- **(exec)** skip lazy tools that are not installed when resolving after
an install by @jdx in [#14197](#14197)
- **(go)** install tools whose published go.mod is not tidy by
@JamBalaya56562 in [#14180](#14180)
- **(npm)** raise the soft open-file limit at startup by @jdx in
[#14174](#14174)
- **(npm)** build the open-file limit raise on 32-bit targets by @jdx in
[#14216](#14216)
- **(oci)** write a tool with several versions once in the embedded
config by @JamBalaya56562 in
[#14200](#14200)
- **(release)** fix Full Changelog base tag and cross-link changelog and
release notes by @jdx in
[#14199](#14199)
- **(shim)** skip directories when resolving a tool's bin name by @jdx
in [#14193](#14193)
- **(shim)** skip other missing lazy tools when a lazy tool installs on
first use by @jdx in [#14201](#14201)
- **(upgrade)** skip remote lookups for missing lazy tools during
auto_update by @jdx in [#14195](#14195)

### 🚜 Refactor

- **(core)** return the macOS sandbox command as a tail expression by
@jovial-liu in [#14184](#14184)

### πŸ§ͺ Testing

- **(upgrade)** cover auto_update from system config by @jdx in
[#14185](#14185)

### πŸ“¦οΈ Dependency Updates

- update jdx crates to v7 by @renovate[bot] in
[#14203](#14203)

### Chore

- **(ci)** lint workflows with jactionlint by @jdx in
[#14191](#14191)
- add OSS Scanner build files by @jdx in
[#14212](#14212)

### Ci

- add shared release fix notifications by @jdx in
[#14196](#14196)

### New Contributors

- @jovial-liu made their first contribution in
[#14184](#14184)

## πŸ“¦ Aqua Registry Updates

### Updated Packages (1)

- [`charmbracelet/crush`](https://github.com/charmbracelet/crush)
@nitschSB

Copy link
Copy Markdown
Contributor

Thank you very much

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.

3 participants