Commit a7ab079
fix(ci): simplify CI gate to prevent skip/re-run failures (#905)
## Summary
The `all-jobs-complete` gate was duplicating each upstream job's `if`
condition in bash to verify the right jobs ran. This mirrored logic got
out of sync with the actual job conditions, causing two distinct
failures:
1. **Merge queue skip**: when `check-skip-merge-queue` determined the PR
was already up-to-date, gated jobs (`lint-build-test`, `analyse-code`,
`check-workflows`) were correctly skipped by their own `if` conditions,
but the gate still required `success` — so it failed.
2. **Partial re-runs**: when "Re-run failed jobs" was used,
previously-succeeded jobs reported `skipped` instead of `success`, which
the gate also rejected.
This PR replaces the complex per-job validation with a simple loop that
checks no dependency has `failure` or `cancelled` result. Each job's own
`if` condition remains the single source of truth for when it runs — the
gate just verifies nothing went wrong.
Also simplifies `all-jobs-pass` by removing the redundant
`check-skip-merge-queue` fallback, since `all-jobs-complete` now handles
that case correctly via the transitive dependency chain.
- Replaces ~35 lines of conditional bash with a ~10 line loop
- Fixes the failure seen in [run
23651945359](https://github.com/MetaMask/ocap-kernel/actions/runs/23651945359/job/69214610408)
- No new jobs need gate updates — just add them to the `needs` list
## Test plan
The CI gate itself runs as part of this PR's checks. Verifying:
- The `all-jobs-complete` and `all-jobs-pass` jobs both succeed on this
PR
- A docs-only or config-only PR still correctly skips code jobs without
failing the gate
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Changes the CI gating logic in `.github/workflows/main.yml`, which
could inadvertently allow failures through or block merges if
misconfigured. Scope is limited to workflow result checking and does not
touch product code.
>
> **Overview**
> Simplifies the `all-jobs-complete` CI gate by replacing per-job
conditional checks with a loop that fails only when a dependency job
result is `failure` or `cancelled`, treating `skipped` as acceptable.
>
> Also tightens `all-jobs-pass` to depend solely on
`all-jobs-complete`’s `passed` output, removing the extra merge-queue
skip fallback logic.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
30a48c0. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent aa5e10b commit a7ab079
1 file changed
Lines changed: 19 additions & 36 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
245 | 253 | | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
| 254 | + | |
255 | 255 | | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
260 | 264 | | |
261 | 265 | | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
| 266 | + | |
281 | 267 | | |
282 | 268 | | |
283 | 269 | | |
| |||
287 | 273 | | |
288 | 274 | | |
289 | 275 | | |
290 | | - | |
291 | 276 | | |
292 | 277 | | |
293 | | - | |
294 | | - | |
295 | 278 | | |
296 | | - | |
| 279 | + | |
297 | 280 | | |
298 | 281 | | |
0 commit comments