Commit 472d0d6
authored
fix(delta-upgrade): filter non-versioned nightly tags from GHCR patch generation (#753)
## Summary
A stale `nightly-test` tag in GHCR (created Feb 26 for testing, never
cleaned up) broke **every** nightly delta upgrade. This PR fixes the
root cause, adds guardrails, and cleans up the damage.
### Root cause
`generate-patches` runs **before** `publish-nightly`, so the current
version's nightly tag doesn't exist yet. The tag loop (`grep '^nightly-'
| sort -V`) fell through to `nightly-test` (which sorts last) as the
"previous version." Its empty binaries (44 bytes `.gz`) produced ~23 MB
patches that exceeded the client's 60% size budget on every upgrade
attempt.
### What was done
**Immediate cleanup (manual):**
- Deleted the `nightly-test` tag from GHCR (version ID 706511735)
- Deleted all 82 corrupted `patch-*` tags that were generated against
the empty `nightly-test` binaries (201 good patches preserved)
**Preventive CI fix:**
- Changed `grep '^nightly-'` → `grep '^nightly-[0-9]'` in all 3
locations (generate-patches, publish-nightly, cleanup-nightlies) to
reject non-versioned tags
- Added a "Validate patch sizes" CI step that rejects patches exceeding
50% of binary size, removes them from the upload, and auto-files a
GitHub issue
**Diagnostic improvement:**
- Refactored `validateChainStep` to return a discriminated union
(`ChainStepResult`) with typed failure reasons (`version-mismatch`,
`missing-layer`, `size-exceeded`) instead of bare `null`
- Debug log now shows the specific failure reason instead of a
misleading generic `budget=X` message
### Files changed
| File | Change |
|------|--------|
| `.github/workflows/ci.yml` | `grep '^nightly-[0-9]'` filter + patch
size validation step |
| `.github/workflows/cleanup-nightlies.yml` | `grep '^nightly-[0-9]'`
filter |
| `src/lib/delta-upgrade.ts` | `validateChainStep` returns typed
failures, `formatStepFailure` helper |
| `test/lib/delta-upgrade.test.ts` | 4 unit tests for
`validateChainStep` |1 parent e3ca859 commit 472d0d6
File tree
5 files changed
+261
-75
lines changed- .github/workflows
- src/lib
- test/lib
5 files changed
+261
-75
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
328 | 328 | | |
329 | 329 | | |
330 | 330 | | |
331 | | - | |
| 331 | + | |
332 | 332 | | |
333 | 333 | | |
334 | 334 | | |
| |||
408 | 408 | | |
409 | 409 | | |
410 | 410 | | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
411 | 461 | | |
412 | 462 | | |
413 | 463 | | |
| |||
531 | 581 | | |
532 | 582 | | |
533 | 583 | | |
534 | | - | |
| 584 | + | |
535 | 585 | | |
536 | 586 | | |
537 | 587 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
0 commit comments