Skip to content

Commit 3ce8be4

Browse files
authored
Add the fork CI gate to ci-amd.yml (#74819)
* Add design and ADR for running CI in contributor forks (AIP-120) AIP-120 moves CI for external contributions into contributor forks so project runners serve committers, collaborators and exempted organisations, and so maintainers only review pull requests that already passed in the author's fork. The mechanics span the main test workflow, a scheduled reconciler for gated pull requests, a commit status that surfaces the fork CI state with a link to the fork run, a local pre-flight command and the contribution docs, so the design is recorded before implementation and the decisions that shape it are captured as ADR 0018. Generated-by: Claude Opus 5 * Close gated pull requests that tamper with the fork CI gate The gate job in ci-amd.yml runs from the pull request's merge commit, so a gated external pull request can drop the gate or add a workflow with a pull_request trigger and get project CI anyway. The design accepted that as a one-run cost but left it unbounded per pull request, because every further push would get another run. The reconciler now detects this after the fact from what GitHub recorded rather than from the pull request tree: project CI ran for the head SHA and the pull request changes files under .github/workflows/. Both signals are required so that legitimate project CI runs (backlog reset, a removed "use project ci") and legitimate workflow edits that keep the gate intact are never closed. Closing stops further pull_request runs, so one attempt buys one run, and the closure is reported to Slack as an attention item rather than as a reconciler failure. ADR 0018 records the trade-off, including the external pull requests with wanted workflow changes that must keep "use project ci". Generated-by: Claude Opus 5 * Let volunteer contributors opt in to a fork CI pilot The dev list agreed to start with an opt-in pilot by a few volunteer contributors rather than enabling fork CI for everyone at once. The committer-only "use fork ci" label cannot serve that: it arrives after gpgsig -----BEGIN PGP SIGNATURE----- wsFcBAABCAAQBQJq0YVxCRC1aQ7uu5UhlAAAcYgQACYDDrIdXBZxVhqczF3TNrO7 qdkPgQy3NgLfVgmY0iy7ypzDRYY+glMD415Qc5OJy7n5M7XBqJ3ALQf04U/IGm0O bMXgq1+Z9B/sRz27VNQYJm9X30hL+pE4iYHwGAQHXsr/TIgl2WN+V4awsRYEVQXM x3Q/jwR12/YbiW2R3c61J+c7mrLdw4bZ6UtnDQqWUYkimgRGDLFvlZ/yMAj8kBuU UyXGeOtTaIJHlghczgxlTeBDNMjuE9o5S6xsW5n+eWJXy7E/883L6uMWR3OjLR01 l2gpSqrpi52xYMVd8Zik+gpuWjkQ45C9k+XgGQfLfhoelZJ8uZfToMqARne4xVlZ 4hFIHfZSGdcLCi+sbU6PKxrMdX7HF4vDAxP9Tv4IpIzANRxG9IH5uXpHwAAx24LF ogZQDyykjqTsadl7SqjKDw/Hybv4hklnnr8BFfvYd54iFkkP3fqSizlV4ecr1tyJ OBvI7DbNNNdySebmnMYQGBziLQF5uUseD8srhCiXG5XNaSqbOnNXc+FHZmn0oU3O EJ15O0QPi4rkRXQ5gYCjjb4tO99H3Mw6bMgiIWTjVa/1QPmOb9mtEbpRP/ESHuOe 1VgYd8tUczg6FB6Po5f/DXV2rZB36ij9Bo4nBmR7V1HApOx4E88lDIznGpqP/cWf MetUk2Nom7/sr+UaBu3i =wncY -----END PGP SIGNATURE----- the first pull_request run has already used project CI, and a maintainer would have to label every pull request the volunteer opens. A per-login join instant gates all their new pull requests from the first run while leaving older ones on project CI, so those can never be mistaken for gate tampering. The reconciler also has to run while the gate is disabled, which the earlier "exits early" wording contradicted for the label pilot as well. Generated-by: Claude Opus 5 * Close gaps in the fork CI design found in review Enabling ci-amd.yml in a fork also enables its cron, which would run the full canary matrix in every contributor fork twice a day. A join instant or enabled_since earlier than the merge that sets it gates pull requests that already ran project CI. Forks not named "airflow" would never show a fork run, and a pull request reopened after an inactivity close would be closed again at once. ADR 0018 was already taken. Generated-by: Claude Opus 5 * Trust fork CI only for pull requests that cannot change it A fork run executes the workflows, breeze and CI scripts of the pushed commit, so a pull request changing them decides its own fork CI result. Gate tampering was only checked on the head commit, so pushing a tampered commit and then a clean one hid the bypass, and the check could be dodged by renaming a job to the gate's name or by truncated check-suite listings. The gate also fell back to project CI when its label read failed, which an exhausted token quota could trigger for every pull request. Generated-by: Claude Opus 5 * Add fork CI eligibility function and configuration The gate job and the reconciler must agree on which pull requests use project CI and which are left to fork CI, so the decision lives in one standard-library-only function that the gate can run without installing breeze, driven by one reviewed configuration file. It ships disabled. Generated-by: Claude Opus 5 * Gate project CI for external pull requests in ci-amd.yml Contributors must get CI from a plain push to their fork, and project CI must not run for pull requests left to fork CI, without reacting to pull request events with write permissions. A gate job ahead of build-info decides from the base branch's configuration, and the push trigger widens to every branch while the gate keeps the old branch list in effect for apache/airflow. Skipping build-info also skips everything that depends on it, which the always() conditions of finalize-tests and notify-slack would otherwise treat as success. Pilot join instants are compared with pull request creation but only take effect on merge, so the config hook keeps new ones in the future. Generated-by: Claude Opus 5 * Address review of the fork CI gate Drop the collaborator-permission lookup: it needs push access, which neither the gate's nor the monitor's token has, so it never matched. A committer with private apache membership makes it public or is allowlisted. Take the gate from the default branch for pushes, so a push to a branch without the gate files keeps skipping project CI instead of looking like base_without_gate. Check the PR title in the gate job for gated pull requests, which skip ci-image-checks. Check every pilot entry when the base config does not parse, and restrict the E2E flaky-tests report to scheduled runs now that every push to main creates a gate-only run. Generated-by: Claude Opus 5 * Anchor the canonical push branches on the pull request filter Since #75420 ci-arm.yml has no push trigger: release branches get their full runs from release-branch-ci.yml. The canonical push branch filters are now checked against the pull_request filter of ci-amd.yml without main and the -stable branches, which is the set release-branch-ci.yml uses too. Generated-by: Claude Opus 5 * Set PYTHONPYCACHEPREFIX for the fork CI gate config hook main now requires every prek hook to write bytecode outside the source tree (check-prek-hooks-pycache-prefix). Generated-by: Claude Opus 5 * Add the fork CI gate to the needs of CI passed Generated-by: Claude Opus 5 #75142 added the CI passed job that auto-merge waits for, and check-ci-gate-needs requires every CI job in its needs. The gate exists only in ci-amd.yml, so check-ci-workflows-in-sync allows that one line as an AMD-only divergence. * Describe the fork CI gate in the CI passed docs as in place The gate now exists, so the CI passed comments and the auto-merge docs no longer say what happens until it lands. Generated-by: Claude Opus 5 * Skip the scheduled ARM canary in forks A fork that enables Actions for fork CI also gets the ci-arm.yml cron, and nothing stopped its canary from running there. The check-run-needed step shared by both workflows now reports run-needed=false outside apache/airflow. Also correct the canonical push branch filter source in the design doc and reuse AIRFLOW_ROOT_PATH in the gate config hook. Generated-by: Claude Opus 5
1 parent f6c19bd commit 3ce8be4

15 files changed

Lines changed: 2373 additions & 46 deletions

‎.github/fork-ci-gate.toml‎

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
# Fork CI gate (AIP-120). See dev/breeze/doc/ci/08_fork_ci_for_external_contributors.md
19+
20+
# Master switch. When false the gate job lets every pull request run project CI, except
21+
# pull requests labelled `use fork ci` and pull requests of [pilot] participants. Push
22+
# filtering for apache/airflow branches applies regardless.
23+
enabled = false
24+
25+
# Pull requests created before this instant are never gated, whatever their author.
26+
# Moving the date back is how the backlog reset (AIP-120 §9.1) would be applied.
27+
enabled_since = 2026-01-01T00:00:00Z
28+
29+
# Days without any fork CI activity after which a gated pull request is closed.
30+
close_after_days = 7
31+
32+
# Organisations exempted under AIP-120 §2.2. Keys are display names used in comments,
33+
# values are GitHub logins. Changes go through a reviewed pull request.
34+
[allowlist]
35+
# "Example Org" = ["login-one", "login-two"]
36+
37+
# Opt-in pilot participants. Keys are GitHub logins, values are the instant they joined.
38+
# Their pull requests created at or after that instant are gated whether or not `enabled`
39+
# is set. Use a future instant such as the next day at 00:00 UTC; the
40+
# check-fork-ci-gate-config hook rejects a new or changed instant that is in the past.
41+
[pilot]
42+
# "login-three" = 2026-10-20T00:00:00Z

‎.github/workflows/ci-amd.yml‎

Lines changed: 125 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ on: # yamllint disable-line rule:truthy
4343
- airflow-ctl/v[0-9]+-[0-9]+-stable
4444
types: [opened, reopened, synchronize, ready_for_review]
4545
push:
46-
# Pushes to release-prep / providers branches run only the tests needed by the changes since the
47-
# last successful run of the branch (selected as for a PR). Full runs of these branches, on AMD
48-
# and ARM, are dispatched by `release-branch-ci.yml`. `main` does not build on push; its full
49-
# runs are the canary above.
46+
# Every push triggers the workflow so that contributors get CI in their forks (AIP-120).
47+
# In apache/airflow the `gate` job keeps the old behaviour: only pushes to the release-prep /
48+
# providers branches in CANONICAL_PUSH_BRANCH_FILTERS (fork_ci_gate.py) run anything, and they
49+
# run only the tests needed by the changes since the last successful run of the branch
50+
# (selected as for a PR); other pushes produce a gate-only run. Full runs of these branches, on
51+
# AMD and ARM, are dispatched by `release-branch-ci.yml`. `main` does not build on push; its
52+
# full runs are the canary above.
5053
branches:
51-
- v[0-9]+-[0-9]+-test
52-
- providers-[a-z]+-?[a-z]*/v[0-9]+-[0-9]+
53-
- chart/v[0-9]+-[0-9]+x-test
54-
- airflow-ctl/v[0-9]+-[0-9]+-test
54+
- '**'
5555
workflow_dispatch:
5656
permissions:
5757
# All other permissions are set to none by default
@@ -91,10 +91,11 @@ jobs:
9191
contents: read
9292
outputs:
9393
run-needed: ${{ steps.schedule.outputs.run-needed || 'true' }}
94+
# Empty in forks, whose pushes selective checks compare against apache/airflow.
9495
push-base-commit: ${{ steps.push.outputs.push-base-commit }}
9596
steps:
9697
- name: "Find the last successful run of the branch"
97-
if: github.event_name == 'push'
98+
if: github.event_name == 'push' && github.repository == 'apache/airflow'
9899
id: push
99100
shell: bash
100101
env:
@@ -131,6 +132,13 @@ jobs:
131132
BRANCH: ${{ github.ref_name }}
132133
run: |
133134
set -euo pipefail
135+
# A fork that enables Actions for fork CI also gets this cron; its canary would only use
136+
# the contributor's runners. `ci-amd.yml`'s gate skips it too (`fork_schedule`).
137+
if [[ "${REPOSITORY}" != "apache/airflow" ]]; then
138+
echo "run-needed=false" >> "${GITHUB_OUTPUT}"
139+
echo "Scheduled canaries run only in apache/airflow." >> "${GITHUB_STEP_SUMMARY}"
140+
exit 0
141+
fi
134142
workflow_path="${WORKFLOW_REF%@*}"
135143
workflow="${workflow_path##*/}"
136144
# Full runs are the scheduled canaries and manual `workflow_dispatch` runs; this run is
@@ -152,10 +160,107 @@ jobs:
152160
echo "run-needed=true" >> "${GITHUB_OUTPUT}"
153161
fi
154162
163+
gate:
164+
# Fork CI gate (AIP-120): decides whether project CI runs for this event. Configuration and
165+
# code come from the base branch so a pull request cannot change its own eligibility. See
166+
# dev/breeze/doc/ci/08_fork_ci_for_external_contributors.md.
167+
name: "Fork CI gate"
168+
runs-on: ["ubuntu-slim"]
169+
timeout-minutes: 5
170+
outputs:
171+
project-ci: ${{ steps.gate.outputs.project-ci }}
172+
reason: ${{ steps.gate.outputs.reason }}
173+
steps:
174+
- name: "Checkout gate configuration from the base branch"
175+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
176+
with:
177+
# A push in apache/airflow has no base branch. Its decision depends only on the pushed
178+
# ref, so it takes the gate from the default branch: a pushed branch without the gate
179+
# files would otherwise look like `base_without_gate` and run project CI on a push that
180+
# never triggered it. A push in a fork keeps the pushed commit's gate, by SHA: the fork's
181+
# default branch, or a later tip of the pushed branch picked up by a re-run, is the
182+
# contributor's to change outside the commit whose result the reconciler trusts, while
183+
# a gate change in the pushed commit shows in the pull request's files.
184+
ref: >-
185+
${{ github.base_ref ||
186+
(github.event_name == 'push' && github.repository == 'apache/airflow' &&
187+
github.event.repository.default_branch) ||
188+
(github.event_name == 'push' && github.sha) ||
189+
github.ref }}
190+
fetch-depth: 1
191+
persist-credentials: false
192+
sparse-checkout: |
193+
.github/fork-ci-gate.toml
194+
dev/breeze/src/airflow_breeze/utils/fork_ci_gate.py
195+
scripts/ci/prek/check_no_conventional_commit_message.py
196+
sparse-checkout-cone-mode: false
197+
# Until the gate is on the default branch, a push in apache/airflow would find no gate there
198+
# and run the full project CI as `base_without_gate`, for every branch pushed. Only
199+
# committers can push to apache/airflow, so the pushed commit's own gate decides then.
200+
- name: "Check whether the default branch has the gate"
201+
id: default-branch-gate
202+
if: github.event_name == 'push' && github.repository == 'apache/airflow'
203+
env:
204+
GATE_CONFIG: .github/fork-ci-gate.toml
205+
GATE_SCRIPT: dev/breeze/src/airflow_breeze/utils/fork_ci_gate.py
206+
run: |
207+
if [[ -e "${GATE_CONFIG}" || -e "${GATE_SCRIPT}" ]]; then
208+
echo "present=true" >> "${GITHUB_OUTPUT}"
209+
else
210+
echo "present=false" >> "${GITHUB_OUTPUT}"
211+
fi
212+
- name: "Checkout gate configuration from the pushed commit"
213+
if: steps.default-branch-gate.outputs.present == 'false'
214+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
215+
with:
216+
ref: ${{ github.sha }}
217+
fetch-depth: 1
218+
persist-credentials: false
219+
sparse-checkout: |
220+
.github/fork-ci-gate.toml
221+
dev/breeze/src/airflow_breeze/utils/fork_ci_gate.py
222+
scripts/ci/prek/check_no_conventional_commit_message.py
223+
sparse-checkout-cone-mode: false
224+
- name: "Decide whether project CI runs"
225+
id: gate
226+
env:
227+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
228+
GATE_CONFIG: .github/fork-ci-gate.toml
229+
GATE_SCRIPT: dev/breeze/src/airflow_breeze/utils/fork_ci_gate.py
230+
PR_NUMBER: ${{ github.event.pull_request.number }}
231+
PR_HEAD_REPO: ${{ github.event.pull_request.head.repo.full_name }}
232+
PR_AUTHOR: ${{ github.event.pull_request.user.login }}
233+
PR_AUTHOR_ASSOCIATION: ${{ github.event.pull_request.author_association }}
234+
PR_CREATED_AT: ${{ github.event.pull_request.created_at }}
235+
PR_EVENT_LABELS: ${{ toJSON(github.event.pull_request.labels.*.name) }}
236+
# A base branch with neither gate file predates the gate (the pull request adding it,
237+
# or a release branch cut before it) and keeps running project CI. With only one of
238+
# them present, the missing file fails the job instead of opening the gate.
239+
run: |
240+
if [[ ! -e "${GATE_CONFIG}" && ! -e "${GATE_SCRIPT}" ]]; then
241+
echo "project-ci=true reason=base_without_gate"
242+
echo "project-ci=true" >> "${GITHUB_OUTPUT}"
243+
echo "reason=base_without_gate" >> "${GITHUB_OUTPUT}"
244+
echo 'Project CI runs (fork CI gate reason: `base_without_gate`)' >> "${GITHUB_STEP_SUMMARY}"
245+
exit 0
246+
fi
247+
python3 "${GATE_SCRIPT}"
248+
# A gated pull request skips ci-image-checks.yml, which checks the title on project CI, and
249+
# its fork run is a `push` event without a title.
250+
- name: "Check PR title is not Conventional Commits"
251+
if: github.event_name == 'pull_request' && steps.gate.outputs.project-ci == 'false'
252+
env:
253+
PR_TITLE: ${{ github.event.pull_request.title }}
254+
run: |
255+
printf '%s\n' "$PR_TITLE" \
256+
| python3 scripts/ci/prek/check_no_conventional_commit_message.py --from-stdin
257+
155258
build-info:
156259
name: "Build info"
157-
needs: [check-run-needed]
158-
if: needs.check-run-needed.outputs.run-needed == 'true'
260+
needs: [gate, check-run-needed]
261+
if: >-
262+
needs.gate.outputs.project-ci == 'true' &&
263+
needs.check-run-needed.outputs.run-needed == 'true'
159264
# At build-info stage we do not yet have outputs so we need to hard-code the runs-on to public runners
160265
runs-on: ["ubuntu-22.04"]
161266
outputs:
@@ -1299,6 +1404,9 @@ jobs:
12991404
contents: write
13001405
packages: write
13011406
# This will fire when all the jobs from "needs" are either successful or skipped
1407+
# build-info is skipped by a no-op canary and when the fork CI gate leaves the pull request to
1408+
# fork CI (AIP-120); every other need is then skipped too, which always() alone would treat as
1409+
# success.
13021410
if: always() && !failure() && !cancelled() && needs.build-info.result == 'success'
13031411
needs:
13041412
- additional-ci-image-checks
@@ -1352,8 +1460,7 @@ jobs:
13521460
# A skipped build-info means project CI did not run at all: the fork CI gate (AIP-120) left the
13531461
# pull request to CI in the contributor's fork, and every job here is skipped. Reporting
13541462
# "CI passed" then would let it merge on no CI, so the job reports under another name and
1355-
# the fork CI reconciler posts "CI passed" from the fork run instead. Until the gate lands,
1356-
# build-info has no condition and this always reports "CI passed".
1463+
# the fork CI reconciler posts "CI passed" from the fork run instead.
13571464
name: >-
13581465
${{ needs.build-info.result == 'skipped' && 'CI passed (project CI not run)' || 'CI passed' }}
13591466
# The one check main's ruleset requires, so auto-merge waits for CI to finish. GitHub treats a
@@ -1372,6 +1479,7 @@ jobs:
13721479
- check-run-needed
13731480
- ci-image-checks
13741481
- finalize-tests
1482+
- gate
13751483
- generate-constraints
13761484
- migration-round-trip
13771485
- mypy-providers
@@ -1415,10 +1523,13 @@ jobs:
14151523
- check-run-needed
14161524
- finalize-tests
14171525
- tests-agent-frameworks
1418-
# A no-op canary (`run-needed` is 'false') does not post; a failed check does.
1526+
# A no-op canary (`run-needed` is 'false') does not post; a failed check does. A failing gate
1527+
# skips build-info and everything after it, and must still be reported. A fork's scheduled run
1528+
# is the intended skip, and forks have no Slack to report to.
14191529
if: >-
14201530
always() &&
14211531
!cancelled() &&
1532+
github.repository == 'apache/airflow' &&
14221533
github.event_name == 'schedule' &&
14231534
needs.check-run-needed.outputs.run-needed != 'false' &&
14241535
github.run_attempt == 1

‎.github/workflows/ci-arm.yml‎

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,11 @@ jobs:
7070
contents: read
7171
outputs:
7272
run-needed: ${{ steps.schedule.outputs.run-needed || 'true' }}
73+
# Empty in forks, whose pushes selective checks compare against apache/airflow.
7374
push-base-commit: ${{ steps.push.outputs.push-base-commit }}
7475
steps:
7576
- name: "Find the last successful run of the branch"
76-
if: github.event_name == 'push'
77+
if: github.event_name == 'push' && github.repository == 'apache/airflow'
7778
id: push
7879
shell: bash
7980
env:
@@ -110,6 +111,13 @@ jobs:
110111
BRANCH: ${{ github.ref_name }}
111112
run: |
112113
set -euo pipefail
114+
# A fork that enables Actions for fork CI also gets this cron; its canary would only use
115+
# the contributor's runners. `ci-amd.yml`'s gate skips it too (`fork_schedule`).
116+
if [[ "${REPOSITORY}" != "apache/airflow" ]]; then
117+
echo "run-needed=false" >> "${GITHUB_OUTPUT}"
118+
echo "Scheduled canaries run only in apache/airflow." >> "${GITHUB_STEP_SUMMARY}"
119+
exit 0
120+
fi
113121
workflow_path="${WORKFLOW_REF%@*}"
114122
workflow="${workflow_path##*/}"
115123
# Full runs are the scheduled canaries and manual `workflow_dispatch` runs; this run is
@@ -1278,6 +1286,9 @@ jobs:
12781286
contents: write
12791287
packages: write
12801288
# This will fire when all the jobs from "needs" are either successful or skipped
1289+
# build-info is skipped by a no-op canary and when the fork CI gate leaves the pull request to
1290+
# fork CI (AIP-120); every other need is then skipped too, which always() alone would treat as
1291+
# success.
12811292
if: always() && !failure() && !cancelled() && needs.build-info.result == 'success'
12821293
needs:
12831294
- additional-ci-image-checks
@@ -1331,8 +1342,7 @@ jobs:
13311342
# A skipped build-info means project CI did not run at all: the fork CI gate (AIP-120) left the
13321343
# pull request to CI in the contributor's fork, and every job here is skipped. Reporting
13331344
# "CI passed" then would let it merge on no CI, so the job reports under another name and
1334-
# the fork CI reconciler posts "CI passed" from the fork run instead. Until the gate lands,
1335-
# build-info has no condition and this always reports "CI passed".
1345+
# the fork CI reconciler posts "CI passed" from the fork run instead.
13361346
name: >-
13371347
${{ needs.build-info.result == 'skipped' && 'CI passed (project CI not run)' || 'CI passed' }}
13381348
# The one check main's ruleset requires, so auto-merge waits for CI to finish. GitHub treats a
@@ -1394,10 +1404,13 @@ jobs:
13941404
- check-run-needed
13951405
- finalize-tests
13961406
- tests-agent-frameworks
1397-
# A no-op canary (`run-needed` is 'false') does not post; a failed check does.
1407+
# A no-op canary (`run-needed` is 'false') does not post; a failed check does. A failing gate
1408+
# skips build-info and everything after it, and must still be reported. A fork's scheduled run
1409+
# is the intended skip, and forks have no Slack to report to.
13981410
if: >-
13991411
always() &&
14001412
!cancelled() &&
1413+
github.repository == 'apache/airflow' &&
14011414
github.event_name == 'schedule' &&
14021415
needs.check-run-needed.outputs.run-needed != 'false' &&
14031416
github.run_attempt == 1

‎.pre-commit-config.yaml‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,14 @@ repos:
310310
files: ^\.github/workflows/ci-(arm|amd)\.yml$
311311
pass_filenames: false
312312
require_serial: true
313+
- id: check-fork-ci-gate-config
314+
name: Check fork CI gate configuration is valid and pilot instants are in the future
315+
env:
316+
PYTHONPYCACHEPREFIX: .build/pycache
317+
entry: ./scripts/ci/prek/check_fork_ci_gate_config.py
318+
language: python
319+
files: ^\.github/fork-ci-gate\.toml$|^dev/breeze/src/airflow_breeze/utils/fork_ci_gate\.py$
320+
pass_filenames: false
313321
- id: check-java-sdk-version-in-sync
314322
name: Check Java SDK JDK version is consistent across build files
315323
env:

‎dev/README_AIRFLOW3_DEV.md‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -199,11 +199,11 @@ The `main` ruleset requires two checks. **CI passed** is a job in the `Tests (AM
199199
runs and fails when any other CI job failed or was cancelled; jobs that selective checks skip count as
200200
passed, so PRs that run only part of the tests still get a result. The `check-ci-gate-needs` prek hook
201201
makes sure every new CI job is added to it. `Tests (ARM)`, which runs on pushes and on a schedule rather
202-
than on PRs, has the same job, kept identical by the `check-ci-workflows-in-sync` hook. Once the fork CI
203-
gate (AIP-120) is in place, a PR that it leaves to CI in the contributor's fork does not run project CI,
204-
so the job reports as **CI passed (project CI not run)** instead, and the fork CI reconciler posts **CI
205-
passed** once the fork run for the PR's latest commit is green and trusted.
206-
**check-newsfragment-pr-number** runs on every PR too.
202+
than on PRs, has the same job, kept identical by the `check-ci-workflows-in-sync` hook. For a PR that the
203+
fork CI gate (AIP-120) leaves to CI in the contributor's fork, project CI does not run, so the job reports
204+
as **CI passed (project CI not run)** instead, and the fork CI reconciler posts **CI passed** once the
205+
fork run for the PR's latest commit is green and trusted. **check-newsfragment-pr-number** runs on every
206+
PR too.
207207
208208
Auto-merge does not wait for checks from other workflows: **CodeQL**, **Dependency review** and
209209
**Registry tests**. The last two only run when dependency or registry files change. Look at those

0 commit comments

Comments
 (0)