Commit 3316560
fix(hetzner-e2e): classify 403 limit_reached as quota_exceeded, not missing_token
Run 26077765355 surfaced a misleading "missing_token" error on a Hetzner
project that actually hit its server cap. The API returned HTTP 403 with
body `{ error: { code: "limit_reached", message: "server limit reached" } }`,
but `mapStatusToCode` short-circuited on status 401/403 before reading the
apiCode, collapsing quota exhaustion and missing-token into one bucket.
Layer 1: reorder `mapStatusToCode` so the explicit `limit_reached` /
`resource_limit_exceeded` apiCode wins over the status-only auth fallback.
This is the only correct mapping: status 403 with `limit_reached` is a
project quota issue, not an auth problem, and operators should not be
told to refresh a token that is working fine.
Provision script: extend `isRetryableCombo` to also retry the next
fallback combo on `quota_exceeded` (and the literal "server limit
reached" / "limit_reached" / "resource_limit_exceeded" message strings,
so we stay correct if the error is rewrapped). The fallback ladder is
finite, so a genuinely exhausted project still surfaces a single, clear
error after the ladder is exhausted — with an operator-facing hint
("delete leaked CI servers in https://console.hetzner.cloud/ or rotate
HCLOUD_TOKEN_CI to a project with capacity"). A non-retryable 401/403
also now prints a hint pointing at the GitHub `ci-hetzner-e2e`
environment.
Layer 2: workflow now captures the provision step's combined output to
a log and, on failure, writes a categorized diagnostic to
GITHUB_STEP_SUMMARY (quota vs auth vs unknown) so the operator opening
the failed run sees the actionable next step at the top instead of
buried in the step log.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 9e3a8ec commit 3316560
3 files changed
Lines changed: 97 additions & 9 deletions
File tree
- .github/workflows
- packages
- scripts/cloud/admin/hetzner-e2e
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
| 99 | + | |
99 | 100 | | |
100 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
101 | 132 | | |
102 | 133 | | |
103 | 134 | | |
| |||
Lines changed: 9 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
460 | 460 | | |
461 | 461 | | |
462 | 462 | | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
463 | 472 | | |
464 | 473 | | |
465 | 474 | | |
466 | 475 | | |
467 | | - | |
468 | | - | |
469 | | - | |
470 | 476 | | |
471 | 477 | | |
472 | 478 | | |
| |||
Lines changed: 56 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
19 | 22 | | |
20 | 23 | | |
21 | 24 | | |
| |||
48 | 51 | | |
49 | 52 | | |
50 | 53 | | |
51 | | - | |
52 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
53 | 61 | | |
54 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
55 | 66 | | |
56 | 67 | | |
57 | 68 | | |
| |||
60 | 71 | | |
61 | 72 | | |
62 | 73 | | |
63 | | - | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
64 | 82 | | |
65 | 83 | | |
66 | 84 | | |
| |||
179 | 197 | | |
180 | 198 | | |
181 | 199 | | |
182 | | - | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
183 | 217 | | |
184 | 218 | | |
185 | 219 | | |
186 | 220 | | |
187 | 221 | | |
188 | 222 | | |
189 | 223 | | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
190 | 241 | | |
191 | 242 | | |
192 | 243 | | |
| |||
0 commit comments