fix: verify GitHub Pages deployment - #60
Open
Rowrow620 wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The wasm readiness marker currently relies on exact frame numbering and expect(...) panics on DOM failures, which can cause flaky readiness signaling or crash the production wasm app instead of failing gracefully.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR hardens the GitHub Pages WebAssembly deployment by adding a CI-gated browser launch smoke test, stamping the built bundle with a commit SHA, deploying the tested artifact from main, and verifying the live published site serves that same revision.
Changes:
- Add wasm startup readiness signaling in the app + new Playwright-based smoke test script that validates bundle launch, asset paths, and revision markers.
- Update CI workflow to build/stamp/smoke-test the wasm bundle before deployment, then run a second live-site verification after Pages deploys.
- Document the new browser launch test requirements for contributors and release maintainers.
File summaries
| File | Description |
|---|---|
src/main.rs |
Initializes a web logger and logs wasm startup failures instead of silently ignoring them. |
src/app.rs |
Adds a wasm-only readiness marker (data-algobuddy-ready) and delays removing the loading element until the app renders. |
scripts/wasm-smoke.mjs |
New Playwright smoke test to validate local/live wasm launch, asset paths, MIME types, and revision markers. |
scripts/stamp-wasm-build.mjs |
New script to stamp index.html with a deploy SHA meta tag and write deploy-sha.txt. |
RELEASING.md |
Updates release steps to include the browser launch test and CI expectations around deployment verification. |
package.json |
Adds Node/Playwright dev setup and scripts for stamping + smoke testing. |
package-lock.json |
Locks Playwright dependency versions for reproducible CI installs. |
index.html |
Initializes the readiness attribute to false for the smoke test to wait on. |
CONTRIBUTING.md |
Documents how to run the browser launch smoke test locally and when it’s required. |
CHANGELOG.md |
Notes the GitHub Pages deployment fix and new CI gating/verification behavior. |
.gitignore |
Ignores Node/Playwright and smoke-test output directories. |
.github/workflows/deploy-wasm.yml |
Removes the separate Pages deploy workflow in favor of a unified CI pipeline. |
.github/workflows/ci.yml |
Adds wasm build + smoke test + deploy + live verification jobs, with concurrency/permissions updates. |
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
+32
to
+52
| #[cfg(target_arch = "wasm32")] | ||
| fn mark_web_ready(ctx: &egui::Context) { | ||
| if ctx.frame_nr() != 1 { | ||
| return; | ||
| } | ||
|
|
||
| let document = web_sys::window() | ||
| .and_then(|window| window.document()) | ||
| .expect("browser document must be available"); | ||
| let canvas = document | ||
| .get_element_by_id("the_canvas_id") | ||
| .expect("AlgoBuddy canvas must exist"); | ||
|
|
||
| canvas | ||
| .set_attribute("data-algobuddy-ready", "true") | ||
| .expect("canvas readiness marker must be writable"); | ||
|
|
||
| if let Some(loading) = document.get_element_by_id("loading_text") { | ||
| loading.remove(); | ||
| } | ||
| } |
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
Fixes the GitHub Pages deployment path. The CI workflow now builds and launches the WebAssembly bundle before deployment, deploys that tested artifact from
main, and checks that the published site serves the expected revision.It also adds the local browser smoke test and documents when maintainers and contributors need to run it.
Related Issues
N/A
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/