Skip to content

fix(upgrade): remove hard chain depth cap for nightly delta upgrades#444

Merged
BYK merged 1 commit intomainfrom
fix/nightly-delta-chain-depth
Mar 17, 2026
Merged

fix(upgrade): remove hard chain depth cap for nightly delta upgrades#444
BYK merged 1 commit intomainfrom
fix/nightly-delta-chain-depth

Conversation

@BYK
Copy link
Member

@BYK BYK commented Mar 17, 2026

The MAX_CHAIN_DEPTH=10 limit silently rejected nightly delta upgrade chains
when >10 commits landed on main between the current and target versions (~2-3
days of normal development). This caused fallback to full binary downloads (~30 MB)
even when the total patch chain was much smaller.

The existing SIZE_THRESHOLD_RATIO=0.6 already guards against chains where cumulative
patch size exceeds 60% of the full binary — this is the meaningful cost/benefit check.
The hard depth limit was redundant for nightly and fired before the size check could run.

Changes

  • Rename MAX_CHAIN_DEPTHMAX_STABLE_CHAIN_DEPTH (stable keeps the limit since
    it also controls GitHub Releases per_page)
  • Remove hard depth cap from resolveNightlyChain — nightly chains now rely solely on
    the size budget
  • Add debug logging when chain resolution is rejected so --verbose reveals why delta
    was skipped

@github-actions
Copy link
Contributor

github-actions bot commented Mar 17, 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 ✨

  • Add sentry schema command for API introspection by BYK in #437

Bug Fixes 🐛

  • (upgrade) Remove hard chain depth cap for nightly delta upgrades by BYK in #444

🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 17, 2026

Codecov Results 📊

111 passed | Total: 111 | 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 1071 uncovered lines.
✅ Project coverage is 95.25%. Comparing base (base) to head (head).

Files with missing lines (1)
File Patch % Lines
delta-upgrade.ts 96.28% ⚠️ 25 Missing
Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    95.11%    95.25%    +0.14%
==========================================
  Files          167       167         —
  Lines        22531     22542       +11
  Branches         0         0         —
==========================================
+ Hits         21430     21471       +41
- Misses        1101      1071       -30
- Partials         0         0         —

Generated by Codecov Action

@BYK BYK marked this pull request as ready for review March 17, 2026 11:36
@BYK BYK force-pushed the fix/nightly-delta-chain-depth branch from f7fdcc1 to 586f4fa Compare March 17, 2026 11:48
The MAX_CHAIN_DEPTH=10 limit silently rejected nightly delta upgrade
chains when >10 commits landed on main between the current and target
versions (~2-3 days of normal development). This caused fallback to
full binary downloads (~30 MB) even when the total patch chain was
much smaller.

The existing SIZE_THRESHOLD_RATIO=0.6 already guards against chains
where cumulative patch size exceeds 60% of the full binary — this is
the meaningful cost/benefit check. The hard depth limit was redundant
for nightly and fired before the size check could even run.

Changes:
- Rename MAX_CHAIN_DEPTH → MAX_STABLE_CHAIN_DEPTH (stable keeps the
  limit since it also controls GitHub Releases per_page)
- Remove hard depth cap from resolveNightlyChain — nightly chains now
  rely solely on the size budget
- Add debug logging when chain resolution is rejected (depth exceeded,
  size budget blown, validation failure, no tags found) so --verbose
  reveals why delta was skipped
@BYK BYK force-pushed the fix/nightly-delta-chain-depth branch from 586f4fa to 7fc7c06 Compare March 17, 2026 11:58
@BYK
Copy link
Member Author

BYK commented Mar 17, 2026

Addressed BugBot feedback: added MAX_NIGHTLY_CHAIN_DEPTH = 30 as a safety net against unbounded GHCR manifest fan-out. This matches the GHCR cleanup KEEP_COUNT (30 retained nightly tags), so every retained patch tag is usable while preventing runaway Promise.all bursts. The size budget (SIZE_THRESHOLD_RATIO = 0.6) remains the primary cost/benefit guard.

Copy link

@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 1 potential issue.

Fix All in Cursor

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

@BYK BYK merged commit f451431 into main Mar 17, 2026
22 checks passed
@BYK BYK deleted the fix/nightly-delta-chain-depth branch March 17, 2026 12:05
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