Skip to content

fix(aqua): drop empty-releases fallback to tags#9443

Merged
jdx merged 2 commits intomainfrom
fix-aqua-empty-releases-fallback
Apr 27, 2026
Merged

fix(aqua): drop empty-releases fallback to tags#9443
jdx merged 2 commits intomainfrom
fix-aqua-empty-releases-fallback

Conversation

@jdx
Copy link
Copy Markdown
Owner

@jdx jdx commented Apr 27, 2026

Summary

Two related fixes from the prerelease feature aftermath:

1. fix(aqua): drop empty-releases fallback to tags

When list_releases_including_prereleases returned Ok([]) — paginated/cached edge case, throttled response, or a repo that genuinely has no releases — the fallback to list_tags pulled in every git tag in the repo. For monorepos that tag sub-crates, that meant non-release tags like ripgrep's grep-regex-0.1.1 surfaced as candidate versions and got written into the shared mise-versions snapshot. End users hitting that snapshot then saw ripgrep = "latest" resolve to grep-regex-0.1.1, which 404s on the GitHub release URL.

Aqua packages that legitimately use git tags as their version source already opt in via version_source = "github_tag"; those continue to work. For everything else, an empty release list now propagates as an empty version list rather than masquerading as "all the tags".

mise-versions snapshots will need to be regenerated with a release that includes this fix.

2. fix(backend): keep remote_versions cache filename stable

