Skip to content

refactor(aqua): bake aqua registry from merged yaml#9043

Merged
jdx merged 23 commits intojdx:mainfrom
risu729:codex/aqua-baked-registry-yaml
Apr 23, 2026
Merged

refactor(aqua): bake aqua registry from merged yaml#9043
jdx merged 23 commits intojdx:mainfrom
risu729:codex/aqua-baked-registry-yaml

Conversation

@risu729
Copy link
Copy Markdown
Contributor

@risu729 risu729 commented Apr 11, 2026

Summary

  • Replace the baked aqua-registry source with the upstream merged registry.yaml file, pinned by crates/aqua-registry/aqua-registry/metadata.json.
  • Parse the merged registry in crates/aqua-registry/build.rs and generate a canonical package-id to YAML map plus a separate alias lookup map, so runtime baked lookup only parses the selected package YAML.
  • Expose the pinned baked registry metadata from the aqua-registry crate and show it in mise doctor.
  • Update release tooling to pin aqua-registry by tag and list included upstream aqua-registry release tags in the changelog.
  • Update docs, vendored-file metadata, and the vendored-file warning workflow for the vendored crates/aqua-registry/aqua-registry/** tree.

Notes

  • The pinned upstream aqua-registry tag is v4.492.0; the vendored registry.yaml and LICENSE match that tag.
  • The baked registry build script uses eyre::Result/WrapErr for contextual build errors.
  • Baked registry keys intentionally follow the merged registry's canonical package IDs: name, then repo_owner/repo_name, then path for path-only packages. Legacy pkgs/** file paths such as _go/sigsum.org/sigsum-go/cmd/sigsum-key and crates.io/dskkato/rjo are aqua-registry implementation details and are not preserved as baked aliases.
  • Release changelog generation lists the included upstream aqua-registry release tags between the previous and new pinned tags. If the previous tag is not found, it skips the aqua-registry changelog section.
  • External/local aqua registry handling intentionally stays on the existing pkgs/<id>/registry.yaml path for a follow-up PR.
  • mise registry aliases are intentionally unchanged.
  • crates/aqua-registry/aqua-registry/pkgs/** is restored in a separate commit so it can be reverted later.

Future follow-ups

  • Remove crates/aqua-registry/aqua-registry/pkgs/** in a separate PR to keep this diff reviewable.
  • Compress the generated per-package YAML blobs with zstd to reduce the final binary size while keeping lazy per-package parsing.

Tests

  • cargo fmt
  • cargo test -p aqua-registry
  • cargo check --all-features
  • cargo check -p mise --all-features
  • cargo build -p mise --all-features
  • git diff --check
  • bash -n scripts/gen-aqua-changelog.sh xtasks/release-plz
  • cargo package -p aqua-registry --allow-dirty --list
  • ./scripts/gen-aqua-changelog.sh v4.491.0 v4.492.0 ###
  • ./scripts/gen-aqua-changelog.sh v4.492.0 v4.492.0 ###
  • ./scripts/gen-aqua-changelog.sh v0.0.0 v4.492.0 ###
  • target/debug/mise doctor -J | rg 'baked_in_registry'
  • target/debug/mise doctor | rg -A2 '^aqua'

This PR body was generated by Codex.

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 updates the Cargo.toml file to explicitly include LICENSE and registry.yaml from the aqua-registry/ directory in the packaged crate. I have suggested that it might be more robust to include the entire aqua-registry/ directory to ensure that any future data files or metadata are automatically included without needing further updates to the include list.

Comment thread crates/aqua-registry/Cargo.toml
@risu729 risu729 force-pushed the codex/aqua-baked-registry-yaml branch from 7ad7f50 to 47fcd35 Compare April 11, 2026 07:21
@risu729 risu729 changed the title Refactor aqua registry baking refactor(backend): bake aqua registry from merged yaml Apr 11, 2026
@risu729 risu729 changed the title refactor(backend): bake aqua registry from merged yaml refactor(aqua): bake aqua registry from merged yaml Apr 11, 2026
@risu729 risu729 force-pushed the codex/aqua-baked-registry-yaml branch from 47fcd35 to b8bf855 Compare April 11, 2026 07:31
@risu729 risu729 marked this pull request as draft April 11, 2026 07:46
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 11, 2026

Greptile Summary

This PR replaces the per-package pkgs/**/registry.yaml vendoring strategy with a single merged registry.yaml snapshot pinned by metadata.json, and updates the build script to parse it into three generated maps (canonical files, aliases, and metadata). The release tooling is updated to download the merged file and generate a tag-range changelog via the GitHub API, and mise doctor now surfaces the pinned repository and tag.

Confidence Score: 5/5

Safe to merge; all remaining findings are P2 style/cleanup suggestions that do not affect correctness.

The refactor is well-scoped, tests cover canonical lookup, path-only packages, alias resolution, and metadata structure. The two flagged items are a dead code branch in the shell script (harmless) and a minor semantic mismatch using serde_yaml to parse JSON (works in practice). No P0/P1 issues found.

