refactor(aqua): bake aqua registry from merged yaml#9043
Conversation
There was a problem hiding this comment.
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.
7ad7f50 to
47fcd35
Compare
47fcd35 to
b8bf855
Compare
Greptile SummaryThis PR replaces the per-package Confidence Score: 5/5Safe 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
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"]
Reviews (16): Last reviewed commit: "Merge branch 'main' into codex/aqua-bake..." | Re-trigger Greptile |
|
what's the reason for this @risu729 ? |
|
Sorry I forgot to add this. |
### 🐛 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)
## 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]>
Summary
registry.yamlfile, pinned bycrates/aqua-registry/aqua-registry/metadata.json.crates/aqua-registry/build.rsand generate a canonical package-id to YAML map plus a separate alias lookup map, so runtime baked lookup only parses the selected package YAML.aqua-registrycrate and show it inmise doctor.crates/aqua-registry/aqua-registry/**tree.Notes
v4.492.0; the vendoredregistry.yamlandLICENSEmatch that tag.eyre::Result/WrapErrfor contextual build errors.name, thenrepo_owner/repo_name, thenpathfor path-only packages. Legacypkgs/**file paths such as_go/sigsum.org/sigsum-go/cmd/sigsum-keyandcrates.io/dskkato/rjoare aqua-registry implementation details and are not preserved as baked aliases.pkgs/<id>/registry.yamlpath for a follow-up PR.crates/aqua-registry/aqua-registry/pkgs/**is restored in a separate commit so it can be reverted later.Future follow-ups
crates/aqua-registry/aqua-registry/pkgs/**in a separate PR to keep this diff reviewable.Tests
cargo fmtcargo test -p aqua-registrycargo check --all-featurescargo check -p mise --all-featurescargo build -p mise --all-featuresgit diff --checkbash -n scripts/gen-aqua-changelog.sh xtasks/release-plzcargo 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.