The bump to remote_versions_v2.msgpack.z invalidated every existing cache file with no real benefit. VersionInfo deserializes forwards-compatibly (prerelease defaults to false via #[serde(default)]), so old caches read fine. Users opting into pre-releases would just see no extra entries from a pre-feature cache until TTL expiry, which is the same staleness window any cache invalidation creates. Reverting to remote_versions.msgpack.z.

Test plan

  • MISE_FETCH_REMOTE_VERSIONS_CACHE=0 mise ls-remote ripgrep returns ripgrep release versions only (no grep-regex-*, globset-*, etc.)
  • mise install -f ripgrep@latest resolves to a real release
  • No regression for aqua packages with version_source = "github_tag"
  • Existing remote_versions.msgpack.z cache files continue to be read

🤖 Generated with Claude Code

When list_releases_including_prereleases returns Ok([]) (paginated/cached
edge case, throttled response, or a repo that genuinely has no releases),
the empty-result fallback to list_tags pulled in every git tag in the
repo. For monorepos that tag sub-crates, that meant non-release tags like
ripgrep's grep-regex-0.1.1 surfaced as candidate versions — and got
written into the shared remote-versions snapshot, breaking installs for
everyone consuming it.

Aqua packages that legitimately use git tags as their version source
already opt in via version_source = "github_tag"; those continue to work
unchanged. For everything else, an empty release list now propagates as
an empty version list rather than masquerading as "all the tags".
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 27, 2026

Greptile Summary

This PR fixes a bug where Aqua packages without GitHub releases fell back to list_tags, causing monorepo sub-crate tags (e.g. grep-regex-0.1.1 from ripgrep) to be surfaced as candidate versions and written into shared mise-versions snapshots. The fix removes the fallback entirely; packages legitimately using git tags should set version_source = "github_tag". The companion mod.rs change safely reverts the cache filename to its stable base name — VersionInfo.prerelease uses #[serde(default)], so any old pre-v2 cache entries deserialize correctly with prerelease = false.

Confidence Score: 5/5

Safe to merge — minimal, targeted change with no new logic paths introduced.

Both changes are small deletions or renames with clear, well-reasoned motivations. The prerelease serde default makes the cache filename revert backward-compatible, and the fallback removal is the correct fix for the described monorepo tag pollution bug. No new P0 or P1 issues were found.

No files require special attention.

Important Files Changed

Filename Overview
src/backend/aqua.rs Removes the empty-releases → tags fallback in get_tags_with_created_at; packages with version_source = "github_tag" are unaffected via the early-return guard.
src/backend/mod.rs Reverts cache filename from remote_versions_v2.msgpack.z back to remote_versions.msgpack.z; safe because VersionInfo.prerelease carries #[serde(default)], so old cache entries deserialize with prerelease = false.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[get_tags_with_created_at] --> B{version_source == github_tag?}
    B -- Yes --> C[github::list_tags]
    C --> D[return tags with prerelease=false]
    B -- No --> E[github::list_releases_including_prereleases]
    E --> F{releases empty?}
    F -- Yes BEFORE --> G_OLD[github::list_tags fallback]
    G_OLD --> H_OLD[return all repo tags / monorepo tags included]
    F -- Yes AFTER --> I[return empty list]
    F -- No --> J[return releases with tag_name, created_at, prerelease]
Loading

Reviews (2): Last reviewed commit: "fix(backend): keep remote_versions cache..." | Re-trigger Greptile

The bump to `remote_versions_v2.msgpack.z` invalidated every existing
cache file with no real benefit. `VersionInfo` deserializes
forwards-compatibly — `prerelease` defaults to `false` via
`#[serde(default)]`, so old caches read fine. Users opting into
pre-releases would just see no extra entries from a pre-feature cache
until TTL expiry, which is the same staleness window any cache invalidation
would create. Filename churn isn't worth it.
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request removes the fallback logic in the get_tags_with_created_at function within src/backend/aqua.rs, which previously queried GitHub tags if no releases were found. The function now exclusively returns results from the releases API. I have no feedback to provide as there were no review comments to evaluate.

@github-actions
Copy link
Copy Markdown

Hyperfine Performance

mise x -- echo

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.4.24 x -- echo 19.6 ± 0.8 18.2 22.2 1.01 ± 0.05
mise x -- echo 19.5 ± 0.8 18.5 27.5 1.00

mise env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.4.24 env 18.5 ± 0.7 17.5 21.7 1.00
mise env 19.0 ± 0.6 17.9 21.4 1.03 ± 0.05

mise hook-env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.4.24 hook-env 19.6 ± 0.8 18.3 23.6 1.00
mise hook-env 20.4 ± 0.5 19.3 22.1 1.04 ± 0.05

mise ls

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.4.24 ls 20.4 ± 1.0 19.0 30.9 1.00
mise ls 21.3 ± 0.8 19.6 30.9 1.04 ± 0.06

xtasks/test/perf

Command mise-2026.4.24 mise Variance
install (cached) 130ms 132ms -1%
ls (cached) 70ms 69ms +1%
bin-paths (cached) 72ms 72ms +0%
task-ls (cached) 639ms 640ms +0%

@jdx jdx enabled auto-merge (squash) April 27, 2026 21:26
@jdx jdx merged commit 2ceb7ab into main Apr 27, 2026
37 checks passed
@jdx jdx deleted the fix-aqua-empty-releases-fallback branch April 27, 2026 21:26
mise-en-dev added a commit that referenced this pull request Apr 28, 2026
### 🚀 Features

- **(task)** add --name-only flag to mise tasks ls by @jdx in
[#9435](#9435)

### 🐛 Bug Fixes

- **(Dockerfile)** install copr-cli via dnf for better dependency
management by @bestagi in [#9421](#9421)
- **(aqua)** drop empty-releases fallback to tags by @jdx in
[#9443](#9443)
- **(docs)** fix theme flicker on docs by @vhespanha in
[#9427](#9427)
- **(lockfile)** update global lockfile on upgrade by @jdx in
[#9442](#9442)
- **(ls-remote)** omit rolling/prerelease from JSON when false by @jdx
in [#9439](#9439)
- **(task)** support usage refs in dependency template tags by @jdx in
[#9424](#9424)
- **(task)** populate usage.cmd for subcommand-only tasks; share
make_usage_ctx by @jdx in [#9431](#9431)
- **(task)** resolve sandbox allow_read/allow_write against task dir by
@jdx in [#9428](#9428)

### 📚 Documentation

- **(site)** add self-hosted page tracker via Cloudflare Worker, drop
GoatCounter by @jdx in [#9430](#9430)

### New Contributors

- @vhespanha made their first contribution in
[#9427](#9427)

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
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