fleetlint Policy for a fleet of repositories
v0.11 (latest)
Getting started

repo/toolchain-pinned/ruby

Toolchain version is pinned

Implements repo/toolchain-pinned for ruby.

Severitywarning
Tiers1, 2
Stacksruby
Scopeeach
Kindexpr
Sourcelibrary v0.8.0
Selected byfleetlint-recommended@v0.8.0

Requirement

.ruby-version names a version, the Gemfile declares ruby "x.y.z", or .tool-versions/mise or devbox.json names ruby with a version. In devbox.json the package needs a version (ruby@3.4, ruby_3_4); @latest does not count.

Why

Without a pin, every machine and every CI run builds with whatever compiler or runtime happens to be installed, and failures cannot be reproduced.

Check

["", "../", "../../", "../../../"].exists(d, file(d + ".ruby-version") && scan(d + ".ruby-version", r'^\s*(ruby-)?\d').size() > 0) || scan("Gemfile", r'^\s*ruby\s+["\x27]\d').size() > 0 || ["", "../", "../../", "../../../"].exists(d, file(d + ".tool-versions") && scan(d + ".tool-versions", r'^\s*(ruby)\s+\S*\d').size() > 0) || ["", "../", "../../", "../../../"].exists(d, ["mise.toml", ".mise.toml", ".config/mise.toml", ".config/mise/config.toml", "mise/config.toml"].exists(n,
     file(d + n) && scan(d + n, r'^\s*"?(ruby)"?\s*=\s*[^#\n]*\d').size() > 0))
|| ["", "../", "../../", "../../../"].exists(d, file(d + "devbox.json") && text(d + "devbox.json").matches(r'"(ruby)(@v?\d|"\s*:\s*("v?\d|\{[^}]*"version"\s*:\s*"v?\d))|"(ruby_\d+_\d+)(@[^"]*)?"'))

Fix

Write the Ruby version to .ruby-version.

Agent instruction (from repo/toolchain-pinned): Add the stack’s toolchain pin set to the version currently installed; do not upgrade the toolchain in the same change.

A finding that names no file points at .ruby-version.

Sources


Generated by fleetlint docs from catalog v0.8.0.