Repository navigation
ci(web): keep WASM demo builds green when Pages is disabled - #5
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Reviewer's GuideThe workflow now builds and verifies the browser WebAssembly demo for relevant main-branch changes without requiring GitHub Pages, while making publication an explicit manual action that configures and deploys Pages only when requested. Flow diagram for web demo build and opt-in Pages deploymentflowchart TD
Push[Relevant push to main] --> Build[build job]
Manual[workflow_dispatch] --> Build
Build --> Generate[go run ./cmd/tailcat-webdist -o dist]
Generate --> Verify[verify static demo output]
Verify --> Artifact[upload-pages-artifact]
Artifact --> DeployCheck{workflow_dispatch?}
DeployCheck -- No --> Complete[Build verification complete]
DeployCheck -- Yes --> Configure[configure-pages]
Configure --> Deploy[deploy-pages]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path=".github/workflows/webdemo-pages.yml" line_range="16-24" />
<code_context>
on:
push:
branches: [main]
+ paths:
+ - "web/**"
+ - "webdemo/**"
+ - "internal/wasmbuild/**"
+ - "cmd/tailcat-web/**"
+ - "cmd/tailcat-webdist/**"
+ - "go.mod"
+ - "go.sum"
+ - ".github/workflows/webdemo-pages.yml"
workflow_dispatch:
</code_context>
<issue_to_address>
**issue (broader_impact):** The push path allowlist omits code that directly determines the WebAssembly build, including the root `tailcat` package imported by `web/main_js.go` and `internal/buildtags`, which is imported by `internal/wasmbuild`. Changes to those files do not run this workflow, so the generated demo can regress while CI remains green.
**Triggers:** When a push changes the root Tailcat package or `internal/buildtags` without changing one of the listed paths.
**Suggested fix:** Include all packages that contribute to the WASM binary, such as the root package and `internal/buildtags`, or use a broader repository path filter that covers the build dependency graph.
```suggestion
paths:
- "web/**"
- "webdemo/**"
- "internal/wasmbuild/**"
- "internal/buildtags/**"
- "cmd/tailcat-web/**"
- "cmd/tailcat-webdist/**"
- "*.go"
- "go.mod"
- "go.sum"
- ".github/workflows/webdemo-pages.yml"
```
</issue_to_address>Sourcery assessment
Needs a human reviewer. 1 finding to address first, and if the workflow change is wrong, pushes to main will no longer publish updated demo assets, leaving the Pages site stale while manual dispatch still provides a repair path. Reverting the workflow and rerunning the deployment restores the site, so the impact is bounded and recoverable.
Blocking findings: .github/workflows/webdemo-pages.yml:24
There was a problem hiding this comment.
All reported issues were addressed across 1 file
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Sourcery withdrew this approval because the latest commits introduced blocking findings.
There was a problem hiding this comment.
All reported issues were addressed across 10 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
There was a problem hiding this comment.
1 issue found across 14 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="web/main_js.go">
<violation number="1" location="web/main_js.go:134">
P2: When an `mc...` token is malformed, lacks a relay URL, or the browser lacks WebTransport, `BrowserMasqueClient.Ping` returns a permanent error immediately; `pingUntil` then retries it in a tight loop for 60 seconds. Stop retrying non-transient browser setup errors so the UI fails promptly.</violation>
</file>
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
|
|
||
| if strings.HasPrefix(addr, "mc") { | ||
| cl := tailcat.NewBrowserMasqueClient(tailcat.MasqueConnBlob(addr), priv, logf) | ||
| if err := pingUntil(ctx, cl.Ping); err != nil { |
There was a problem hiding this comment.
P2: When an mc... token is malformed, lacks a relay URL, or the browser lacks WebTransport, BrowserMasqueClient.Ping returns a permanent error immediately; pingUntil then retries it in a tight loop for 60 seconds. Stop retrying non-transient browser setup errors so the UI fails promptly.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At web/main_js.go, line 134:
<comment>When an `mc...` token is malformed, lacks a relay URL, or the browser lacks WebTransport, `BrowserMasqueClient.Ping` returns a permanent error immediately; `pingUntil` then retries it in a tight loop for 60 seconds. Stop retrying non-transient browser setup errors so the UI fails promptly.</comment>
<file context>
@@ -158,15 +126,30 @@ func tailcatDial(this js.Value, args []js.Value) any {
+
+ if strings.HasPrefix(addr, "mc") {
+ cl := tailcat.NewBrowserMasqueClient(tailcat.MasqueConnBlob(addr), priv, logf)
+ if err := pingUntil(ctx, cl.Ping); err != nil {
+ cl.Close()
+ return nil, err
</file context>
Summary
mainfrom failing because GitHub Pages is not enabledindex.html,app.js,wasm_exec.js,main.wasm.gz)workflow_dispatchconfigure-pagesinto the deploy-only jobWhy
The current
webdemo-pagesworkflow fails atactions/configure-pageswhenever the repository has not enabled GitHub Pages. That failure happens after the WebAssembly distribution has already built successfully, so the red check is deployment configuration noise rather than a WebAssembly regression.This keeps the useful WASM build/demo infrastructure while making Pages publishing opt-in. To publish the demo, enable Settings → Pages → Build and deployment → GitHub Actions once, then run
webdemo-pagesmanually.Scope
This does not change the browser transport yet. The existing browser demo still uses Tailcat's DERP/WebSocket path; MasqueCat WebTransport/MASQUE support should be implemented separately so transport changes can be reviewed and tested independently.
Summary by Sourcery
Keep browser WebAssembly demo CI independent of GitHub Pages availability and add authenticated WebTransport support for browser MasqueCat peers.
New Features:
Bug Fixes:
Enhancements:
Build:
CI:
Deployment:
Summary by cubic
Keeps the web demo CI build green when GitHub Pages isn't enabled, and adds an authenticated WebTransport path so browser peers can join MasqueCat relays.
CI
configure-pagesmoved into the deploy job, the build job verifies the static demo output, and workflow concurrency is scoped per branch.WebTransport
-web-originflag,ServeMasqueRelayreplacesServeMasque, andgithub.com/quic-go/webtransport-gowas added.mc...tokens route through the new browser client without a DERP map; legacytc...addresses stay on DERP/WebSocket.Written for commit e6c5c3a. Summary will update on new commits.