feat: lock install when mise.lock is present#495
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces automatic detection of mise lock files (such as mise.lock) in the working directory or its parent directories, automatically appending the --locked flag to the mise install command when a lock file is found. The feedback suggests optimizing the lock file detection logic by using fs.statSync with throwIfNoEntry: false to prevent throwing and catching ENOENT exceptions on non-existent directories, which can improve performance.
Greptile SummaryThis PR adds automatic
Confidence Score: 5/5Safe to merge; the auto-detection logic is well-guarded and falls back gracefully when mise lacks The core detection path is correct: the version capability check, the The Important Files Changed
Reviews (5): Last reviewed commit: "fix locked install compatibility" | Re-trigger Greptile |
f9a7adf to
ccdb97b
Compare
Summary
--lockedtomise installwhen a repo mise lock file is presentinstall --lockedmise.lockso it matches the repo's currentmise.tomlWhy
When a repository contains
mise.lock, plainmise installcan update the lock file unexpectedly. This forces workflows to passinstall_args: --lockedas a workaround.This repo also had a stale checked-in
mise.lock:mise.tomlrequestedaube = "v1.14.1", whilemise.lockstill pinned older aube metadata. That mismatch was already breaking CI/bootstrap paths that relied on repo-managed mise config.Breaking-change / compatibility risk
This is a potentially breaking behavior change.
Workflows that previously relied on plain
mise installcontinuing in unlocked mode, despite a repo lockfile being present, will now run in locked mode automatically on mise versions that supportinstall --locked.That means stale or incomplete lockfiles can now cause installs to fail earlier and more explicitly. In practice, this change makes lockfile drift visible instead of silently mutating the lockfile during CI, but it can still break existing workflows until their
mise.lockis brought back in sync.Impact
Users no longer need to manually add
--lockedin the common locked-install case; the action detects the lock file and does it automatically while still respecting explicitinstall_argsand older mise versions that do not support--locked.Updating
mise.lockin this PR is intentional: it brings the repo lockfile back in sync withmise.toml, which is necessary for locked installs and for CI jobs that bootstrap through repo-managed mise configuration.Validation
npm cinpm run allinstall --locked