feat(mise): add lock file support#42591
Open
zeitlinger wants to merge 6 commits intorenovatebot:mainfrom
Open
Conversation
fb246dc to
b2c0310
Compare
- Add lockfile.ts with getLockFileName() for deriving lock file paths - Add artifacts.ts with updateArtifacts() and updateLockedDependency() - Add MiseLockFile Zod schema for parsing lock files - Update extract.ts to be async and extract lockedVersion from lock files - Export supportsLockFileMaintenance, lockFileNames, updateArtifacts, updateLockedDependency
Remove comments that simply restate what the code already clearly communicates. Keep valuable comments that explain non-obvious behavior (e.g., why temporary errors are rethrown) and move helpful examples into JSDoc comments.
- Fix lock file key lookup for non-registry tools (aqua:, ubi:, etc.) Registry tools use short names (node), non-registry use full names (aqua:cli/cli). New getLockedVersion() tries both patterns. - Add injection prevention test for shell quoting - Add update-failed test for error handling - Add comprehensive tests for getLockedVersion() - Add null check for depName in updateLockedDependency - Add JSDoc to updateArtifacts and extractPackageFile - Add lock file support documentation to README - Remove code duplication by consolidating into lockfile.ts
When updating mise.local.toml, `mise lock` updates mise.lock, not mise.local.lock. Add --local flag to target the correct lock file. For env-specific configs (mise.test.toml), set MISE_ENV=test so mise reads and locks the correct configuration. Extracted getConfigType() from getLockFileName() to share the parsing logic between lock file name derivation and command flag generation. Builds on renovatebot#42099 by altendky.
b2c0310 to
5482e81
Compare
tools is required by MiseFile schema so if(tools) is always true. depName is always set by createDependency so if(dep.depName) is always true. Add test for tool absent from lock file to cover the lockedVersion assignment branch.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds lock file support to the mise manager. This is a replacement for #42099 (@altendky's draft) with two additional fixes identified during review.
What's included (from #42099):
lockedVersionfrommise.lockduring package file extractionupdateArtifacts(): runmise lock [tools]to update the lock file after dependency changesupdateLockedDependency(): returnalready-updatedwhen the locked version already matchesmise locksupportsLockFileMaintenance,lockFileNamesexportsAdditional fixes (not in #42099):
Fix 1 —
--localflag for local config filesmise lockwithout--localupdatesmise.lock, notmise.local.lock. Processingmise.local.tomlwas silently updating the wrong lock file.Fix 2 —
MISE_ENVfor environment-specific configsmise lockformise.test.tomlneedsMISE_ENV=testto select the right config and updatemise.test.lock. Without it, mise defaults tomise.toml.Closes #40568