feat: cross-repo compatibility matrix + CI check (#395) - #418
Open
bright5455 wants to merge 1 commit into
Open
Conversation
Bridgelet is split across three independently versioned repos with no record of which frontend release actually works against which bridgelet-sdk / bridgelet-core version, and no automated signal when a combination breaks. - docs/compatibility.md + compatibility.json: human-readable matrix and machine-readable pin, read by both CI and the release process. - .github/workflows/compatibility.yml: checks out the pinned bridgelet-sdk commit, boots it against a real Postgres + Stellar testnet, and runs scripts/check-sdk-contract.mjs against its live OpenAPI spec — fails the build if an endpoint/field the frontend's API client depends on is missing. This runs on every PR and on a daily schedule without needing funded-testnet secrets; when BRIDGELET_SDK_* secrets are configured it additionally runs the e2e suite in SDK-integration mode as a best-effort secondary check. - scripts/check-compatibility-doc.mjs, wired into .release-it.json's before:git:release hook, blocks tagging a release until compatibility.json/docs/compatibility.md have been updated and CI has verified the pin. While building the contract check we found a real, pre-existing drift (frontend's AccountStatus type vs. bridgelet-sdk's actual enum) — noted in docs/compatibility.md as a known gap this check doesn't cover (field-name presence, not enum/type equivalence). Closes bridgelet-org#395 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
@bright5455 is attempting to deploy a commit to the aminubabafatima8-gmailcom's projects Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #395
Problem
bridgelet-core,bridgelet-sdk, and this repo each release independently, and nothing recorded which frontend release actually works against which SDK version, or gave an automated signal when a combination breaks.What this adds
docs/compatibility.md— the human-readable matrix: whichbridgeletreleases are verified against whichbridgelet-sdk/bridgelet-coreversions, a status legend, and the update process.compatibility.json— the machine-readable pin (verified.bridgeletSdk/bridgeletCore: repo/ref/commit/version) that both CI and the release process read. Currently pinned tobridgelet-sdk/bridgelet-coremainby commit SHA, since neither repo has cut a tagged release yet..github/workflows/compatibility.yml— checks out the pinnedbridgelet-sdkcommit, boots it against a real Postgres + Stellar testnet, and runsscripts/check-sdk-contract.mjsagainst its live OpenAPI spec (GET /api/docs-json). It fails the build if an endpoint or fieldfrontend/lib/create-bridgelet-client.tsdepends on is missing — this is the authoritative pass/fail signal, and it runs on every PR (path-filtered) and on a daily schedule without needing funded-testnet secrets. WhenBRIDGELET_SDK_*secrets are configured (documented indocs/compatibility.md#required-ci-secrets) it additionally runs thee2e/Playwright suite in "SDK integration" mode as a best-effort secondary check; without them, it still verifies install/build/migrate/boot and says explicitly in the job summary what was skipped rather than reporting a false pass.scripts/check-compatibility-doc.mjs, wired into.release-it.json'sbefore:git:releasehook — blocks tagging a release untilcompatibility.jsonanddocs/compatibility.mdhave been updated for that version and CI has actually verified the pin (status: "verified"). I ran it locally against the current repo state and confirmed it correctly refuses to release right now, since the pin hasn't had a passing CI run yet.README.md,CHANGELOG.md, andpackage.json(bridgeletCompatibilitypointer +check:compatibility/check:sdk-contractscripts) updated to reference the above.Why not a full-file diff or a pure browser e2e check?
Two things I found while building this that shaped the design, flagged here for visibility:
frontend/lib/bridgelet.tsis hand-written, not the output offrontend/scripts/generate-types.mjs(which emitsopenapi-typescript'spaths/componentsshape). Regenerating and diffing that file against a live SDK would show a 100% rewrite on every run regardless of real compatibility — a false-positive failure, not a signal.check-sdk-contract.mjsinstead asserts field-name presence for the specific endpoints/fields the frontend's client actually reads/sends, resolving$refs against the live spec. It's field-presence, not full type/enum equivalence — documented as a known limit in the script's header and indocs/compatibility.md.frontend/components/mock-provider.tsxcurrently enables MSW mocking wheneverNODE_ENV=development, regardless of anyE2E_USE_MOCKSsetting, andclaim-flow.tsx's redeem handler has a hardcoded dev-mode stub. So thee2e/README.md-documented "SDK integration" mode doesn't yet exercise every route against a real backend end-to-end. I've kept the Playwright run as a secondary, best-effort check (continue-on-error, doesn't fail the job) and documented the gap rather than either silently claiming full e2e coverage or expanding this PR's scope into fixing the mock-toggle wiring, which is a separate, pre-existing issue.I also found, while comparing the frontend's types against
bridgelet-sdk's actual DTOs, that the frontend'sAccountStatustype (pending | claimed | expired) doesn't match the SDK's real enum (pending_payment | pending_claim | claimed | expired | failed) — a genuine, pre-existing drift.check-sdk-contract.mjsdeliberately doesn't check enum values (see above), so this doesn't fail CI; it's called out indocs/compatibility.md#known-gap-this-check-does-not-closeas a known issue for whoever picks it up next, not something this PR fixes.Acceptance criteria
docs/compatibility.md+compatibility.json, enforced by the release-it hook..github/workflows/compatibility.yml, PR (path-filtered) + daily schedule + manual dispatch..release-it.jsonrelease process updated to require the compatibility doc be updated before tagging —before:git:releasehook, verified locally to correctly block.Test plan
node scripts/check-compatibility-doc.mjsrun locally — correctly exits non-zero against current repo state (pin not yet CI-verified), with a clear error message.node scripts/check-sdk-contract.mjsunit-tested locally against a mock OpenAPI server built frombridgelet-sdk's actual DTOs (pulled from the real repo) — passes on a matching spec, fails with a precise message when a depended-on field is removed..github/workflows/compatibility.ymlvalidated for YAML syntax; steps cross-checked againstbridgelet-sdk's actual.env.example,main.tsbootstrap (network-guard, Swagger path, port), andhealthcontroller — I don't have a way to execute a full Postgres+Stellar-testnet run ofbridgelet-sdkfrom here, so the first real CI run may surface small environment fixes..github/workflows/compatibility.ymlon this PR (will run automatically since this PR touchescompatibility.json).🤖 Generated with Claude Code