← Back to Pull requests

ci: run the pull request tier for fork pull requests on the fork #7311

Closed
unknown closed this pull request without merging on Oct 30, 2026 19:05 UTC
View on GitHub
unknown unknown commented on Oct 28, 2026 21:42 UTC
Author

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 that ci.yml and ci_label.yml spent in the week to 2026-10-28. The merge queue was about 30% and the nightly about 8%.

apache/datafusion (apache/datafusion#25591) and apache/arrow-rs (apache/arrow-rs#11788) moved this work onto the contributor's fork, using the fork's own push trigger 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 and run- suites are not part of it), so nothing reaches main on 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 the pr tier, and a pull request from a fork into main loses it upstream. A pull request opened inside a fork loses it too, since its branch push already ran the tier. The run- label suites and the labeled run 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-profiles now 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): calls ci.yml on a push to any fork branch, the default branch included. It is a separate workflow, as ci_label.yml is, so a push to a branch of this repository cannot publish a skipped Required Checks next to a pull request's real one. Upstream its only job is skipped. ci.yml also triggers on push to main, so its Preflight skips a fork push unless ci_fork.yml called it (told apart by the caller's github.workflow), which leaves the bridge one workflow to look up. A newer push to a fork branch cancels the run in flight through a supersede job that compares the branch name with case, because Actions compares group names, == and != without regard to case and a fork can hold both feature and Feature.

  • Scheduled workflows stay upstream. A fork that enables them would run the nightly on its owner's minutes, and with no earlier scheduled run to diff against it runs the whole nightly tier. Preflight in ci.yml, miri.yml, stale.yml, codeql.yml and the bridge skip a scheduled run outside this repository. required_checks skips itself when Preflight does, so a fork's schedule or sync starts no runner, and nightly_report reads a skipped aggregator as nothing to report.

  • ci.yml: a fork push is diffed against upstream main by dev/ci/fork-push-changed-files.sh, which gives the diff its pull request will have. Diffing against the fork's own main would 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, and dev/ci/test-fork-push-changed-files.py covers 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 informational CI (fork) check, on workflow_run and every 15 minutes. It is adapted from arrow-rs, never checks out pull request code, and needs only checks: write. dev/ci/test-fork-ci-status.cjs covers 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 and ci.yml's push trigger agree. The guards on Preflight, ci_fork.yml's job and every root job of a scheduled workflow are checked by evaluating their if: for concrete events (a fork's schedule, a push through ci_fork.yml, a push to a fork's main), not by matching text. Each guard was mutation-tested.

  • ci.yml's concurrency group is keyed on the pull request number, not github.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.yml and pr_title_check.yml have the same pattern, so that issue stays open. The tests pin that same-named branches get separate groups.

  • Docs: a "Pull requests from forks" section in the CI guide, a pointer in the development guide, and a "Fork runs" section in the workflows README.
  • 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.cjs and actionlint --shellcheck=off pass locally. I removed each new guard in turn and confirmed the check fails.

  • End to end on a fork (the author's), with this branch's workflows: a push to a branch started only 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's main run by the old ci.yml) it took 50 minutes and 213 runner-minutes, with the native build at under 5. A push that adds nothing to upstream main, 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.

  • On this pull request: it touches ci.yml and dev/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, and Required Checks passed.

  • Not tested on GitHub: fork_ci_status.yml. workflow_run and schedule use 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, and CI (fork) says "Enable CI on your fork" when it finds no run.

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: sunchao Review duration: 2723m
    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
    0.52
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    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
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 52% (MEDIUM) · Higher = larger blast radius
    52%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 20.5% · Safe to merge
    20.5%