Skip to content

test: add legacy-data upgrade-path integration test to CI - #484

Merged
RetricSu merged 2 commits into
developfrom
agent/claude-bear/3d921f9e
Jul 31, 2026
Merged

test: add legacy-data upgrade-path integration test to CI#484
RetricSu merged 2 commits into
developfrom
agent/claude-bear/3d921f9e

Conversation

@humble-little-bear

@humble-little-bear humble-little-bear commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds a CI integration test that simulates a real user upgrading offckb: a devnet created by an old offckb release (0.3.4, which ships CKB 0.113.1) must keep working when the current build operates on that legacy data. This guards the upgrade path that today has zero automated coverage — CI runners always start from a clean environment, so legacy-data regressions (like the ckb.toml Terminal RPC migration bug that previously reached users before we noticed) can only be caught by users.

How it works

scripts/legacy-data-test.sh runs entirely inside a sandboxed HOME/XDG directory (never touches the developer's real offckb data):

  1. Install @offckb/cli@0.3.4 from npm, start its node (CKB 0.113.1), mine some blocks, send a transfer, stop it.
  2. Run the current build (pnpm build output) against that same data directory and assert:
    • The chain continues — same genesis hash, tip grows past the old tip. (A bare "RPC responds" check would let a silent chain reset pass.)
    • The legacy ckb.toml is migrated — Terminal RPC module added + tcp_listen_address enabled (required by offckb status / ckb-tui). This is the exact class of bug that historically shipped to users undetected.
    • The bundled chain spec (specs/dev.toml) stays byte-identicalinitChainIfNeeded must never overwrite an existing devnet config.
    • A fresh transfer succeeds and is committed on the upgraded chain.

The script header carries a CONVENTION note: any future feature that changes how offckb writes/migrates devnet config must extend these assertions, so "new config stays compatible with old data" is enforced institutionally rather than by memory.

CI changes

  • New step in .github/workflows/test.yml, ubuntu-latest only, per-PR: the test is OS-independent (config/data compatibility) and downloads an extra legacy CKB binary, so one platform keeps the signal cheap. Adds ~1 min to the ubuntu job.
  • npm cache (~/.npm) is cached to keep the legacy CLI install fast.
  • Runs before create-test.sh: create-test's teardown only kills the pnpm wrapper and leaves CKB processes holding ports 8114/28114 until job end, which trips the legacy test's precondition check. The legacy test's own teardown is complete, so create-test still starts on free ports. (The orphaned-process issue in create-test is worth a separate fix.)
  • package.json gets a test:legacy-data script; changeset included (test/CI infra only, no runtime changes).

Verification

  • Verified end-to-end locally twice (offckb 0.3.4 → 0.4.10 build).
  • CI on this PR: the new step ran and passed (~70s), all checks green on ubuntu/macos/windows.

Simulate a user upgrading offckb: an old release (0.3.4, CKB 0.113.1)
creates a devnet in a sandboxed HOME/XDG, then the current build must
operate on that legacy data without breaking it:

- the chain continues (same genesis hash, tip grows past the old tip),
  so a silent chain reset cannot pass as 'RPC responds'
- the legacy ckb.toml is migrated (Terminal RPC module +
  tcp_listen_address) — the class of bug that previously reached users
  before we noticed
- the bundled chain spec stays byte-identical
- a fresh transfer succeeds and is committed

Runs per-PR on ubuntu-latest only, after create-test; the npm cache is
cached to keep the extra legacy CLI install cheap. Verified end-to-end
locally twice (offckb 0.3.4 → 0.4.10).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@humble-little-bear, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 40 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 189a91ba-ba84-4aac-8fe4-cd39c9a1a465

📥 Commits

Reviewing files that changed from the base of the PR and between 966926b and c2c6f50.

📒 Files selected for processing (4)
  • .changeset/legacy-data-upgrade-test.md
  • .github/workflows/test.yml
  • package.json
  • scripts/legacy-data-test.sh

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@humble-little-bear
humble-little-bear changed the base branch from master to develop July 31, 2026 05:23
create-test.sh's cleanup kills only the pnpm wrapper, leaving the CKB
processes orphaned and holding ports 8114/28114 (the runner's orphan
cleanup only fires at job end), which tripped the legacy test's
precondition check. Run the legacy test first instead — its own
teardown is complete, so create-test still starts on free ports.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@RetricSu
RetricSu merged commit d8ac978 into develop Jul 31, 2026
7 checks passed
@RetricSu
RetricSu deleted the agent/claude-bear/3d921f9e branch July 31, 2026 07:24
RetricSu added a commit that referenced this pull request Jul 31, 2026
* chore: bump default CKB version to 0.208.0 (#482)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* test: add legacy-data upgrade-path integration test to CI (#484)

* test: add legacy-data upgrade-path integration test to CI

Simulate a user upgrading offckb: an old release (0.3.4, CKB 0.113.1)
creates a devnet in a sandboxed HOME/XDG, then the current build must
operate on that legacy data without breaking it:

- the chain continues (same genesis hash, tip grows past the old tip),
  so a silent chain reset cannot pass as 'RPC responds'
- the legacy ckb.toml is migrated (Terminal RPC module +
  tcp_listen_address) — the class of bug that previously reached users
  before we noticed
- the bundled chain spec stays byte-identical
- a fresh transfer succeeds and is committed

Runs per-PR on ubuntu-latest only, after create-test; the npm cache is
cached to keep the extra legacy CLI install cheap. Verified end-to-end
locally twice (offckb 0.3.4 → 0.4.10).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* ci: run legacy-data test before create-test

create-test.sh's cleanup kills only the pnpm wrapper, leaving the CKB
processes orphaned and holding ports 8114/28114 (the runner's orphan
cleanup only fires at job end), which tripped the legacy test's
precondition check. Run the legacy test first instead — its own
teardown is complete, so create-test still starts on free ports.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: humble-little-bear <retric@ckba.build>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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.

2 participants