Skip to content

fix: verify GitHub Pages deployment - #60

Open
Rowrow620 wants to merge 1 commit into
devfrom
fix/github-pages-deployment
Open

fix: verify GitHub Pages deployment#60
Rowrow620 wants to merge 1 commit into
devfrom
fix/github-pages-deployment

Conversation

@Rowrow620

Copy link
Copy Markdown
Owner

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

  • Bug fix (non-breaking change fixing an issue)
  • Algorithm visualizer audit / correction
  • New feature (non-breaking change adding functionality)
  • Documentation update
  • Refactoring / performance optimization

Verification Checklist

  • Code compiles cleanly without errors
  • cargo test --all passes the complete test suite
  • cargo fmt --all -- --check complies with standard Rust formatting
  • cargo clippy --all-targets -- -D warnings produces zero warnings
  • WebAssembly release build and browser launch test pass locally at /AlgoBuddy/
  • Timeline state is not affected by this deployment and startup change

Copilot AI lite review requested due to automatic review settings September 3, 2026 06:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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 thread src/app.rs
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();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants