This is an automated email from the ASF dual-hosted git repository.
HyukjinKwon pushed a commit to branch branch-4.x
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/branch-4.x by this push:
new c0fbca101870 [SPARK-60854][INFRA] Fix `release-build.sh` finalize
failing for the first release of a series
c0fbca101870 is described below
commit c0fbca101870453b49a1adc47ad9e2d4f965b12a
Author: Hyukjin Kwon <[email protected]>
AuthorDate: Wed Nov 4 07:55:56 2026 +0900
[SPARK-60854][INFRA] Fix `release-build.sh` finalize failing for the first
release of a series
### What changes were proposed in this pull request?
This PR fixes the last step of `release-build.sh finalize`, "Remove old
releases from the mirror", for a release that is the first of its series. The
`grep -v` that drops the new release from the `dist/release/spark` listing
becomes `{ grep -v ... || true; }`, so selecting nothing no longer aborts the
script. Only that exit status is ignored, so an `svn ls` failure still fails
the pipeline under `set -o pipefail`.
### Why are the changes needed?
The release workflow sets `DEBUG_MODE: 1`, and `release-util.sh` then
enables `set -o pipefail`. For the first release of a series (x.y.0, or the
first preview of a series), there is no older release to remove. `grep -v
"^spark-$RELEASE_VERSION/"` then selects nothing and exits with 1, and `set -e`
aborts the script at the `OLD_VERSION=$(...)` assignment. That happens before
the "No previous ... version found to remove" branch and `exit 0`, so the
workflow is reported as failed after [...]
This happened when finalizing Spark 4.3.0. The tag, PyPI uploads, website
update, svn moves and Nexus release all succeeded, and the job then failed with
exit code 1 right after `+ OLD_VERSION=`:
https://github.com/HyukjinKwon/spark/actions/runs/41076299025/job/124133289797
### Does this PR introduce _any_ user-facing change?
No, this only changes the release script.
### How was this patch tested?
Manually. The "Remove old releases from the mirror" block was extracted
from `release-build.sh` before and after this change and run under `set -e`
with a fake `svn` that returns a given `dist/release/spark` listing:
| Case | Before | After |
|---|---|---|
| 4.3.0 with no older 4.3.x, `pipefail` on | exits 1 with no message |
prints "No previous 4.3 version found to remove" |
| 4.4.0-preview1 with no older 4.4.x, `pipefail` on | exits 1 with no
message | prints "No previous 4.4 version found to remove" |
| 4.3.1 with 4.3.0 present, `pipefail` on or off | removes `spark-4.3.0` |
removes `spark-4.3.0` |
| `svn ls` fails, `pipefail` on | exits 1 | exits 1 |
`shellcheck` reports no new findings for `release-build.sh`.
### Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Claude Opus 5.5)
This pull request and its description were written by Isaac.
Closes #60069 from HyukjinKwon/SPARK-60854-finalize-first-release.
Authored-by: Hyukjin Kwon <[email protected]>
Signed-off-by: Hyukjin Kwon <[email protected]>
(cherry picked from commit 8ce04f5cb30a43154b5a87d14a0f082bc0b3eba8)
Signed-off-by: Hyukjin Kwon <[email protected]>
---
dev/create-release/release-build.sh | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/dev/create-release/release-build.sh
b/dev/create-release/release-build.sh
index 36ec915a134e..2ca9e5b564f2 100755
--- a/dev/create-release/release-build.sh
+++ b/dev/create-release/release-build.sh
@@ -626,10 +626,12 @@ EOF
# Extract major.minor prefix
RELEASE_SERIES=$(echo "$RELEASE_VERSION" | cut -d. -f1-2)
- # Fetch existing dist URLs
+ # Fetch existing dist URLs. For the first release of a series (e.g. x.y.0),
`grep -v` selects
+ # nothing and exits with 1, which aborts the script under `set -o pipefail`
(DEBUG_MODE=1).
+ # Ignore only that exit status, so a failing `svn ls` still fails the
pipeline.
OLD_VERSION=$(svn ls https://dist.apache.org/repos/dist/release/spark/ | \
grep "^spark-$RELEASE_SERIES" | \
- grep -v "^spark-$RELEASE_VERSION/" | \
+ { grep -v "^spark-$RELEASE_VERSION/" || true; } | \
sed 's#/##' | sed 's/^spark-//' | \
sort -V | tail -n 1)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]