Skip to content

fix(aqua): resolve renamed aqua ids before gating the mise-versions mirror - #3

Closed
kkom wants to merge 3 commits into
test/aqua-registry-stale-idsfrom
fix/aqua-mirror-alias-aware-gate
Closed

kkom wants to merge 3 commits into
test/aqua-registry-stale-idsfrom
fix/aqua-mirror-alias-aware-gate

Conversation

@kkom

@kkom kkom commented Aug 19, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • resolve an aliased aqua id to the id its package is keyed by before gating the mise-versions mirror
  • apply the same resolution to the registry-membership lookup that guards the gate

Depends on #2.

Root cause

use_versions_host_for_github_metadata matches the backend's aqua id against the repo the package resolves to, and the shorts_for_full lookup guarding it is exact too, so an id an upstream rename left behind fails both. #1 makes the registry's own ids canonical, which strands the ids that outlive a rename elsewhere: a mise.toml or lockfile pinning aqua:Enter-tainer/typstyle matches no registry entry once the entry is corrected.

Impact

Such a pin keeps the mirror instead of falling back to api.github.com. Only the id is resolved — the mirror is still asked about the repo the package resolves to, never the name it was renamed from. Nothing is lost when the mirror declines: get_release_with_options already falls through to the GitHub API on any failure, so this only adds a path.

Fully realising this needs mise-versions to allowlist the canonical repo as well — it currently keys on whatever string mise registry --json reports.

Validation

  • cargo test --bin mise use_versions_host
  • new test fails as expected when the alias lookup is stubbed to None
  • cargo clippy --bin mise --all-features, cargo fmt --check

AI-assisted — Tool: Claude Code; model: anthropic/claude-opus-5; version: 2.1.233.

Twelve registry entries name their aqua package by an id that aqua-registry
now keeps only as an `aliases:` entry, because the upstream repo was renamed
or transferred. `AquaBackend::use_versions_host_for_github_metadata` gates the
mise-versions mirror on the registry's aqua id matching the repo the package
resolves to, so for these tools the gate is false and metadata requests go
straight to api.github.com — installation fails outright wherever that host is
unreachable even though the release assets are not.

The same stale id also keeps the mirror's allowlist from covering the repo:
mise-versions builds it from `mise registry --json` and takes the slug
literally, so the canonical repo answers 403 while the stale one serves the
release JSON.

Point each entry at the package's canonical id. Binary names are unaffected:
where the repo name diverges from the tool (dekit, gradle-distributions,
sealed-secrets) the aqua package pins the binary with its own `files:`.
@kkom
kkom force-pushed the test/aqua-registry-stale-ids branch from 3d07bf7 to a162e31 Compare August 19, 2026 17:29
@kkom
kkom force-pushed the fix/aqua-mirror-alias-aware-gate branch from 326e1d4 to 2df5c1a Compare August 19, 2026 17:29
kkom added 2 commits August 19, 2026 18:39
An aqua id left behind by an upstream rename still resolves to its package
through the registry's `aliases:`, so the tool installs and nothing looks
wrong — but `use_versions_host_for_github_metadata` compares that id against
the repo the package resolves to, and mise-versions builds its allowlist from
the same string, so the mirror silently drops out and the tool can only be
installed where api.github.com is reachable.

Assert the ids are canonical instead of auditing them by hand. build.rs
already bakes an alias-to-canonical map out of the vendored aqua-registry,
so the check needs no network and runs with the rest of the unit tests, and
a rename surfaces in the aqua-registry bump that introduces it, naming the
id to switch to.

Aliases differing only in case are left alone: the gate lowercases both
sides, so those still match.
…irror

`use_versions_host_for_github_metadata` decides whether GitHub metadata may
come from the mise-versions mirror by comparing the backend's aqua id against
the repo the aqua package resolves to. Both that comparison and the registry
lookup guarding it are exact, so an id upstream has renamed away from fails
them: the package still resolves through aqua-registry's `aliases:`, but the
tool quietly drops to api.github.com and cannot be installed where that host
is unreachable.

Resolve the alias to the id the package is keyed by first. The registry's own
entries are canonical, so this is about the ids that outlive a rename
elsewhere — a mise.toml or a lockfile written before it, which would otherwise
lose the mirror the moment the registry entry is corrected.

Nothing is lost when the mirror declines: get_release_with_options falls
through to api.github.com on any failure.
@kkom
kkom force-pushed the test/aqua-registry-stale-ids branch from a162e31 to d230ee9 Compare August 19, 2026 17:39
@kkom
kkom force-pushed the fix/aqua-mirror-alias-aware-gate branch from 2df5c1a to 78d4024 Compare August 19, 2026 17:39
@kkom
kkom marked this pull request as draft August 19, 2026 17:44
@kkom
kkom force-pushed the test/aqua-registry-stale-ids branch 3 times, most recently from 94f6c50 to 48c8497 Compare August 19, 2026 18:50
@kkom

kkom commented Aug 19, 2026

Copy link
Copy Markdown
Owner Author

Superseded — the alias-aware gate is parked; the registry fixes and the test went upstream as jdx#12186.

@kkom kkom closed this Aug 19, 2026
@kkom
kkom deleted the fix/aqua-mirror-alias-aware-gate branch August 19, 2026 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant