-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat(install): auto-lock all platforms after tool installation #8277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
c6df47d
feat(install): auto-lock all platforms after tool installation
jdx 3a526b7
[autofix.ci] apply automated fixes
autofix-ci[bot] deea3d1
[autofix.ci] apply automated fixes (attempt 2/3)
autofix-ci[bot] 245a43a
fix: address PR review feedback
jdx d9c4c66
fix: filter to mise.toml sources only in auto_lock_new_versions
jdx c7fd507
refactor: extract shared lock resolution logic into lockfile.rs
jdx d0cf7b9
fix(lock): return resolution errors as data instead of logging
jdx 0dbf619
fix(lock): log conda package resolution errors instead of swallowing
jdx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| export MISE_LOCKFILE=1 | ||
|
|
||
| # === Test 1: mise use auto-locks all platforms === | ||
| # When using a tool that supports cross-platform resolution (aqua tool), | ||
| # the lockfile should automatically get entries for all 5 common platforms, | ||
| # not just the current one. | ||
|
|
||
| cat <<EOF >mise.toml | ||
| [tools] | ||
| "aqua:jqlang/jq" = "1.7.1" | ||
| EOF | ||
|
|
||
| touch mise.lock | ||
| mise use "aqua:jqlang/jq@1.7.1" | ||
|
|
||
| # Verify all 5 common platforms are in the lockfile (auto-locked) | ||
| assert_contains "cat mise.lock" "platforms.linux-x64" | ||
| assert_contains "cat mise.lock" "platforms.linux-arm64" | ||
| assert_contains "cat mise.lock" "platforms.macos-x64" | ||
| assert_contains "cat mise.lock" "platforms.macos-arm64" | ||
| assert_contains "cat mise.lock" "platforms.windows-x64" | ||
| assert_contains "cat mise.lock" "jqlang/jq" | ||
|
|
||
| # === Test 2: subsequent install doesn't modify lockfile === | ||
| # Simulates another developer running mise install - lockfile should not change | ||
| # because all platforms are already populated. | ||
|
|
||
| cp mise.lock mise.lock.before | ||
| mise install | ||
| assert "diff mise.lock mise.lock.before" "" | ||
|
|
||
| # === Test 3: mise install auto-locks a newly added tool === | ||
|
|
||
| cat <<EOF >mise.toml | ||
| [tools] | ||
| "aqua:jqlang/jq" = "1.7.1" | ||
| "aqua:mikefarah/yq" = "4.44.6" | ||
| EOF | ||
|
|
||
| mise install | ||
| assert_contains "cat mise.lock" "mikefarah/yq" | ||
| assert_contains "cat mise.lock" "platforms.linux-x64" | ||
|
|
||
| rm -f mise.toml mise.lock mise.lock.before |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolution failures silently downgraded from warn to debug
Medium Severity
When a user explicitly runs
mise lock, resolution failures (e.g., "failed to resolve X for linux-arm64") are now logged atdebug!level instead of the previouswarn!level. This means failures are silently swallowed in normal usage and only visible with verbose logging. Thedebug!level makes sense for the backgroundauto_lock_new_versionspath, but for the explicitmise lockcommand, users expect to see warnings about platforms that failed to resolve.