test: add legacy-data upgrade-path integration test to CI - #484
Conversation
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>
|
Warning Review limit reached
Next review available in: 40 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
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. Comment |
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>
* 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>
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.shruns entirely inside a sandboxedHOME/XDGdirectory (never touches the developer's real offckb data):@offckb/cli@0.3.4from npm, start its node (CKB 0.113.1), mine some blocks, send a transfer, stop it.pnpm buildoutput) against that same data directory and assert:tcp_listen_addressenabled (required byoffckb status/ ckb-tui). This is the exact class of bug that historically shipped to users undetected.specs/dev.toml) stays byte-identical —initChainIfNeededmust never overwrite an existing devnet config.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
.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) is cached to keep the legacy CLI install fast.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.jsongets atest:legacy-datascript; changeset included (test/CI infra only, no runtime changes).Verification