Repository navigation
fix: derive the Ruby pin in mise.toml from .ruby-version - #26
developerz-ai[bot] merged 1 commit into
Conversation
mise.toml duplicated .ruby-version's literal (ruby = "4.0.9"), so the two could drift silently: bin/setup's mise install would install the stale mise.toml version while CI ran the bumped .ruby-version. mise.toml now reads the pin from .ruby-version via a read_file template, bin/setup stays a bare 'mise install' so the installed toolchain resolves through mise.toml from the same single source, and a new spec/bin/ruby_version_spec.rb fails when any of the three files reintroduces an independent version literal. Dz-Task-Id: tsk_640893e36471b2e8dffe60bdbb0599b6
Benchmarks: x86_64 (linux)
escape_bench (C ext) · peak RSS 119 MB
escape_bench (pure Ruby) · peak RSS 145 MB
render_bench (C ext) · peak RSS 132 MB
render_bench (pure Ruby) · peak RSS 132 MB
tag_bench (C ext) · peak RSS 40 MB
tag_bench (pure Ruby) · peak RSS 27 MB
Rails request (C ext) · peak RSS 242 MB
|
Benchmarks: aarch64 (linux)
escape_bench (C ext) · peak RSS 118 MB
escape_bench (pure Ruby) · peak RSS 150 MB
render_bench (C ext) · peak RSS 131 MB
render_bench (pure Ruby) · peak RSS 131 MB
tag_bench (C ext) · peak RSS 39 MB
tag_bench (pure Ruby) · peak RSS 26 MB
Rails request (C ext) · peak RSS 228 MB
|
✅ Reviewed — nothing blocking0 actionable comment(s) · grounded on your code ⏱ 45s wall clock · 🤖 developerz.ai — automated review, running on your model and your box. |
There was a problem hiding this comment.
Review summary — 2 file(s), 0 finding(s).
Replaces mise.toml's duplicated Ruby literal with a read_file template of .ruby-version and adds a regression spec guarding the single-source pin; the spec's regexes correctly fail on literals, other referenced files, non-X.Y.Z pins and versioned mise args.
- concern-tests: nothing to review — The added spec asserts the contract directly (X.Y.Z shape, read_file template referencing .ruby-version, resolved content equality, bare 'mise install') and the mise.toml template matches it; no loosened assertions or untested behaviour in the diff.
🤖 developerz.ai review — automated, running on your model and your box. What is this? · Reviewed by router/glm-5.3-flash — 22.8k in / 575 out over 2 calls, on your flat-rate plan: no per-token charge (~<$0.01 at list price).
What
mise.toml duplicated .ruby-version's literal (ruby = "4.0.9"), so the two could
drift silently: bin/setup's mise install would install the stale mise.toml
version while CI ran the bumped .ruby-version. mise.toml now reads the pin
from .ruby-version via a read_file template, bin/setup stays a bare 'mise
install' so the installed toolchain resolves through mise.toml from the same
single source, and a new spec/bin/ruby_version_spec.rb fails when any of the
three files reintroduces an independent version literal.
Acceptance
Changes
mise.toml(edit) — Replace the duplicated literal on line 4 (ruby = "4.0.9") with ruby = "{{ read_file(path='.ruby-version') | trim }}" and reword the two header comments to state that .ruby-version is the single source of the Ruby pin and that bin/setup's mise install resolves it. Keep the [tools] table and everything else unchanged.spec/bin/ruby_version_spec.rb(create) — New regression spec enforcing the single-source Ruby pin contract from sharedContext: (1) .ruby-version is an exact X.Y.Z after strip; (2) the ruby request in mise.toml must reference .ruby-version via read_file(path='.ruby-version') — a version literal or any other referenced file fails — and the referenced file's stripped content must equal .ruby-version; (3) bin/setup's only system!('mise ...') call is exactly 'mise install' with no version argument. Style per spec/bin/setup_spec.rb.Verification
./bin/checkpassed (exit 0) in 24s.What the editors ran to see the change working, and what they saw:
code_changes paths=["mise.toml"](toolchain): modified; diff shows ruby = "4.0.9" replaced by ruby = "{{ read_file(path='.ruby-version') | trim }}", header comments reworded, [tools] table unchanged; no runtime check run (brief scoped none)bundle exec rspec spec/bin/ruby_version_spec.rb(tests): 4 examples, 0 failuresdrift matrix: same spec run against mutated scratch copies in /tmp (literal in mise.toml; other referenced file; .ruby-version=4.0; system!('mise install ruby@4.0.9'))(tests): control PASS; all four drift scenarios FAIL with the corresponding expectation failing (e.g. expected "4.0.9" to include "read_file(path='.ruby-version')", expected "4.0" to match /\A\d+.\d+.\d+\z/)Notes
Premises of the request the team disproved:
🤖 Opened by developerz.ai for task
tsk_640893e36471b2e8dffe60bdbb0599b6on sebyx07/ruby2html.Raised automatically by the
raw_task_triagelane.