No files require special attention.

Important Files Changed

Filename Overview
crates/aqua-registry/build.rs Rewrites the build script to parse the merged registry.yaml and emit three generated files (files, aliases, metadata). Logic is sound; minor issue is using serde_yaml to parse the JSON metadata.json.
crates/aqua-registry/src/registry.rs Adds AQUA_STANDARD_REGISTRY_METADATA static and alias lookup map; baked_registry_file helper correctly falls through canonical to alias to files; tests are thorough and properly structural.
scripts/gen-aqua-changelog.sh Switches from per-file diff to tag-range listing via gh CLI. Main logic is correct; the empty-tags guard on line 49 is unreachable dead code.
xtasks/release-plz Replaces git-clone + find with gh release view + curl for downloading registry.yaml, LICENSE, and metadata.json. Clean approach.
src/cli/doctor/mod.rs Exposes baked_in_registry_repository and baked_in_registry_tag in the doctor JSON output and the human-readable string.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["registry.yaml"] -->|build.rs parses| B["package_registries()"]
    B --> C["registry_files_code()\ncanonical id to YAML"]
    B --> D["registry_aliases_code()\nalias to canonical id"]
    E["metadata.json"] -->|build.rs| F["generate_registry_metadata()"]
    C -->|include!| G["AQUA_STANDARD_REGISTRY_FILES"]
    D -->|include!| H["AQUA_STANDARD_REGISTRY_ALIASES"]
    F -->|include!| I["AQUA_STANDARD_REGISTRY_METADATA"]
    G --> J["baked_registry_file(id)"]
    H --> J
    J --> K["fetch_registry() returns YAML"]
    I --> L["mise doctor output"]
Loading

Reviews (16): Last reviewed commit: "Merge branch 'main' into codex/aqua-bake..." | Re-trigger Greptile

Comment thread xtasks/release-plz Outdated
Comment thread scripts/gen-aqua-changelog.sh Outdated
Comment thread scripts/gen-aqua-changelog.sh Outdated
Comment thread src/cli/doctor/mod.rs Outdated
@risu729 risu729 marked this pull request as ready for review April 11, 2026 17:29
Comment thread crates/aqua-registry/src/registry.rs Outdated
@jdx
Copy link
Copy Markdown
Owner

jdx commented Apr 11, 2026

what's the reason for this @risu729 ?

@risu729
Copy link
Copy Markdown
Contributor Author

risu729 commented Apr 11, 2026

Sorry I forgot to add this.
I wanted to support custom registries, but the current pkgs/**/*.yaml is not standard, just aqua-registry's choice.
We can continue using it for the default registry as I think they don't change the directory structure soon and the current implementation support the recursive scanning, but I thought it's better to use the same format for baked in registry and the external registry.
I'm gonna work on the custom registry in another PR.

@jdx jdx merged commit b114eb5 into jdx:main Apr 23, 2026
35 checks passed
@risu729 risu729 deleted the codex/aqua-baked-registry-yaml branch April 23, 2026 13:57
mise-en-dev added a commit that referenced this pull request Apr 24, 2026
### 🐛 Bug Fixes

