ci: skip queue-verified Rust jobs on pushes to main - #25365
kumarUjjawal wants to merge 1 commit into
Conversation
48161e9 to
8b4184f
Compare
Commits reach upstream main through the merge queue, which runs the Rust workflow at the same SHA. The push to main then ran the same 26 jobs again. Only the jobs that save caches, publish coverage, or run the non-required FFI check give new output after the merge. Add an `if:` condition to the other 19 jobs and to the Cargo check artifact steps, so they skip on pushes to upstream main. PRs, the merge queue, workflow_dispatch, and other branches run all jobs. Extend check_asf_yaml_status_checks.py to require that exactly the listed jobs carry this condition. Part of apache#25148
8b4184f to
1a3b570
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #25365 +/- ##
==========================================
- Coverage 81.94% 81.94% -0.01%
==========================================
Files 1135 1135
Lines 428278 428278
Branches 428278 428278
==========================================
- Hits 350945 350933 -12
- Misses 56378 56387 +9
- Partials 20955 20958 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
comphead
left a comment
There was a problem hiding this comment.
Thanks @kumarUjjawal in Comet we did the similar thing, wondering if its possible to test the flow?
Does this imply we try not running CI on commits to main at all? If it was the same SHA why not run everything in the merge commit? |
Yes
Everything does run in the merge commit. What cannot move there is saving the caches that PRs restore, and that depends on the backend(github cache, runs on cache). |
I was exploring this earlier using claude:
|
I could try to test it on my fork |
Which issue does this PR close?
Rationale for this change
Every commit reaches upstream
mainthrough the merge queue. The queue runs the Rust workflow at that commit. The push tomainthen runs the same 26 jobs at the same SHA.Only seven of those jobs give new output after the merge:
linux-build-lib,linux-cargo-check-datafusion-functions,linux-test,linux-test-example,clippy, andmacos-aarch64save the caches that later PRs restore. The workflow saves caches only on pushes tomain.linux-testpublishes coverage.linux-datafusion-ffi-featuresis not a required check in.asf.yaml, so a PR can merge when it fails. The post-merge run shows that failure onmain.From September 9 to September 16, 2026, the Rust workflow ran 116 times for pushes to
main. Each of those commits had a successful merge-queue run at the same SHA before the push. The ten most recent pushes used a mean of 71.7 runner-minutes each. The 19 skipped jobs account for 47.6 of those minutes: 19.5 on GitHub-hosted Linux runners and 28.0 on RunsOn. At that merge rate, this change saves about 2,200 GitHub-hosted Linux runner-minutes and 3,100 RunsOn runner-minutes per week. The GitHub-hosted minutes count against the shared ASF limit that the issue describes.Tradeoff: a direct push to
mainthat bypasses the merge queue also skips the 19 jobs. A manualworkflow_dispatchonmainruns all 26 jobs.extended.ymlalready uses the same approach formain.Post-merge runs also catch intermittent failures. In the sample week, three post-merge runs failed. Each commit had passed the same jobs in the queue. The logs show environment errors: a test memory-pool limit, a ChromeDriver port bind, and a MinIO image pull. Two of the three failed jobs are in the skipped set.
What changes are included in this PR?
.github/workflows/rust.yml:if: ${{ !(github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'apache/datafusion') }}. The condition has no status function, so jobs that depend onlinux-build-libstill require that job to succeed.linux-build-libget the same condition. Both consumers of that artifact are in the skipped set.mainworkflow_dispatchci/scripts/check_asf_yaml_status_checks.pygets a second check. It requires that exactly the jobs inPOST_MERGE_SKIPPED_JOBScarry the condition, that the artifact steps carry it, and that every job that downloads thecargo-checkartifact is in the skipped set. A new job without the condition passes, so new jobs run by default.docs/source/contributor-guide/testing.mdgets one sentence on the new check.What is the testing strategy for this PR?
python3 ci/scripts/check_asf_yaml_status_checks.pypasses on this branch. The requiredasf-yaml-checkjob indev.ymlruns it on every PR and merge-group run. The job fails if a listed job loses the condition, if another job gains it, if an artifact step loses its guard, or if a job outside the skipped set downloads thecargo-checkartifact.This PR adds no unit tests for the validator. The validator checks the real workflow in a required job, and a test suite for the validator is out of scope for this change.
Hosted CI on this PR runs all 26 Rust jobs. The first push to
mainafter the merge is the check of the reduced path: seven Rust jobs run and 19 skip.Are there any user-facing changes?
No. This PR changes CI and the contributor guide only.