Make the release scripts actually run - #197
Merged
Merged
Conversation
Running them for the first time. They had been written and reviewed but never executed, and every one of these was found by execution, not by reading. release.sh died silently immediately after preflight's first log line. preflight ended on `git rev-parse "$TAG" && die` / `svn ls .../$VERSION && die`, and on the normal path -- tag absent, version not yet staged -- the left side fails. set -e is exempt for the left side of an && list, but the list's status becomes the FUNCTION's return value, and `preflight` is called as a bare statement, so set -e killed the run there with no message. Both guards are now if-form, which returns 0 when the condition is false. This has been present since the script was added, so preflight had never once completed. The temp-dir cleanup was registered as an EXIT trap over a `local`. A trap runs after the function has returned and cannot see a local, so under set -u the trap itself failed: exit status 1 on the success path, and the directory holding the signed artifacts leaked every run. The variable and the trap are now both at script scope. The earlier RETURN trap had the mirror-image flaw -- right scope, but RETURN does not fire when set -e kills the shell mid-function. The Linux-only guard is removed. It was added when `make clean` was a backslash-continued rm whose later -rf tokens sat mid-argument-list, which GNU rm permutes and BSD rm does not. That recipe is now a single rm -rf over one operand list, which both accept, and the guard outlived its reason. Verified by running rather than by reading: release.sh --dry-run, from a pristine clone, on macOS: exit 0, all nine stages, both signatures verify under gpg --batch --verify, both checksums under shasum -c, the packaged chart renders 33 resources, all six artifacts staged for svn, and no temp directory left behind. release-passed.sh against a local svnadmin repo mirroring the real layout -- a staged 5.0.0 in dev, 4.9.0 plus loose 4.8.0 files in release. --dry-run walks every stage and changes nothing; declining the promotion aborts and changes nothing; accepting moves all six files, removes both the 4.9.0 directory and the loose file, and declining the GitHub release aborts before creating it. The macOS build path end to end: make clean exits 0 and removes everything, make release-src produces a tarball with no AppleDouble, .DS_Store, .git or build artifacts, make release signs and checksums all six files. Nothing was uploaded to dist.apache.org and no tag was pushed; the svn work all happened in a throwaway checkout, and svn add is local until svn commit.
wankai123
approved these changes
Aug 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ran
tools/releasing/release.shfor the first time. It failed. So did the next two attempts. All three defects below were found by executing the scripts, not by reading them — they had been written and reviewed in #194/#196 but never run.1.
release.shdied silently right after preflight's first lineNo error message.
preflightended on:On the normal path both left sides fail — the tag doesn't exist, the version isn't staged.
set -eis exempt for the left side of an&&list, which is why the construct looks safe in isolation. But the list's non-zero status becomes the function's return value, andpreflightis called as a bare statement, soset -ekills the run there.Both are now
if-form, which returns 0 when the condition is false.This has been present since the script was added, so
preflighthad never once completed. It is the same shape as the bug that killed the swck release script.2. The temp-dir cleanup guaranteed exit 1 and leaked every run
trap 'rm -rf "${workdir}"' EXITover alocal workdir. A trap runs after the function has returned and cannot see a local, so underset -uthe trap itself failed — status 1 on the success path, and the directory holding the signed artifacts was never removed. The variable and trap are now both at script scope.The earlier
RETURNtrap had the mirror-image flaw: right scope, butRETURNdoesn't fire whenset -ekills the shell mid-function.3. The Linux-only guard was obsolete
Added when
make cleanwas a backslash-continuedrmwhose later-rftokens sat mid-argument-list — GNUrmpermutes those, BSDrmdoesn't. That recipe is now a singlerm -rfover one operand list, which both accept. The guard outlived its reason and blocked a working path.Verified by running, not reading
release.sh --dry-run, pristine clone, macOS: exit 0, all nine stages, both signatures verify undergpg --batch --verify, both checksums undershasum -c, packaged chart renders 33 resources, all six artifacts staged for svn, no temp dir left behind.release-passed.shagainst a localsvnadminrepo mirroring the real layout (staged5.0.0in dev;4.9.0/plus loose4.8.0files in release):--dry-run4.9.0/and the loose4.8.0file removed, aborted before creating the releasemacOS build path:
make cleanexits 0 and removes everything;make release-srcproduces a tarball with no AppleDouble,.DS_Store,.gitor build artifacts;make releasesigns and checksums all six files.Nothing was uploaded to
dist.apache.organd no tag was pushed — the svn work happened in a throwaway checkout, andsvn addis local untilsvn commit. Confirmed against the server:dist/dev/skywalking/helm/is still empty.