You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 2a3ee7f
Browse filesBrowse the repository at this point in the historyBrowse files
Auto-approve cheap CI runs of external contributors' PRs (#75455)
* Auto-approve cheap CI runs of external contributors' PRs
GitHub holds the workflow runs of fork PRs until a maintainer approves
them. With self-hosted runners (AIP-118) the approval gate becomes part
of the trust model, so it should cover all external contributors, but
approving every push by hand does not scale and makes contributors wait.
Runs whose change cannot touch the CI definition and whose CI is cheap
are safe to start without a maintainer. Expensive or large changes, and
anything that changes how CI or runners are chosen, still get a human
look first, which also keeps the load on the shared public runners down.
The CI-minutes estimate lets maintainers see what a run will cost before
approving it.
Generated-by: Claude Opus 5
* Add inline script metadata to the CI-minutes calibration script
The script uses only the standard library, so with a PEP 723 block it runs
with plain `uv run dev/calibrate_ci_minutes_estimates.py` instead of syncing
the whole Breeze environment. Document that invocation in the script and in
.github/AGENTS.md.
* Keep one PR's API or git error from aborting the approval tick
Each PR is now processed in its own try block. A requests.RequestException
or subprocess.CalledProcessError for one PR no longer stops the remaining
PRs or skips the job summary. The failed PR is recorded with failed=True and
shown as "failed" in the summary, keeping its CI-time estimate when one was
computed and giving a short, single-line form of the error as the reason.
The workflow also tries to add the 'need workflow approval' label to it, so
it is not lost once its runs leave the query window. Nothing is approved on
failure.
approve_workflow_runs exits 1 after writing the summary when any PR failed,
so a persistent failure turns the scheduled run red instead of passing
silently.
* Approve the runs of fork CI pull requests unless they change CI
A pull request whose CI runs in the contributor's fork (AIP-120) still
gets pull_request runs in apache/airflow, and GitHub holds them until a
maintainer approves them. Those runs only execute the fork CI gate, so
judging them by the cost and size of project CI left cheap gate-only
runs waiting for a maintainer for no benefit, and a gated run that never
ran could not be cleaned up by the reconciler.
What still needs a maintainer is a change to the files that define CI,
since it could remove the gate or add a workflow that does run. Using
the reconciler's own list keeps the two decisions consistent, and the
author is told why their runs wait instead of only seeing a label.
Generated-by: Claude Opus 5
* Keep CI-minutes estimates true to the runs they approve
A run selects its tests from the labels the PR had when it started, so
approving it on the current labels could start a full-tests run whose
label was removed while it waited. Calibrating from self-hosted and
all-versions runs, and leaving out the jobs that need no CI image, made
the estimate describe runs other than those it is used to approve.
Generated-by: Claude Opus 5
---------
Co-authored-by: Shahar Epstein <[email protected]>
Copy file name to clipboardExpand all lines: contributing-docs/25_maintainer_pr_triage.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -238,6 +238,7 @@ The triage workflow uses the following labels and states:
238
238
| Label / State | Meaning |
239
239
|---|---|
240
240
|`ready for maintainer review`| PR has passed Stage 1 and is queued for human review. Applied only after the skill has verified that no workflow runs are awaiting approval. |
241
+
|`need workflow approval`| The PR's CI workflow runs wait for a maintainer, because the `Auto approve workflow runs` workflow did not approve them: a PR to a branch other than `main`, a change to CI definition files, a full-tests or dependency change, a change whose CI jobs are estimated at more than 310 job-minutes, or a change of more than 100 lines of source code (see [Pull Requests](05_pull_requests.rst)). For a PR whose CI runs in the contributor's fork, only a change to CI definition files keeps its runs waiting, and the workflow comments on the PR to say so. The workflow also tries to add the label when processing the PR failed; its run then fails too. Approve the runs after looking at the diff. The workflow removes the label when a later commit is approved automatically. |
241
242
|`closed because of multiple quality violations`| PR was closed because the author has multiple open PRs with quality issues. |
242
243
|`suspicious changes detected`| PR (and all open PRs by the same author) was closed because the diff contained suspicious patterns (secret exfiltration, malicious CI modifications, etc.). |
243
244
|`closed because of open PR limit`| PR was closed in the one-time closure that introduced the [open PR limit](32_open_pull_request_limit.rst). Applied by `dev/close_prs_over_open_pr_limit.py`, never by the triage skill. If the author reopens the PR, triage it like any other. |
Copy file name to clipboardExpand all lines: dev/breeze/doc/08_ci_tasks.rst
+20Lines changed: 20 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -200,6 +200,26 @@ These are all available flags of ``fork-ci-reconcile`` command:
200
200
:width:100%
201
201
:alt:Breeze ci fork-ci-reconcile
202
202
203
+
Approving workflow runs of external contributors
204
+
------------------------------------------------
205
+
206
+
The ``auto-approve-workflow-runs`` workflow runs ``approve-workflow-runs`` every 30 minutes. It approves
207
+
the waiting workflow runs of external contributors' PRs to ``main`` whose CI jobs are estimated at no more
208
+
than 310 job-minutes, that change at most 100 lines of source code and that do not touch CI definition files, and labels the other PRs ``need workflow approval``. PRs whose CI runs in
209
+
the contributor's fork (AIP-120) only run the fork CI gate in ``apache/airflow``, so their runs are
210
+
approved whatever their size unless they change CI definition files; such a PR also gets a comment
211
+
explaining that its CI change needs a maintainer. For every PR it also
212
+
estimates the CI jobs selective checks will run and how long they take, and writes them to the job
213
+
summary. Use ``--report-only`` to see the decisions without approving runs or changing labels. The rules
214
+
are described in `CI workflows <ci/05_workflows.md>`_.
215
+
216
+
These are all available flags of ``approve-workflow-runs`` command:
0 commit comments