Skip to content

Make the release scripts actually run - #197

Merged
wu-sheng merged 1 commit into
masterfrom
drop-obsolete-linux-guard
Aug 30, 2026
Merged

Make the release scripts actually run#197
wu-sheng merged 1 commit into
masterfrom
drop-obsolete-linux-guard

Conversation

@wu-sheng

Copy link
Copy Markdown
Member

Ran tools/releasing/release.sh for 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.sh died silently right after preflight's first line

=== Preflight ===
  version 5.0.0 (from chart/skywalking/Chart.yaml)
$ echo $?
1

No error message. preflight ended on:

git rev-parse "${TAG}" >/dev/null 2>&1 && die "tag already exists"
svn ls "${SVN_DEV_URL}/helm/${VERSION}" >/dev/null 2>&1 && die "already uploaded"

On the normal path both left sides fail — the tag doesn't exist, the version isn't staged. set -e is 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, and preflight is called as a bare statement, so set -e kills 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 preflight had 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}"' EXIT over a local workdir. A trap runs after the function has returned and cannot see a local, so under set -u the 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 RETURN trap had the mirror-image flaw: right scope, but RETURN doesn't fire when set -e kills the shell mid-function.

3. The Linux-only guard was obsolete

Added when make clean was a backslash-continued rm whose later -rf tokens sat mid-argument-list — GNU rm permutes those, BSD rm doesn't. That recipe is now a single rm -rf over 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 under gpg --batch --verify, both checksums under shasum -c, packaged chart renders 33 resources, all six artifacts staged for svn, no temp dir left behind.

release-passed.sh against a local svnadmin repo mirroring the real layout (staged 5.0.0 in dev; 4.9.0/ plus loose 4.8.0 files in release):

Run Result
--dry-run walks every stage, exit 0, changes nothing
decline the promotion aborts, dev and release both unchanged
accept, accept, decline gh all 6 files moved dev→release, 4.9.0/ and the loose 4.8.0 file removed, aborted before creating the release

macOS build path: 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 happened in a throwaway checkout, and svn add is local until svn commit. Confirmed against the server: dist/dev/skywalking/helm/ is still empty.

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.
@wu-sheng wu-sheng added this to the 5.0.0 milestone Aug 30, 2026
@wu-sheng
wu-sheng merged commit 6fe2c78 into master Aug 30, 2026
5 checks passed
@wu-sheng
wu-sheng deleted the drop-obsolete-linux-guard branch August 30, 2026 14:00
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