chore(release): include manually updated aqua-registry entries in the changelog#7603
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request modifies the release script to capture aqua-registry package lists from the last git tag instead of the current working directory. This ensures that manually updated aqua-registry entries are properly included in the changelog.
Key changes:
- Retrieves the latest version tag using git and extracts the package list from that tag
- Falls back to the current directory if no tags exist (e.g., first release scenario)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| LATEST_TAG=$(git tag --list "v[0-9]*" --sort=-v:refname | head -1) | ||
|
|
||
| if [[ -n $LATEST_TAG ]]; then | ||
| OLD_AQUA_PKGS="$(git ls-tree -r --name-only "$LATEST_TAG" crates/aqua-registry/aqua-registry/pkgs | grep "/registry.yaml$" | sed 's|crates/aqua-registry/aqua-registry/pkgs/||;s|/registry.yaml||' | sort)" |
There was a problem hiding this comment.
The grep command in the pipeline could fail if no registry.yaml files exist in the tag, causing the script to exit due to pipefail. Consider adding || true at the end of this command substitution, or use grep ... || true to handle the case where no files match the pattern.
| OLD_AQUA_PKGS="$(git ls-tree -r --name-only "$LATEST_TAG" crates/aqua-registry/aqua-registry/pkgs | grep "/registry.yaml$" | sed 's|crates/aqua-registry/aqua-registry/pkgs/||;s|/registry.yaml||' | sort)" | |
| OLD_AQUA_PKGS="$(git ls-tree -r --name-only "$LATEST_TAG" crates/aqua-registry/aqua-registry/pkgs | grep "/registry.yaml$" | sed 's|crates/aqua-registry/aqua-registry/pkgs/||;s|/registry.yaml||' | sort || true)" |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
Bugbot run |
|
I'm not sure we need this, I never merge anything into that directory. It's possible I may have accidentally but that is something I try to avoid. |
| LATEST_TAG=$(git tag --list "v[0-9]*" --sort=-v:refname | head -1) | ||
|
|
||
| if [[ -n $LATEST_TAG ]]; then | ||
| OLD_AQUA_PKGS="$(git ls-tree -r --name-only "$LATEST_TAG" crates/aqua-registry/aqua-registry/pkgs | grep "/registry.yaml$" | sed 's|crates/aqua-registry/aqua-registry/pkgs/||;s|/registry.yaml||' | sort)" |
There was a problem hiding this comment.
Script crashes when grep finds no matches
High Severity
The script uses set -euxo pipefail which causes it to exit if any pipeline command fails. When git ls-tree returns empty output (because crates/aqua-registry/aqua-registry/pkgs doesn't exist at the latest tag), grep "/registry.yaml$" receives no input and returns exit code 1. This causes the entire release script to crash. The previous code was safer because find returns exit code 0 even with no matches, and it only ran when the directory existed. Adding || true after grep would prevent this failure.
Yeah, it's uncommon and not recommended, but we can manually update the aqua-registry to use a new/updated registry in Here are some examples by Claude. |
### 🐛 Bug Fixes - **(backend)** filter pre-release versions with latest + install_before by @koh-sh in [#7631](#7631) - **(docs)** formatting in configuration hierarchy section by @jonathanagustin in [#7638](#7638) - **(npm)** migrate npm publish to OIDC trusted publishing by @jdx in [#7607](#7607) - **(registry)** correct checkmake version test pattern by @jdx in [#7632](#7632) - **(release)** handle empty grep result in aqua-registry changelog by @jdx in [f45b4c6](f45b4c6) - **(self-update)** self-update fails across year boundary due to semver mismatch by @jdx in [#7611](#7611) - **(tasks)** fix tool inheritance from intermediate parents by @chadxz in [#7637](#7637) - add `-test` to VERSION_REGEX prerelease filter by @belgio99 in [#7647](#7647) ### 📚 Documentation - **(tasks)** remove documentation for unimplemented features by @turbocrime in [#7599](#7599) - update `mise aliases` references to `mise tool-alias` by @muzimuzhi in [#7615](#7615) - use call operator in PowerShell profile example by @shina1024 in [#7639](#7639) - replace ASCII .pub key with binary .gpg for signed-by on Ubuntu/Debian by @gmalinowski in [#7649](#7649) ### 🛡️ Security - **(security)** prevent code execution from untrusted fork in registry-comment workflow by @jdx in [4a2441e](4a2441e) ###◀️ Revert - Revert "fix(release): handle empty grep result in aqua-registry changelog" by @jdx in [522ffdc](522ffdc) - Revert "chore(release): include manually updated aqua-registry entries in the changelog " by @jdx in [1ebb943](1ebb943) ### 📦️ Dependency Updates - update ghcr.io/jdx/mise:alpine docker digest to fbfffcf by @renovate[bot] in [#7619](#7619) - lock file maintenance by @renovate[bot] in [#7646](#7646) ### 📦 Registry - add hatoo/oha tool by @jylenhof in [#7633](#7633) ### Chore - **(registry)** fix registry comment workflow by @risu729 in [#7554](#7554) - **(release)** include manually updated aqua-registry entries in the changelog by @risu729 in [#7603](#7603) ### New Contributors - @belgio99 made their first contribution in [#7647](#7647) - @gmalinowski made their first contribution in [#7649](#7649) - @chadxz made their first contribution in [#7637](#7637) - @shina1024 made their first contribution in [#7639](#7639) - @jonathanagustin made their first contribution in [#7638](#7638) - @turbocrime made their first contribution in [#7599](#7599) ## 📦 Aqua Registry Updates #### New Packages (3) - [`ampcode/zvelte-check`](https://github.com/ampcode/zvelte-check) - [`nickel-lang/nickel`](https://github.com/nickel-lang/nickel) - [`openshift/rosa`](https://github.com/openshift/rosa)
Note
Improves how aqua-registry changes are detected for release notes.
xtasks/release-plz, computeOLD_AQUA_PKGSfrom the latestv*tag viagit ls-tree; if no tag, fall back to scanningcrates/aqua-registry/aqua-registry/pkgsWritten by Cursor Bugbot for commit 112c922. This will update automatically on new commits. Configure here.