Skip to content

fix(delta-upgrade): filter non-versioned nightly tags from GHCR patch generation#753

Merged
BYK merged 2 commits intomainfrom
byk/fix-nightly-delta-upgrade
Apr 14, 2026
Merged

fix(delta-upgrade): filter non-versioned nightly tags from GHCR patch generation#753
BYK merged 2 commits intomainfrom
byk/fix-nightly-delta-upgrade

Conversation

@BYK
Copy link
Copy Markdown
Member

@BYK BYK commented Apr 14, 2026

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 14, 2026

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

  • (cli) Add sentry cli defaults command for persistent settings by BYK in #721
  • (docs) Auto-generate driftable documentation sections by BYK in #739
  • (issue-list) Add search syntax docs, case-insensitive AND/OR, and JSON syntax reference by BYK in #738
  • (setup) Install agent skills for detected roots by betegon in #747
  • (trace) Consistent project filtering across trace commands (feat: support filtering spans by project within a trace #737) by BYK in #743
  • (trace-view) Expose span attributes in trace and span views by BYK in #742

Bug Fixes 🐛

Event View

  • Validate event ID format before API call (CLI-156) by BYK in #751
  • Add cross-org fallback when event not found by BYK in #744

Init

  • Treat no-op edits as passthrough instead of throwing by betegon in #731
  • Remove JSON minification that breaks edit-based codemods by betegon in #719

Issue List

  • Auto-recover when user passes issue short ID instead of project slug by BYK in #750
  • Auto-correct AND and reject OR in --query to prevent 400 by BYK in #727

Resolve

  • Address review comments and add tests for fuzzy project recovery by BYK in #732
  • Fuzzy auto-recovery for project slug resolution by BYK in #728

Upgrade

  • Contextual error messages for offline cache miss (CLI-13Z) by BYK in #752
  • Detect npm install method from node_modules path by BYK in #723
  • Add shell option on Windows for .cmd package managers by BYK in #722

Other

  • (ci) Add retry logic to ORAS/bsdiff downloads and upgrade ORAS by BYK in #741
  • (dashboard) Remove overly restrictive dataset-display cross-validation by BYK in #720
  • (delta-upgrade) Filter non-versioned nightly tags from GHCR patch generation by BYK in #753
  • (errors) Improve ContextError wording for auto-detect failures by BYK in #726
  • (issue) Support share issue URLs by BYK in #718
  • (release-delete) Enrich error for releases with health data (CLI-14K) by BYK in #749
  • (telemetry) Rename isClientApiError to isUserApiError and exclude 400 by BYK in #729
  • Bug fixes from Sentry error monitoring (CLI-FR, CLI-RN) + auth default by BYK in #740

Internal Changes 🔧

  • Regenerate skill files by github-actions[bot] in ca16b2ff

🤖 This preview updates automatically when you update the PR.

… generation

A stale `nightly-test` tag in GHCR was breaking every nightly delta
upgrade. `sort -V` placed it after all versioned tags, and since the
generate-patches job runs before publish-nightly (so the current
version's tag doesn't exist yet), the loop fell through to
`nightly-test` as the previous version. Its empty binaries produced
huge patches that exceeded the 60% size budget.

- Harden all 3 GHCR tag grep filters to `'^nightly-[0-9]'`
- Deleted the `nightly-test` tag from GHCR (version ID 706511735)
- Refactor `validateChainStep` to return typed failure reasons instead
  of bare `null`, improving debug logging for future chain failures
@BYK BYK force-pushed the byk/fix-nightly-delta-upgrade branch from 2614602 to 535fc8d Compare April 14, 2026 17:41
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 14, 2026

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://cli.sentry.dev/_preview/pr-753/

Built to branch gh-pages at 2026-04-14 17:59 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 14, 2026

Codecov Results 📊

134 passed | Total: 134 | Pass Rate: 100% | Execution Time: 0ms

📊 Comparison with Base Branch

Metric Change
Total Tests
Passed Tests
Failed Tests
Skipped Tests

✨ No test changes detected

All tests are passing successfully.

✅ Patch coverage is 100.00%. Project has 1626 uncovered lines.
❌ Project coverage is 95.33%. Comparing base (base) to head (head).

Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
- Coverage    95.35%    95.33%    -0.02%
==========================================
  Files          234       234         —
  Lines        34764     34791       +27
  Branches         0         0         —
==========================================
+ Hits         33145     33165       +20
- Misses        1619      1626        +7
- Partials         0         0         —

Generated by Codecov Action

Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 535fc8d. Configure here.

@BYK BYK force-pushed the byk/fix-nightly-delta-upgrade branch from 535fc8d to 73d36f8 Compare April 14, 2026 17:51
Add a validation step after patch generation that checks each patch's
size ratio against the binary. Patches exceeding 50% of binary size
(below the client's 60% budget) are removed from the artifact upload
and a GitHub issue is filed. This catches cases where the old binary
download silently fails, producing useless full-size patches.
@BYK BYK force-pushed the byk/fix-nightly-delta-upgrade branch from 73d36f8 to f04073d Compare April 14, 2026 17:58
@BYK BYK merged commit 472d0d6 into main Apr 14, 2026
26 of 27 checks passed
@BYK BYK deleted the byk/fix-nightly-delta-upgrade branch April 14, 2026 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant