Skip to content

Check the release prerequisites before doing anything irreversible - #216

Merged
wu-sheng merged 1 commit into
masterfrom
fix-release-script-noop-commit
Aug 30, 2026
Merged

Check the release prerequisites before doing anything irreversible#216
wu-sheng merged 1 commit into
masterfrom
fix-release-script-noop-commit

Conversation

@wu-sheng

@wu-sheng wu-sheng commented Aug 30, 2026

Copy link
Copy Markdown
Member

Cutting 0.11.0 stopped immediately:

version: 0.11.0
appVersion: "0.11.0"
On branch 0.11.0-release
nothing to commit, working tree clean

and nothing else happened — no tag, no artifacts, no upload.

The abort

set_release_version ends with a plain git commit, which exits non-zero when nothing is
staged, and the script runs under set -e. Nothing is staged in the ordinary case: the
guide tells you to set Chart.yaml before starting, and the kustomize image tags are set in
that same function specifically so the identical call inside make release is a no-op. The
better prepared the repository, the more certainly the release aborted — with a message that
reads like success.

Both release commits take --allow-empty now. That also closes something quieter: the
regeneration step a few lines down does git commit --amend, and with no commit of its own to
amend it would have rewritten master's HEAD — folding generated files into someone else's
commit and changing the tree the tag was about to point at.

The deeper problem

release.sh checked almost nothing up front. It verified the signing key and the tools, then
went straight on to push a tag — so a prerequisite discovered late is not merely
inconvenient: recovering means deleting a tag from the remote.

tools/releasing/preflight.sh now checks the lot first, and reports every problem rather than
stopping at the first:

=== Release preflight ===

Tools
  ✓ all present: gpg svn shasum git go helm yq gh tar
GPG signing key
  ✓ would sign as wusheng@apache.org (D360AB2A…E06B)
  ✓ that key is in the published KEYS file
GitHub
  ✓ gh is authenticated as wu-sheng
Apache dist (svn)
  ✓ dev/skywalking/swck readable
  ✓ release/skywalking/swck readable (holds: 0.10.0/)
  ! commit access is NOT checked here — release.sh step 7 is the first real test.
Version
  ✓ releasing 0.11.0; previous tag v0.10.0
  ✓ tag v0.11.0 is free
Previous attempts
  ✓ dist/dev is empty
Generated files
  ✓ working tree is clean
  ✓ chart manifests are in sync with the operator sources
Docker Hub
  ! DOCKERHUB_USER / DOCKERHUB_TOKEN cannot be checked from here …

Preflight passed.

release.sh sources it and calls run_preflight as its step 2, so the two cannot drift.

It is deliberately explicit about what it cannot establish from a developer machine, rather
than implying otherwise: svn commit access (testing it means writing to the ASF dist area), the
Docker Hub repository secrets (listing them needs an admin token), and whether the Docker Hub
publish path works at all — it has never run.

Also

tools/releasing/.gitignore, mirroring apache/skywalking's, carrying the licence header this
repository requires on one. release.sh clones into that directory and stages an svn working
copy beside it; both were showing up as untracked in the release manager's checkout.

Verified

Reproduced the abort under set -e (exit 1, the line after the commit never runs) and confirmed
the fix (exit 0, the amend lands on the script's own commit with the base commit still its
parent). Ran preflight.sh against this machine both dirty and clean — it correctly blocked on
an uncommitted tree and passed once committed.

No damage from the aborted run

No v0.11.0 tag locally or on the remote; dist/dev/skywalking/swck is still empty.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

license-eye has totally checked 416 files.

Valid Invalid Ignored Fixed
309 1 106 0
Click to see the invalid file list
  • tools/releasing/.gitignore

Comment thread tools/releasing/.gitignore
@wu-sheng wu-sheng added this to the 0.11.0 milestone Aug 30, 2026
@wu-sheng
wu-sheng force-pushed the fix-release-script-noop-commit branch from 938e567 to 82cdc79 Compare August 30, 2026 12:47
@wu-sheng wu-sheng changed the title Let release.sh run when the tree already carries the release version Check the release prerequisites before doing anything irreversible Aug 30, 2026
Cutting 0.11.0 stopped at "nothing to commit, working tree clean" and did nothing else.
set_release_version ends by committing the version bump with a plain `git commit`, which exits
non-zero when nothing is staged, and the script runs under `set -e`. Nothing is staged in the
ordinary case: the guide tells the release manager to set Chart.yaml before starting, and the
kustomize image tags are set in that same function precisely so the identical call inside
`make release` is a no-op. The better prepared the repository, the more certainly the release
aborted -- with a message that reads like success.

Both release commits take --allow-empty now. That also closes something quieter: the
regeneration step a few lines down does `git commit --amend`, and with no commit of its own to
amend it would have rewritten master's HEAD, folding generated files into someone else's commit
and changing the tree the tag was about to point at.

The deeper problem is that release.sh checked almost nothing up front. It verified the signing
key and the tools, then went straight on to push a tag -- so a prerequisite discovered late is
not merely inconvenient, recovering means deleting a tag from the remote.
tools/releasing/preflight.sh now checks the lot first: the tools, the signing key including
whether it carries an @apache.org UID and appears in the published KEYS file, gh authentication,
both dist URLs, that Chart.yaml and the changelog agree on the version and that its tag is still
free, that no abandoned candidate is sitting in dist/dev, and that the tree is clean with the
generated chart files in sync. It reports every problem rather than stopping at the first.

release.sh runs it as step 1 and takes the resolved signing key from it, rather than detecting
one itself as it used to -- the detection existed in both places, which is exactly the kind of
second copy that drifts. Running it before the signer prompt also means a release manager is not
asked to confirm a key and only then told that svn is unreachable.

It is explicit about what it cannot establish from a developer machine rather than implying
otherwise: svn commit access, because testing it means writing to the ASF dist area; the Docker
Hub repository secrets, because listing them needs an admin token; and whether the Docker Hub
publish path works at all, since it has never run.

Also adds tools/releasing/.gitignore, mirroring apache/skywalking's, with the licence header this
repository requires on one -- release.sh clones into that directory and stages an svn working
copy beside it, and both were showing up as untracked in the release manager's checkout.
@wu-sheng
wu-sheng force-pushed the fix-release-script-noop-commit branch from 82cdc79 to 9fa9e6d Compare August 30, 2026 13:00
@wu-sheng
wu-sheng merged commit be2f3fe into master Aug 30, 2026
17 checks passed
@wu-sheng
wu-sheng deleted the fix-release-script-noop-commit branch August 30, 2026 13:29
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