Repository navigation
Matrix checker - #205
Matrix checker#205midenotch wants to merge 3 commits into
Conversation
|
@midenotch Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
truthixify
left a comment
There was a problem hiding this comment.
Blocking findings:
-
This does not meet the issue's “exact installed” requirement.
scripts/check-compatibility-matrix.mjs:142-145,297-327reads dependency specifiers frompackage.json, strips^/~, and calls those the installed versions. The lockfile actually resolves@stellar/stellar-sdkfrom^13.1.0to13.3.0and@solana/web3.jsfrom^1.95.0to1.98.4; the checker still accepts matrix values 13.1.0 and 1.95.0. Resolve and compare the exact versions frompnpm-lock.yaml(or installed package metadata), and add a regression fixture where the specifier stays constant while the resolved lockfile version drifts. -
The PR is stacked on the unmerged Rust/Solana snippet branches and is currently conflicting. Both required snippet jobs are red, so the new required check cannot land in a passing required workflow. Rebase/isolate the matrix-checker commit on current
develop, remove the unrelated snippet/doc changes, and get both required jobs green.
Close: #184
Here's a summary of everything that was done:
Problem root cause: check:compatibility-matrix existed in package.json and ran locally, but no CI job invoked it — so EVM address swaps, Stellar version bumps, CKB code hash changes, and SDK package version drift could all land undetected.
What changed:
check-compatibility-matrix.mjs
— extended with:
validateSdkCoreTable() — reads the "SDK core" table in the matrix and cross-checks each tracked package's version cell against package.json. Catches @wraith-protocol/sdk, @stellar/stellar-sdk, and @solana/web3.js drifting out of sync.
versionsMatch() — strips range operators (^, ~) from both sides before comparing, so ^1.4.5 in the matrix vs 1.4.5 in package.json is not a false positive.
MATRIX_CHECK_ROOT env override — lets the test harness point the checker at a fixture directory without touching the live tree.
All internal helpers exported so the unit tests can call them directly.
check-compatibility-matrix.test.mjs
— 24 tests across two layers:
16 unit tests: pure helper functions, no filesystem, fast.
7 integration tests: each spawns the checker against a tmp fixture built from the live repo files with one value mutated, asserts exit 1 and the right error message. Covers every drift vector — wrong EVM address, wrong Stellar address, wrong Stellar version, SDK version bump, CKB code hash change in owner, registry address updated without matrix update, and a pending row that should no longer be pending.
1 baseline test: confirms the live repo passes exit 0.
package.json — added test:compatibility-matrix script; added it to the test aggregate.
snippets.yml
(check-snippets job) — two new steps after Check contract registry:
Check compatibility matrix — pnpm run check:compatibility-matrix
Test compatibility matrix (regression fixtures) — pnpm run test:compatibility-matrix