zhengruifeng opened a new pull request, #60126:
URL: https://github.com/apache/spark/pull/60126

   ### What changes were proposed in this pull request?
   
   Apply the same commit-count optimization as #60124 to `branch-4.x`, using 
SPARK-60924.
   
   Replace the sampling job's full-history checkout and `git rev-list --count 
HEAD` with a GitHub GraphQL query for `Commit.history.totalCount` at the 
triggering `GITHUB_SHA`. Use the existing read-only workflow token and reject 
missing or invalid counts before calculating the remainder.
   
   The branch's one-in-ten upstream sampling rule, fork builds, job output, 
summary, and downstream build condition are preserved.
   
   ### Why are the changes needed?
   
   The `branch-4.x` sampling job downloads Spark's entire Git history on every 
push to obtain a commit count. Getting that count through GraphQL avoids the 
checkout, including for upstream pushes whose build is sampled out.
   
   This implements [Nicholas Chammas's 
suggestion](https://github.com/apache/spark/pull/60045#discussion_r4455095349) 
for `branch-4.x` separately from the master PR.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No.
   
   ### How was this patch tested?
   
   - `actionlint` and `git diff --check`.
   - Executed the actual workflow script against the live API for sampled and 
unsampled `branch-4.x` commits and a commit in the contributor fork; all counts 
matched `git rev-list --count` at the same SHA.
   - Executed the script with controlled counts 1 through 30; only 10, 20, and 
30 selected a build. API failures and empty, null, zero, negative, and 
non-integer counts failed without emitting a build-selection output.
   - Verified that the sampling step matches #60124 and preserves the branch's 
permissions, output, summary, workflow trigger, and downstream build condition.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Codex (GPT-6)
   


-- 
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