Andrushika commented on code in PR #74819:
URL: https://github.com/apache/airflow/pull/74819#discussion_r4312031915


##########
.github/workflows/ci-amd.yml:
##########
@@ -43,16 +43,12 @@ on:  # yamllint disable-line rule:truthy
       - airflow-ctl/v[0-9]+-[0-9]+-stable
     types: [opened, reopened, synchronize, ready_for_review]
   push:
-    # Post-merge pushes to release-prep / providers branches run on both
-    # AMD and ARM (the matching block lives in the other wrapper too —
-    # `check-ci-workflows-in-sync` enforces they stay identical). `main` is
-    # intentionally NOT in this list: main pushes stay AMD-only via
-    # `ci-amd.yml`; ARM main coverage is the cron-driven canary above.
+    # Every push triggers the workflow so that contributors get CI in their 
forks (AIP-120).
+    # In apache/airflow the `gate` job keeps the old behaviour: only pushes to 
the release-prep
+    # / providers branches listed in ci-arm.yml (CANONICAL_PUSH_BRANCH_FILTERS 
in
+    # fork_ci_gate.py) run anything; other pushes produce a gate-only run.
     branches:
-      - v[0-9]+-[0-9]+-test
-      - providers-[a-z]+-?[a-z]*/v[0-9]+-[0-9]+
-      - chart/v[0-9]+-[0-9]+x-test
-      - airflow-ctl/v[0-9]+-[0-9]+-test
+      - '**'

Review Comment:
   We might need to merge this together with #74820. With only this PR, the 
gate lets every fork push run, but `selective_checks.py` still treats any 
`push` as run-everything. So each push to a fork with Actions enabled runs the 
full matrix on all Python versions.
   
   ---
   Drafted-by: Claude Code (Opus 5.5); reviewed by @Andrushika before posting



##########
.github/workflows/ci-amd.yml:
##########
@@ -43,16 +43,12 @@ on:  # yamllint disable-line rule:truthy
       - airflow-ctl/v[0-9]+-[0-9]+-stable
     types: [opened, reopened, synchronize, ready_for_review]
   push:
-    # Post-merge pushes to release-prep / providers branches run on both
-    # AMD and ARM (the matching block lives in the other wrapper too —
-    # `check-ci-workflows-in-sync` enforces they stay identical). `main` is
-    # intentionally NOT in this list: main pushes stay AMD-only via
-    # `ci-amd.yml`; ARM main coverage is the cron-driven canary above.
+    # Every push triggers the workflow so that contributors get CI in their 
forks (AIP-120).
+    # In apache/airflow the `gate` job keeps the old behaviour: only pushes to 
the release-prep

Review Comment:
   We might need to add `event=schedule` to 
`scripts/ci/analyze_e2e_flaky_tests.py` in this PR. With `'**'`, every merge to 
`main` creates a gate-only run, and that script takes the last 10 completed 
runs on `main` with no event filter. So the daily flaky-tests report would 
mostly see runs without E2E results. `analyze_ci_job_durations.py` already 
defaults to `schedule`, so it is fine.
   
   ---
   Drafted-by: Claude Code (Opus 5.5); reviewed by @Andrushika before posting



##########
.github/workflows/ci-amd.yml:
##########
@@ -66,12 +62,62 @@ env:
   VERBOSE: "true"
 
 concurrency:
-  group: ci-amd-${{ github.event.pull_request.number || github.ref }}
+  # The event name keeps push runs on main (gate-only since AIP-120) from 
cancelling the
+  # scheduled canary on the same ref.
+  group: ci-amd-${{ github.event.pull_request.number || format('{0}-{1}', 
github.event_name, github.ref) }}
   cancel-in-progress: true
 
 jobs:
+  gate:
+    # Fork CI gate (AIP-120): decides whether project CI runs for this event. 
Configuration and
+    # code come from the base branch so a pull request cannot change its own 
eligibility. See
+    # dev/breeze/doc/ci/08_fork_ci_for_external_contributors.md.
+    name: "Fork CI gate"
+    runs-on: ["ubuntu-slim"]
+    timeout-minutes: 5
+    outputs:
+      project-ci: ${{ steps.gate.outputs.project-ci }}
+      reason: ${{ steps.gate.outputs.reason }}
+    steps:
+      - name: "Checkout gate configuration from the base branch"
+        uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1  # 
v7.0.1
+        with:
+          ref: ${{ github.base_ref || github.ref }}
+          fetch-depth: 1
+          persist-credentials: false
+          sparse-checkout: |
+            .github/fork-ci-gate.toml
+            dev/breeze/src/airflow_breeze/utils/fork_ci_gate.py
+          sparse-checkout-cone-mode: false
+      - name: "Decide whether project CI runs"
+        id: gate
+        env:
+          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+          GATE_CONFIG: .github/fork-ci-gate.toml
+          GATE_SCRIPT: dev/breeze/src/airflow_breeze/utils/fork_ci_gate.py
+          PR_NUMBER: ${{ github.event.pull_request.number }}
+          PR_HEAD_REPO: ${{ github.event.pull_request.head.repo.full_name }}
+          PR_AUTHOR: ${{ github.event.pull_request.user.login }}
+          PR_AUTHOR_ASSOCIATION: ${{ 
github.event.pull_request.author_association }}
+          PR_CREATED_AT: ${{ github.event.pull_request.created_at }}
+          PR_EVENT_LABELS: ${{ toJSON(github.event.pull_request.labels.*.name) 
}}
+        # A base branch with neither gate file predates the gate (the pull 
request adding it,
+        # or a release branch cut before it) and keeps running project CI. 
With only one of
+        # them present, the missing file fails the job instead of opening the 
gate.
+        run: |
+          if [[ ! -e "${GATE_CONFIG}" && ! -e "${GATE_SCRIPT}" ]]; then

Review Comment:
   We might need to use this `base_without_gate` shortcut only for 
`pull_request` events. For a push, `github.ref` is the pushed branch itself, so 
a push to a branch without the gate files (for example `v3-3-stable`) now runs 
full project CI. Before this PR such pushes did not trigger `ci-amd.yml` at all.
   
   ---
   Drafted-by: Claude Code (Opus 5.5); reviewed by @Andrushika before posting



-- 
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]

Reply via email to