Repository navigation
refactor(lock): skip aqua prefix ambiguity pass without override prefixes #14232
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 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
49d97c9
fix(lock): apply aqua version prefixes before selecting overrides
nettlesh b3be663
fix(lock): reject ambiguous aqua version prefixes
nettlesh 134c2c9
refactor(lock): skip prefix ambiguity pass without override prefixes
jdx 6ccff57
test(lock): note that a skipped platform leaves mise lock exiting 0
jdx 1e8000f
Merge origin/main into claude/aqua-lock-prefix-followup
jdx 28adc57
Merge branch 'main' into claude/aqua-lock-prefix-followup
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,69 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| export MISE_LOCKFILE=1 | ||
| export MISE_AQUA_BAKED_REGISTRY=0 | ||
|
|
||
| # An HTTP registry entry has no release-tag lookup. Exercise the same fallback | ||
| # used when a pinned GitHub release is absent from the release listing. | ||
| ASSET="codex-package-x86_64-pc-windows-msvc.tar.gz" | ||
| mkdir -p server/rust-v0.154.0 | ||
| printf 'archive\n' >"server/rust-v0.154.0/$ASSET" | ||
| printf 'old archive\n' >server/old.zip | ||
| printf 'new archive\n' >server/new.zip | ||
| start_http_server --dir server | ||
|
|
||
| REGISTRY_DIR="$PWD/aqua-registry-local" | ||
| mkdir -p "$REGISTRY_DIR" | ||
| cat <<EOF >"$REGISTRY_DIR/registry.yaml" | ||
| packages: | ||
| - type: http | ||
| name: example/codex-package | ||
| version_prefix: rust- | ||
| version_constraint: "false" | ||
| version_overrides: | ||
| - version_constraint: semver("<= 0.133.0-alpha.1") | ||
| url: http://127.0.0.1:$HTTP_PORT/legacy.zst | ||
| format: zst | ||
| - version_constraint: "true" | ||
| url: http://127.0.0.1:$HTTP_PORT/{{.Version}}/codex-package-{{.Arch}}-{{.OS}}.{{.Format}} | ||
| format: tar.gz | ||
| replacements: | ||
| amd64: x86_64 | ||
| windows: pc-windows-msvc | ||
| - type: http | ||
| name: example/ambiguous | ||
| version_constraint: "false" | ||
| version_overrides: | ||
| - version_constraint: "true" | ||
| version_prefix: old-v | ||
| url: http://127.0.0.1:$HTTP_PORT/old.zip | ||
| - version_constraint: "true" | ||
| version_prefix: new-v | ||
| url: http://127.0.0.1:$HTTP_PORT/new.zip | ||
| EOF | ||
| export MISE_AQUA_REGISTRY_URL="file://$REGISTRY_DIR" | ||
|
|
||
| cat <<'EOF' >mise.toml | ||
| [tools] | ||
| "aqua:example/codex-package" = "0.154.0" | ||
| EOF | ||
|
|
||
| mise lock --platform windows-x64 | ||
|
|
||
| assert_contains "cat mise.lock" '"platforms.windows-x64"' | ||
| assert_contains "cat mise.lock" "url = \"http://127.0.0.1:$HTTP_PORT/rust-v0.154.0/$ASSET\"" | ||
|
|
||
| # Both prefix families have reachable archives. A missing tag must not let | ||
| # registry order choose which one gets recorded in the lockfile. | ||
| mkdir ambiguous | ||
| cd ambiguous | ||
| cat <<'EOF' >mise.toml | ||
| [tools] | ||
| "aqua:example/ambiguous" = "1.0.0" | ||
| EOF | ||
|
|
||
| assert_contains "mise lock aqua:example/ambiguous --platform windows-x64 2>&1" "ambiguous aqua version prefixes for 1.0.0: old-v, new-v" | ||
| if [[ -f mise.lock ]]; then | ||
| assert_not_contains "cat mise.lock" "/old.zip" | ||
| assert_not_contains "cat mise.lock" "/new.zip" | ||
| fi | ||
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.
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.
Uh oh!
There was an error while loading. Please reload this page.