Repository navigation
Commit bad9f9c
authored
Add the fork CI reconciler and its scheduled monitor (#74822)
* Add the fork CI reconciler and its scheduled monitor
Gated pull requests need labels, draft state, a state comment, a commit
status that links to the fork run, and closing after inactivity or gate
tampering, and none of that may be written in reaction to an untrusted
pull_request event. A scheduled, idempotent reconciler that derives every
change from what GitHub recorded is the only writer, so missed or
repeated runs are harmless and nothing runs pull request code with write
permissions. Whatever it cannot classify is reported to maintainers
instead of being guessed.
The monitor needs the breeze setup action, which frees disk space with
sudo and docker, so it runs on ubuntu-latest rather than ubuntu-slim.
Generated-by: Claude Opus 5
* Report CI passed from fork CI and address reconciler review
The merge ruleset requires a CI passed check, which gated pull requests never get from project CI. The reconciler now posts a CI passed commit status when the head commit's fork CI is green and trusted, and overwrites it with pending when the commit leaves green, for example after a failed re-run in the fork.
Also from review: drop the collaborator-permission lookup the monitor's token cannot make; stop posting green_unverified to Slack, since the needs project ci label lists those pull requests; judge only completed runs and finished jobs for gate tampering, so a job waiting for a runner does not look like project CI work; read compare files from the first page only; let gh's partial GraphQL output through when it exits non-zero; and warn in the state comment when a green branch is far behind its base.
Generated-by: Claude Opus 5
* Do not count jobs every gated run starts as gate tampering
Since #75420 every ci-amd.yml run starts check-run-needed, and once the CI passed gate of the auto-merge ruleset is in, a gated run also starts it as "CI passed (project CI not run)". The tamper detector counted any started job other than the gate as project CI work, so it would have closed every gated pull request. Those two jobs are now expected, under the same 5-minute limit as the gate.
Generated-by: Claude Opus 5
* Count only jobs a runner picked up as fork CI gate tampering
A run cancelled by a newer push before its gate started marks every job
completed, so the tampering check read the never-started jobs as project CI
work and could close a gated pull request that edits workflows legitimately.
A job now counts only when it has a runner or steps, and "CI passed", which
such a run reports under its plain name, is bounded like the gate.
Statuses are read from the head commit when the pull request's last listed
commit is another one, and the docs no longer claim a backlog reset never
closes a pull request that changes workflows.
Generated-by: Claude Opus 51 parent 164a812 commit bad9f9c
21 files changed
Lines changed: 3943 additions & 56 deletions
File tree
- .github/workflows
- dev/breeze
- doc
- adr
- ci
- images
- src/airflow_breeze
- commands
- utils
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
164 | 184 | | |
165 | 185 | | |
166 | 186 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
101 | | - | |
102 | | - | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
103 | 105 | | |
104 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
105 | 110 | | |
106 | 111 | | |
107 | 112 | | |
| |||
111 | 116 | | |
112 | 117 | | |
113 | 118 | | |
114 | | - | |
| 119 | + | |
| 120 | + | |
115 | 121 | | |
116 | 122 | | |
117 | 123 | | |
| |||
0 commit comments