Skip to content

Fix release signing script argument handling and checksums - #177

Merged
snoopdave merged 1 commit into
masterfrom
fix-release-signing-script
Sep 5, 2026
Merged

Fix release signing script argument handling and checksums#177
snoopdave merged 1 commit into
masterfrom
fix-release-signing-script

Conversation

@snoopdave

Copy link
Copy Markdown
Contributor

The release-candidate guard in assembly-release/sign-release.sh reads:

if [ rcstring != "" ]; then

The $ is missing, so this compares the literal word rcstring against the empty string and is always true. Final releases therefore took the rename branch as well, where it degenerated into renaming each archive onto itself.

The version and RC suffix were also hardcoded to the previous release (6.1.5 / -rc2), so the script had to be hand-edited before every use — and would silently sign the wrong filenames if anyone forgot.

Changes

  • Take the version and optional RC suffix as arguments, and print usage when they are missing.
  • Rename only when there is a suffix to add, and skip an archive that has already been renamed, so re-running after a partial failure is not confusing.
  • Require the signing key to be named via ROLLER_SIGNING_KEY, and refuse a key that is not RSA or is under 4096 bits. A release manager may still have older keys in their keyring, and gpg would otherwise pick one by default. See https://infra.apache.org/release-signing.html.
  • Write checksums in shasum(1) format instead of gpg --print-md, so downloaders can verify with shasum -c. The --print-md output is space-grouped and names a target/-prefixed path, so it cannot be checked directly. Emit SHA-512 alongside SHA-256, per the current distribution policy.

Verification

Guards, with real exit codes:

invocation result
no arguments usage, exit 2
version, no ROLLER_SIGNING_KEY explains why the key must be named, exit 2
key not in keyring no key matching ..., exit 1
DSA-1024 key refused as not RSA, exit 1

Rename behaviour, against dummy archives:

  • final release (no suffix) — no rename attempted, files untouched
  • release candidate (-rc1) — archive renamed to carry the suffix before signing

The signing and checksum steps themselves need a passphrase prompt on a TTY, so they were exercised only as far as the gpg invocation.

Usage is now:

ROLLER_SIGNING_KEY=<keyid> ./sign-release.sh 6.1.6        # final
ROLLER_SIGNING_KEY=<keyid> ./sign-release.sh 6.1.6 -rc1   # candidate

https://claude.ai/code/session_019R1jdtwkaYEeA6L9DXEtEi

The release-candidate guard read

    if [ rcstring != "" ]; then

which compares the literal word "rcstring" against the empty string and is
therefore always true. Final releases took the rename branch too, where it
became a no-op rename of each archive onto itself.

The version and RC suffix were also hardcoded to the previous release, so
the script had to be edited before every use.

Take both as arguments, rename only when there is a suffix to add, and skip
an archive that has already been renamed so a re-run after a failure is not
confusing.

Two other changes:

- Require the signing key to be named through ROLLER_SIGNING_KEY, and refuse
  a key that is not RSA or is under 4096 bits. Older keys may still be in a
  release manager's keyring and would otherwise be picked by default.
- Write checksums with shasum(1) rather than "gpg --print-md", so downloaders
  can verify with "shasum -c", and emit SHA-512 alongside SHA-256.

Claude-Session: https://claude.ai/code/session_019R1jdtwkaYEeA6L9DXEtEi
@snoopdave
snoopdave merged commit 1b3c6be into master Sep 5, 2026
4 checks passed
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