Skip to content

Comments

ci: build wasm compiler during docs deployment to fix live editor#16406

Merged
Mossaka merged 2 commits intomainfrom
fix/docs-editor-wasm-build
Feb 17, 2026
Merged

ci: build wasm compiler during docs deployment to fix live editor#16406
Mossaka merged 2 commits intomainfrom
fix/docs-editor-wasm-build

Conversation

@Mossaka
Copy link
Collaborator

@Mossaka Mossaka commented Feb 17, 2026

Summary

  • The live editor at /gh-aw/editor/ is broken on the deployed docs site because wasm_exec.js and gh-aw.wasm are gitignored build artifacts that were never built during the docs deployment pipeline
  • The Web Worker's importScripts('./wasm_exec.js') fails with NetworkError because the file does not exist on the deployed site
  • Adds Go setup and scripts/bundle-wasm-docs.sh to the docs workflow so the WebAssembly compiler is built and placed in docs/public/wasm/ before the Astro build
  • Expands path triggers to include cmd/gh-aw-wasm/**, pkg/**, and scripts/bundle-wasm-docs.sh so Go changes affecting the wasm build trigger a docs rebuild

Supersedes #16306.

Root cause analysis

The editor page loads compiler-loader.js which spawns a Web Worker from compiler-worker.js. The worker calls importScripts('./wasm_exec.js') which resolves to /gh-aw/wasm/wasm_exec.js. Both wasm_exec.js and gh-aw.wasm are generated by scripts/bundle-wasm-docs.sh (which invokes make build-wasm) and are listed in .gitignore. The docs deployment workflow (docs.yml) was only running npm run build without first building the wasm artifacts, so the deployed site was missing these files entirely.

Test plan

  • Verified editor loads and compiles successfully on local dev server (Playwright test confirms status "Ready" and compiled YAML output)
  • Verify docs workflow triggers on PRs touching cmd/gh-aw-wasm/, pkg/, or scripts/bundle-wasm-docs.sh
  • Verify Go is set up correctly and bundle-wasm-docs.sh runs before the Astro build
  • Verify the deployed docs site editor works end-to-end after merge

🤖 Generated with Claude Code

The live editor at /gh-aw/editor/ fails with "Failed to execute
'importScripts' on 'WorkerGlobalScope'" because wasm_exec.js and
gh-aw.wasm are gitignored build artifacts that were never built
during the docs deployment pipeline.

Add Go setup and scripts/bundle-wasm-docs.sh to the docs workflow
so the WebAssembly compiler is built and placed in docs/public/wasm/
before the Astro build. Also expand path triggers to rebuild docs
when wasm-related source files change.

Supersedes #16306.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings February 17, 2026 17:22
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the docs deployment workflow to ensure the WebAssembly compiler artifacts needed by the live editor are built and included in the published Astro site.

Changes:

  • Expand pull_request / push path filters to rebuild docs when WASM-related Go code changes.
  • Add Go toolchain setup to the docs workflow.
  • Run the WASM bundling script before the Astro build so docs/public/wasm/ has the required artifacts at build time.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 11 to +16
pull_request:
paths:
- 'docs/**'
- 'cmd/gh-aw-wasm/**'
- 'pkg/**'
- 'scripts/bundle-wasm-docs.sh'
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

The pull_request.paths / push.paths filters don’t include this workflow file itself. As a result, a PR that only changes .github/workflows/docs.yml (like this one) won’t trigger the docs build, which makes it hard to validate the workflow changes. Consider adding .github/workflows/docs.yml to both path lists.

Copilot uses AI. Check for mistakes.
Comment on lines 14 to 24
- 'cmd/gh-aw-wasm/**'
- 'pkg/**'
- 'scripts/bundle-wasm-docs.sh'
push:
branches:
- main
paths:
- 'docs/**'
- 'cmd/gh-aw-wasm/**'
- 'pkg/**'
- 'scripts/bundle-wasm-docs.sh'
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

The path filters were expanded for Go/WASM-related changes, but they still won’t trigger on dependency/build-definition changes in the repo root (e.g. go.mod, go.sum, or Makefile). Since the WASM artifacts are produced via make build-wasm and depend on module state, consider adding these root files to both pull_request.paths and push.paths so docs rebuild when the WASM build inputs change.

Copilot uses AI. Check for mistakes.
- Add .github/workflows/docs.yml itself so workflow changes trigger CI
- Add go.mod, go.sum, Makefile so dependency/build changes trigger rebuild

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Mossaka Mossaka merged commit 5c6c7d7 into main Feb 17, 2026
2 checks passed
@Mossaka Mossaka deleted the fix/docs-editor-wasm-build branch February 17, 2026 20:29
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.

1 participant