fix: verify WebAssembly deployments before publishing - #59
Closed
Rowrow620 wants to merge 1 commit into
Closed
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The CI workflow references non-existent GitHub Action major versions (and the smoke script contains a misleading error message for local runs), which would break the deployment/verification pipeline.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR hardens the GitHub Pages WebAssembly release pipeline by ensuring the deployed artifact is the same one that passed native quality gates and a browser launch smoke test, and by adding a live-site verification step that checks the published revision in a real browser session.
Changes:
- Adds a revision-stamped Playwright smoke test that verifies the app launches correctly under the
/AlgoBuddy/subpath and that the published revision matches the expected commit. - Updates the WASM app startup to expose a deterministic “ready” marker for the smoke test and improves WASM startup logging/error reporting.
- Consolidates Pages deployment + verification into the existing CI workflow, and documents the local/release validation steps.
File summaries
| File | Description |
|---|---|
src/main.rs |
Initializes web logging and logs WASM startup failures instead of silently ignoring them. |
src/app.rs |
Adds a WASM-only readiness marker and moves loader removal to a deterministic post-render frame. |
scripts/wasm-smoke.mjs |
New Playwright-based smoke test for local + live deployments, including revision verification. |
scripts/stamp-wasm-build.mjs |
New build stamping script that injects the deploy SHA into index.html and writes deploy-sha.txt. |
index.html |
Seeds the readiness attribute for the smoke test to flip once the app is rendered. |
.github/workflows/ci.yml |
Adds build+smoke-test, deploy, and live verification jobs to the CI pipeline. |
.github/workflows/deploy-wasm.yml |
Removes the now-redundant standalone Pages deployment workflow. |
package.json |
Adds Node/Playwright dev tooling for the smoke test + stamping scripts. |
package-lock.json |
Locks Playwright dependencies for reproducible CI/local runs. |
CONTRIBUTING.md |
Documents when/how to run the WASM launch test locally. |
RELEASING.md |
Updates release steps to reflect the new CI-gated deploy + live verification flow. |
CHANGELOG.md |
Notes the GitHub Pages deployment fix and new verification steps. |
.gitignore |
Ignores Node/Playwright/smoke-test outputs introduced by the new tooling. |
Review details
- Files reviewed: 11/13 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+62
to
+72
| async function resolveExpectedRevision() { | ||
| if (!expectedRevision && !liveBaseUrl) { | ||
| expectedRevision = (await readFile(path.join(siteDirectory, "deploy-sha.txt"), "utf8")).trim(); | ||
| } | ||
| if (!expectedRevision) { | ||
| throw new Error("EXPECTED_DEPLOY_SHA is required for live smoke tests"); | ||
| } | ||
| if (!/^[0-9a-f]{40}$/i.test(expectedRevision)) { | ||
| throw new Error("Expected deployment revision must be a 40-character Git commit SHA"); | ||
| } | ||
| } |
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.
Description
Repairs the GitHub Pages deployment path so a successful
mainpush first passes native quality gates and a production WebAssembly launch test, then deploys that exact artifact and verifies the published revision in a browser.The change replaces the separate deployment workflow with the tested CI pipeline, adds a revision-stamped Playwright smoke test at the
/AlgoBuddy/subpath, and documents the local and release checks for contributors and maintainers.Related Issues
N/A — follows up on the failed GitHub Pages deployment.
Type of Change
Verification Checklist
cargo test --allpasses the complete test suitecargo fmt --all -- --checkcomplies with standard Rust formattingcargo clippy --all-targets -- -D warningsproduces zero warnings/AlgoBuddy/subpath