HyukjinKwon opened a new pull request, #60069:
URL: https://github.com/apache/spark/pull/60069
### 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 every release step has already completed.
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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]