ci(contracts): type-check every contract crate before merge - #1417
Draft
broda-spendy wants to merge 1 commit into
Draft
broda-spendy wants to merge 1 commit into
broda-spendy wants to merge 1 commit into
Conversation
rust-wasm.yml only built -p share-price-math and -p mock-strategy, so a vault or bridge-compat that did not compile could still merge. Add \cargo check --workspace --all-targets --locked\, which compiles every workspace member including test targets; --locked also fails when Cargo.lock is stale. codeql.yml built the vault with a trailing \|| true\, which discarded the exit status and is how a non-compiling vault reached main unnoticed. The wasm32 build is expected to fail for the vault (blocked upstream by DataKey contracttype limits), so fall back to the host build and let a genuine compile error fail the job.
|
@broda-spendy 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! 🚀 |
This was referenced Sep 26, 2026
This branch has not been deployed
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.
Summary
Makes a broken contract fail CI instead of passing silently. Two small workflow changes, no code.
What changed
rust-wasm.yml— therust-testjob built only-p share-price-math(clippy) and-p mock-strategy. Nothing compiled thevaultorbridge-compatcrates, so either could be entirely non-compiling and still merge. Added:--workspacecovers all four members,--all-targetsincludes test code, and--lockedfails whenCargo.lockis stale (it currently is — see below).codeql.yml— the vault build ended in|| true, which discards the exit status:That
|| trueis why a non-compiling vault reachedmain: the job went green regardless. The wasm32 build is genuinely expected to fail for the vault (blocked upstream byDataKeycontracttype limits), which is presumably why the|| truewas added. I kept the fallback but pointed it atmock-strategy— the crate that does build to wasm — so the host build of the vault is the thing that must pass:Why
cargo checkand notcargo buildchecktype-checks without producing artifacts, so it is much faster than a full build and catches every compile error that matters here. The wasm32 build in thewasm-buildjob still covers artifact production for the crates that support it.Verification
I ran the new command against both sides of the real breakage:
upstream/main: fails, immediately, witherror: cannot update the lock file ... because --locked was passed—Cargo.lockhas nobridge-compatentry even though the workspace lists it.Finished dev profile.And the
codeql.ymlfallback was verified by inspection: the vault's wasm32 build is still expected to fail, so the host build is the real gate.Related
This is the prevention half of the problem. The repair is #1416, which restores compilation across all four crates. This PR is deliberately independent of it so it can merge first — once it does, any future breakage of this kind is caught at the PR rather than discovered later. It also fixes a second blind spot: the stale
Cargo.lockthat made every--lockedstep in this workflow fail.Closes #1304