zhengruifeng opened a new pull request, #60177:
URL: https://github.com/apache/spark/pull/60177
### What changes were proposed in this pull request?
Move deterministic post-merge CI sampling from
`.github/workflows/build_main.yml` into
`dev/merge_spark_pr.py`.
The merge script now:
- configures sampling intervals per branch, currently one in ten commits for
`master` and
`branch-4.x`;
- calculates the next destination commit count from the fetched branch
history;
- adds GitHub's documented `skip-checks: true` trailer to sampled-out merge
commits;
- emits a red warning whenever post-merge CI will be skipped; and
- removes a copied skip trailer from cherry-picked commits before applying
the destination
branch's independent sampling decision.
The workflow-level commit-count job and its dependency are removed. Other
branches continue to
run push CI normally, and fork `master` synchronization remains skipped as
before.
See
https://docs.github.com/en/actions/how-tos/manage-workflow-runs/skip-workflow-runs.
### Why are the changes needed?
The workflow-level check starts a GitHub Actions run for every push and
checks branch history only
after the push. Moving the decision into the merge script avoids starting
sampled-out workflow
runs and keeps the policy close to the merge operation that creates the
commit.
A per-branch interval map also allows `master` and rolling integration
branches to use different
sampling rates later without duplicating workflow logic.
### Does this PR introduce _any_ user-facing change?
No. This changes post-merge CI scheduling only.
### How was this patch tested?
- Ran `python -m doctest dev/merge_spark_pr.py` in the `spark-dev-313` Conda
environment.
- Ran `ruff check dev/merge_spark_pr.py` and `git diff --check`.
- Ran `dev/merge_spark_pr.py --dry-run 60124` and verified both sampled-out
and selected master
commit counts, the generated commit message, suppressed push, and cleanup.
- Created real temporary Git commits to verify that `skip-checks: true` is
the final trailer and
is preceded by the two empty lines required by GitHub.
- Tested cherry-pick messages with `-sx` attribution and sign-off lines,
including removal of an
inherited trailer and conditional addition of the destination branch's
trailer.
### Was this patch authored or co-authored using generative AI tooling?
Generated-by: Codex (GPT-5)
--
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]