Yicong-Huang opened a new pull request, #60593:
URL: https://github.com/apache/spark/pull/60593

   Backport of #60587 (master ca0ebe4fc54) to branch-4.x.
   
   ### What changes were proposed in this pull request?
   
   When `GIT_BRANCH` is not set, `get_release_info` in 
`dev/create-release/release-util.sh` derives the default release branch from 
`git ls-remote --heads`, excluding only `master`, and picks the first remaining 
ref in reverse lexical order (`sort -r | head -n 1 | cut -d/ -f3`).
   
   This PR only considers release branches named exactly 
`branch-<major>.<minor>` and picks the highest one by sorting the major and 
minor versions numerically, using POSIX `sort` keys (not GNU `sort -V`, since 
`get_release_info` also runs on the release manager's host via 
`do-release-docker.sh`).
   
   The cherry-pick had one trivial conflict: on this branch, the old comment 
and filter were `grep -v refs/heads/master` instead of master's `grep -Ev 
'refs/heads/(master|branch-4\.x)'` plus its longer comment. The conflict was 
resolved by taking master's fixed block, so `release-util.sh` is now identical 
to `master`'s (same blob `cb74462cb3b`). The `skip-checks: true` trailer 
inherited from the merged master commit was dropped from the commit message, as 
`dev/merge_spark_pr.py` does for cherry-picks.
   
   ### Why are the changes needed?
   
   apache/spark now has `dependabot/...` branches, which sort before `branch-*` 
in reverse lexical order, so the default branch offered by the manual release 
entry points (`do-release-docker.sh` / `do-release.sh`, when `GIT_BRANCH` is 
not given) is `dependabot` instead of the latest release branch. Lexical order 
also picks `branch-4.9` over `branch-4.10`. The release manager runs these 
scripts from the release branch, so the fix is needed here too.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No. It only changes the default branch suggested by the release scripts.
   
   ### How was this patch tested?
   
   On this branch:
   1. A stub-based shell test that sources `release-util.sh` and runs the real 
`get_release_info` with `git ls-remote`, `curl` and `read_config` stubbed, 
using the same 5 fake branch listings as #60587: all pass (`branch-4.10`, 
`branch-4.4`, `branch-10.0` over `branch-9.9`, `branch-4.4` ignoring names such 
as `branch-4.5-preview` / `zbranch-9.9`, and empty when there is no release 
branch). Before this change the results are `dependabot`, `dependabot`, 
`branch-9.9`, `zbranch-9.9` and `dependabot`.
   2. Ran `get_release_info` against https://github.com/apache/spark with only 
`read_config` stubbed: the default branch is `branch-4.4` (version `4.4.0`, tag 
`v4.4.0-rc1`).
   3. `bash -n` passes.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: 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]

Reply via email to