Commit 68ff59f
Fix Claude analysis gating to handle co-failures correctly (#25491)
* Fix Claude analysis gating to handle co-failures correctly
The previous script exited early when any non-essential step (e.g. Danger)
failed, incorrectly skipping Claude analysis even when essential jobs also
failed in the same build.
Now counts non-essential failures first, then queries the Buildkite API for
the total failed job count. Claude is only skipped when all failures are
accounted for by non-essential steps. Fails safe: if the API call fails,
Claude runs anyway.
Also fixes shebang portability, uses a proper Bash array for step keys,
uses YAML literal scalar to preserve prompt formatting, and includes
timed_out jobs in the failure count.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Fix Claude analysis gating: use hard_failed and handle all-passed
Two bugs fixed:
- buildkite-agent step get outcome returns "hard_failed", not "failed",
so the non-essential check never matched
- When all steps passed, the script fell through to uploading Claude
analysis instead of exiting early
Also restructures the script to query the API first, which simplifies
the flow and avoids a redundant early-exit branch.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent c574ef1 commit 68ff59f
File tree
2 files changed
+38
-9
lines changed- .buildkite
- commands
2 files changed
+38
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
2 | 4 | | |
3 | 5 | | |
4 | | - | |
| 6 | + | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
8 | 30 | | |
9 | 31 | | |
10 | | - | |
| 32 | + | |
11 | 33 | | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
17 | 41 | | |
18 | 42 | | |
19 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
20 | 49 | | |
21 | 50 | | |
0 commit comments