Repository navigation
Commit 28dc247
CI: Run model detection on all events and disable shared_infra
### Motivation
Two problems with the current CI setup:
1. **Model detection was skipped on pushes to `main`.** The
`detect-affected` job had `if: github.event_name == 'pull_request'`, so
pushes to `main` bypassed detection entirely. Downstream jobs
compensated with `github.event_name != 'pull_request'` fallbacks that
ran *everything* unconditionally on main — wasting compute.
2. **Any touch to base infrastructure files triggered `run_all`.** Files
like `_configs.py`, `_registry.py`, `_builder.py`, etc. were in
`_SHARED_INFRA_PATTERNS`, causing every model's tests to run even for
trivial or scoped changes. This made CI prohibitively slow for
infrastructure work.
### Changes
#### `main.yml`
- Removed `if: github.event_name == 'pull_request'` from the
`detect-affected` job — it now runs on PRs, pushes to `main`, and
`workflow_dispatch`.
- Added branch-aware diff logic: PRs diff against `origin/$BASE_REF`;
pushes diff `HEAD~1...HEAD`.
- Removed `github.event_name != 'pull_request'` fallbacks from
`synthetic-parity`, `golden-comparison`, and `generation-e2e`. These
jobs now rely purely on detection output (`has_affected` / `run_all`).
#### `detect_affected_models.py`
- Commented out all entries in `_SHARED_INFRA_PATTERNS`. Changes to
`_configs.py`, `_registry.py`, `_builder.py`, `_weight_loading.py`,
`_model_package.py`, `_exporter.py`, and `models/__init__.py` no longer
trigger `run_all`.
- These files now classify as `"other"` and do not trigger any model
tests.
#### `detect_affected_models_test.py`
- Updated tests to match the new classification and detection behavior.
### What this means in practice
| Scenario | Before | After |
|---|---|---|
| Push to `main` | Detection skipped, all tests run unconditionally |
Detection runs, only affected models tested |
| Change `_configs.py` | `run_all=true`, every model tested | No model
tests triggered |
| Change `_attention.py` | Traced via import graph (per-model) | Same —
no change |
| Change `models/falcon.py` | Falcon + dependents tested | Same — no
change |
### How to restore `run_all` for infrastructure files
Re-add entries to `_SHARED_INFRA_PATTERNS` in
`scripts/detect_affected_models.py`:
```python
_SHARED_INFRA_PATTERNS: tuple[str, ...] = (
"src/mobius/_configs.py",
"src/mobius/_registry.py",
# ...
)
```
### Risk
Changes to base files like `_configs.py` that break multiple models will
not be caught until those models are independently modified. This is an
accepted tradeoff for faster CI iteration on infrastructure. If a broad
regression is suspected, use `workflow_dispatch` with a manual change
list or re-enable the patterns.
---------
Signed-off-by: Tommaso Adani <[email protected]>
Co-authored-by: Tommaso Adani <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>run_all (#192)1 parent e53af5d commit 28dc247
3 files changed
Lines changed: 48 additions & 51 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | | - | |
35 | 33 | | |
36 | 34 | | |
37 | 35 | | |
| |||
44 | 42 | | |
45 | 43 | | |
46 | 44 | | |
47 | | - | |
48 | | - | |
| 45 | + | |
| 46 | + | |
49 | 47 | | |
50 | 48 | | |
51 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
52 | 56 | | |
53 | | - | |
54 | | - | |
55 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
56 | 61 | | |
57 | 62 | | |
58 | | - | |
| 63 | + | |
59 | 64 | | |
60 | 65 | | |
61 | 66 | | |
| |||
119 | 124 | | |
120 | 125 | | |
121 | 126 | | |
122 | | - | |
123 | | - | |
| 127 | + | |
124 | 128 | | |
125 | 129 | | |
126 | 130 | | |
| |||
150 | 154 | | |
151 | 155 | | |
152 | 156 | | |
153 | | - | |
154 | | - | |
| 157 | + | |
155 | 158 | | |
156 | 159 | | |
157 | 160 | | |
| |||
187 | 190 | | |
188 | 191 | | |
189 | 192 | | |
190 | | - | |
191 | | - | |
| 193 | + | |
192 | 194 | | |
193 | 195 | | |
194 | 196 | | |
| |||
202 | 204 | | |
203 | 205 | | |
204 | 206 | | |
205 | | - | |
206 | | - | |
| 207 | + | |
207 | 208 | | |
208 | 209 | | |
209 | 210 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
39 | 43 | | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
| 44 | + | |
50 | 45 | | |
51 | 46 | | |
52 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
44 | | - | |
45 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
197 | | - | |
| 197 | + | |
| 198 | + | |
198 | 199 | | |
199 | | - | |
| 200 | + | |
| 201 | + | |
200 | 202 | | |
201 | 203 | | |
202 | 204 | | |
| |||
249 | 251 | | |
250 | 252 | | |
251 | 253 | | |
252 | | - | |
253 | | - | |
| 254 | + | |
| 255 | + | |
254 | 256 | | |
255 | 257 | | |
256 | 258 | | |
257 | 259 | | |
258 | 260 | | |
259 | 261 | | |
260 | | - | |
| 262 | + | |
| 263 | + | |
261 | 264 | | |
262 | | - | |
263 | | - | |
| 265 | + | |
| 266 | + | |
264 | 267 | | |
265 | | - | |
| 268 | + | |
266 | 269 | | |
267 | 270 | | |
268 | 271 | | |
| |||
281 | 284 | | |
282 | 285 | | |
283 | 286 | | |
284 | | - | |
285 | | - | |
| 287 | + | |
| 288 | + | |
286 | 289 | | |
287 | 290 | | |
288 | 291 | | |
289 | 292 | | |
290 | 293 | | |
291 | 294 | | |
292 | | - | |
293 | 295 | | |
294 | | - | |
295 | | - | |
296 | 296 | | |
297 | 297 | | |
298 | | - | |
| 298 | + | |
299 | 299 | | |
300 | 300 | | |
301 | 301 | | |
| |||
310 | 310 | | |
311 | 311 | | |
312 | 312 | | |
313 | | - | |
314 | | - | |
| 313 | + | |
| 314 | + | |
315 | 315 | | |
316 | 316 | | |
317 | 317 | | |
318 | 318 | | |
319 | 319 | | |
320 | 320 | | |
321 | | - | |
| 321 | + | |
| 322 | + | |
322 | 323 | | |
323 | 324 | | |
324 | 325 | | |
| |||
0 commit comments