ci: run the pull request tier for fork pull requests on the fork #7311
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #7311"
general
weight: 0.35
sunchao
Which issue does this PR close?
Closes #4289. Supersedes #4570.
Rationale for this change
Nearly every pull request comes from a fork (194 of the 198 open ones), and the pull request tier plus the
run-label runs were about 60% of the roughly 2,900 runner-hours thatci.ymlandci_label.ymlspent in the week to 2026-10-28. The merge queue was about 30% and the nightly about 8%.apache/datafusion(apache/datafusion#25591) andapache/arrow-rs(apache/arrow-rs#11788) moved this work onto the contributor's fork, using the fork's ownpushtrigger rather than a separate fork-only wrapper workflow, and treat the fork's result as informational. This applies the same arrangement to Comet. The merge queue stays on ASF runners and still runs the queue tier on the merge result (the PR tier plus Spark SQL on 4.1, Iceberg 1.11, macOS and the other queue-tier suites; the nightly-only andrun-suites are not part of it), so nothing reachesmainon the strength of a fork run alone.What changes are included in this PR?
compute-changes.py: a push to a fork's branch gets theprtier, and a pull request from a fork intomainloses it upstream. A pull request opened inside a fork loses it too, since its branch push already ran the tier. Therun-label suites and thelabeledrun still run here, as do a pull request from a branch of this repository and a pull request to a release branch. One effect on a fork pull request:run-all-spark-profilesnow brings forward only the four non-default profiles here, since the fork's run covers the default profile and the lints;ci.yml's profile table and the policy cases say so.ci_fork.yml(new): callsci.ymlon a push to any fork branch, the default branch included. It is a separate workflow, asci_label.ymlis, so a push to a branch of this repository cannot publish a skippedRequired Checksnext to a pull request's real one. Upstream its only job is skipped.ci.ymlalso triggers on push tomain, so itsPreflightskips a fork push unlessci_fork.ymlcalled it (told apart by the caller'sgithub.workflow), which leaves the bridge one workflow to look up. A newer push to a fork branch cancels the run in flight through asupersedejob that compares the branch name with case, because Actions compares group names,==and!=without regard to case and a fork can hold bothfeatureandFeature.Preflightinci.yml,miri.yml,stale.yml,codeql.ymland the bridge skip a scheduled run outside this repository.required_checksskips itself whenPreflightdoes, so a fork's schedule or sync starts no runner, andnightly_reportreads a skipped aggregator as nothing to report.ci.yml: a fork push is diffed against upstreammainbydev/ci/fork-push-changed-files.sh, which gives the diff its pull request will have. Diffing against the fork's ownmainwould omit a file that a branch reverts relative to newer upstream code when the fork is behind. The script lists every file when the fetch fails or there is no merge base, and nothing when the branch adds nothing to upstream, anddev/ci/test-fork-push-changed-files.pycovers those cases on real repositories. A fork push is keyed on its run id in the concurrency group, so a backup branch at the same commit cannot cancel a pull request's build. Preflight runs the bridge tests.fork_ci_status.yml(new): mirrors the fork's run onto the pull request as an informationalCI (fork)check, onworkflow_runand every 15 minutes. It is adapted from arrow-rs, never checks out pull request code, and needs onlychecks: write.dev/ci/test-fork-ci-status.cjscovers it against mocked GitHub APIs (38 tests).check-ci-config.py: policy cases for fork pushes and fork pull requests, the new environment wiring, and checks that the caller, the bridge andci.yml's push trigger agree. The guards onPreflight,ci_fork.yml's job and every root job of a scheduled workflow are checked by evaluating theirif:for concrete events (a fork's schedule, a push throughci_fork.yml, a push to a fork'smain), not by matching text. Each guard was mutation-tested.ci.yml's concurrency group is keyed on the pull request number, notgithub.head_ref. The branch name alone let two pull requests from different forks with the same branch name cancel each other's run. This is part of #7315;codeql.yml,miri.ymlandpr_title_check.ymlhave the same pattern, so that issue stays open. The tests pin that same-named branches get separate groups.CI (fork)is advisory, not required, because a contributor controls the workflow that produced it. A green fork run that never ran the tests costs one queue slot. The earlier attempts mirrored the fork's result into a required check; arrow-rs and DataFusion decided against that, and so does this PR.How are these changes tested?
python3 dev/ci/check-ci-config.py,node --test dev/ci/test-fork-ci-status.cjsandactionlint --shellcheck=offpass locally. I removed each new guard in turn and confirmed the check fails.Comet CI (fork run), which ran the full PR tier and passed. With cold caches it took 59 minutes of wall time and 240 runner-minutes, with the native build at 23 minutes. With warm caches (from the fork'smainrun by the oldci.yml) it took 50 minutes and 213 runner-minutes, with the native build at under 5. A push that adds nothing to upstreammain, such as a sync of the fork, selects no build or test suite and writes to no build cache. For comparison, successful full PR runs on ASF runners over the previous week had a median wall time of 81 minutes. No job waited for a runner. This is one account and two runs.ci.ymlanddev/ci/*, which select the full Linux build, and its upstream run ran only Preflight, Detect changes and Required Checks.PR Build (Linux)and every other job were skipped, andRequired Checkspassed.fork_ci_status.yml.workflow_runandscheduleuse the copy on the default branch, so it cannot run until this merges. The bridge is covered by its mocked tests, as in the arrow-rs and DataFusion changes, and the first fork pull request after merge is its real test.Contributors need to enable Actions on their fork and rebase onto
main; the CI guide says so, andCI (fork)says "Enable CI on your fork" when it finds no run.