- **(config)** resolve relative path: tool versions against config root
by @jdx in [#9320](#9320)
- **(lock)** resolve @latest and prune poisoned lockfile entries by @jdx
in [#9321](#9321)
- fix - be able to work with regex in attestation check by @monotek in
[#9327](#9327)

### 🚜 Refactor

- **(aqua)** bake aqua registry from merged yaml by @risu729 in
[#9043](#9043)

### 📚 Documentation

- add cross-site announcement banner by @jdx in
[#9326](#9326)
- keep banner height in sync via ResizeObserver by @jdx in
[#9330](#9330)
- respect banner expires field by @jdx in
[#9334](#9334)

### 📦️ Dependency Updates

- bump communique to 1.0.2 by @jdx in
[#9313](#9313)
- bump communique to 1.0.3 by @jdx in
[#9332](#9332)
- update actions/setup-node digest to 48b55a0 by @renovate[bot] in
[#9339](#9339)
- update ghcr.io/jdx/mise:alpine docker digest to a92efa5 by
@renovate[bot] in [#9340](#9340)
- update ghcr.io/jdx/mise:rpm docker digest to 5c24f69 by @renovate[bot]
in [#9343](#9343)
- update rust docker digest to e4f09e8 by @renovate[bot] in
[#9345](#9345)
- update rui314/setup-mold digest to 9c9c13b by @renovate[bot] in
[#9344](#9344)
- update ghcr.io/jdx/mise:deb docker digest to a3afe3e by @renovate[bot]
in [#9342](#9342)
- update ghcr.io/jdx/mise:copr docker digest to 4098d5a by
@renovate[bot] in [#9341](#9341)
- update taiki-e/install-action digest to 74e87cb by @renovate[bot] in
[#9346](#9346)

### Chore

- **(ci)** remove cargo-vendor install from ppa publish by @jdx in
[#9312](#9312)
- **(release)** publish snap to stable channel by @jdx in
[#9318](#9318)
- remove FUNDING.yml in favor of jdx/.github default by @jdx in
[#9331](#9331)

## 📦 Aqua Registry

Updated [aqua-registry](https://github.com/aquaproj/aqua-registry):
[v4.492.0](https://github.com/aquaproj/aqua-registry/releases/tag/v4.492.0)
->
[v4.498.0](https://github.com/aquaproj/aqua-registry/releases/tag/v4.498.0).

Included aqua-registry releases:

-
[v4.493.0](https://github.com/aquaproj/aqua-registry/releases/tag/v4.493.0)
-
[v4.494.0](https://github.com/aquaproj/aqua-registry/releases/tag/v4.494.0)
-
[v4.494.1](https://github.com/aquaproj/aqua-registry/releases/tag/v4.494.1)
-
[v4.495.0](https://github.com/aquaproj/aqua-registry/releases/tag/v4.495.0)
-
[v4.496.0](https://github.com/aquaproj/aqua-registry/releases/tag/v4.496.0)
-
[v4.497.0](https://github.com/aquaproj/aqua-registry/releases/tag/v4.497.0)
-
[v4.498.0](https://github.com/aquaproj/aqua-registry/releases/tag/v4.498.0)
jdx added a commit that referenced this pull request Apr 29, 2026
## Summary

The release PR description was previously listing the aqua-registry
release tags rolled into a mise release (e.g. `v4.491.0`, `v4.492.0`,
...), which reads as opaque version noise to users. This restores the
pre-[#9043](#9043) behavior of listing
the actual added and updated packages, but adapted to work against the
merged `registry.yaml` that #9043 introduced.


[`scripts/gen-aqua-changelog.sh`](https://github.com/jdx/mise/blob/main/scripts/gen-aqua-changelog.sh)
now:
- Fetches the previous tag's `registry.yaml` from upstream
`aquaproj/aqua-registry`.
- Parses both old and new files by canonical package id (`name` →
`repo_owner/repo_name` → `path`), matching
`crates/aqua-registry/build.rs::canonical_package_id`.
- Emits `#### New Packages (N)` and `#### Updated Packages (N)` sections
(matching the original pre-#9043 format).
- Only links `repo_owner/repo_name` ids to GitHub, so name-only ids like
`kiro.dev/kiro-cli` don't render as broken links.

YAML parsing is done by inline `python3` (stdlib only — no `PyYAML` /
`yq` dependency). The release runner is `ubuntu-latest` which ships
python3.

## Sample output (`v4.491.0` → `v4.499.0`)

```
### 📦 Aqua Registry Updates

#### New Packages (28)

- [`IBM-Cloud/ibm-cloud-cli-release`](https://github.com/IBM-Cloud/ibm-cloud-cli-release)
- [`controlplaneio-fluxcd/flux-operator/flux-operator-mcp`](https://github.com/controlplaneio-fluxcd/flux-operator)
- `kiro.dev/kiro-cli`
- ...

#### Updated Packages (13)

- [`gleam-lang/gleam`](https://github.com/gleam-lang/gleam)
- [`sigstore/cosign`](https://github.com/sigstore/cosign)
- ...
```

## Test plan

- [x] `bash -n scripts/gen-aqua-changelog.sh`
- [x] `mise run lint scripts/gen-aqua-changelog.sh` (shellcheck, shfmt,
etc. clean)
- [x] `./scripts/gen-aqua-changelog.sh v4.498.0 v4.499.0 "###"` — 1
added, 1 updated
- [x] `./scripts/gen-aqua-changelog.sh v4.491.0 v4.499.0 "###"` — 28
added, 13 updated
- [x] `./scripts/gen-aqua-changelog.sh v4.499.0 v4.499.0 "###"` — silent
exit 0
- [x] `./scripts/gen-aqua-changelog.sh "" v4.499.0 "###"` — silent exit
0
- [x] `./scripts/gen-aqua-changelog.sh v0.0.0-bogus v4.499.0 "###"` —
fails curl, exits 0 with stderr (matches prior fail-soft contract;
`xtasks/release-plz` wraps the call in `|| true`)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Touches release/changelog generation logic and introduces custom YAML
parsing, which could fail or mis-detect package changes if the registry
format shifts, but does not affect runtime product behavior.
> 
> **Overview**
> Switches `scripts/gen-aqua-changelog.sh` from enumerating upstream
`aqua-registry` release tags (via `gh`) to diffing the old vs current
`registry.yaml` and printing **New Packages** and **Updated Packages**
sections for the changelog.
> 
> The script now fetches the old tag’s `registry.yaml` via `curl`,
parses both YAMLs with an inline `python3` stdlib parser to compute
canonical package IDs, and only adds GitHub links when
`repo_owner/repo_name` is present to avoid broken links for name-only
entries.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
6b93531. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
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.

2 participants