You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
New workflow test-cli-templates.yml + checker scripts/test-cli-templates.ts. For every template in packages/typegpu-cli/templates (the list is read from the folder): scaffold with the CLI, npm install, check, build, types, then load the production build and the dev server in headless Chrome (WebGPU on SwiftShader). Fails on console errors, page errors, failed requests and WebGPU validation errors.
PRs / merge queue: the CLI and packages are built from the checkout and packed, so the template is tested against the PR's code, not the last npm release.
Weekly + manual:@typegpu/cli@latest against whatever npm serves today (templates use caret ranges, so third-party releases can break them).
Self-test: plants 5 bugs (including an app that never creates a WebGPU device) and requires the checker to report each one for its own reason. Runs only when the checker changes, weekly and on demand.
Whole PR run takes ~5 min.
Known limits:
Expo: install, check and types only (no build script, no browser).
Only npm as the package manager.
Presenting a canvas frame kills WebGPU in headless Chrome + SwiftShader on hosted runners, so the canvas texture is replaced by an ordinary one: shaders and pipelines run and are validated, frames on screen aren't.
Scaffolds every @typegpu/cli template, installs it, runs check, build and
types, then loads the production build and the dev server in headless Chrome
(WebGPU on SwiftShader) and fails on console, page and WebGPU errors.
PRs test the CLI and packages built from the checkout (packed tarballs);
a weekly run tests the published CLI against what npm serves today.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The checks can pass without detecting the injected bug or initializing WebGPU, and a stalled readiness request can exceed the advertised 60-second deadline.
Adds CI validation for CLI-generated templates, covering checkout-built packages and published releases to catch scaffolding, dependency, build, and browser regressions.
Changes:
Discovers templates automatically and checks installation, linting/formatting, builds, and types.
Exercises production and development servers in headless Chrome with WebGPU validation.
Adds scheduled published-package checks, injected-error self-tests, and diagnostic artifacts.
File
Description
scripts/test-cli-templates.ts
Implements scaffolding, package overrides, browser validation, error injection, and reporting.
.github/workflows/test-cli-templates.yml
Orchestrates package builds, template matrices, scheduled checks, and self-tests.
The reason will be displayed to describe this comment to others. Learn more.
ℹ️ Minor suggestions only — the checker itself holds up. The notes below are about how much confidence the self-test actually buys and about the weekly-run gap the PR already flags.
Reviewed changes
scripts/test-cli-templates.ts (new) — scaffolds one template with @typegpu/cli, installs it (optionally rewriting deps to packed tarballs via npm overrides, plus a lockfile guard that every packed name resolved from file:), runs check/build/types, then serves the production build and the dev server and loads each in headless Chrome with console/page/HTTP/WebGPU error capture. The canvas texture is swapped for a plain texture and rAF is throttled by onSubmittedWorkDone(), since presenting a frame breaks WebGPU on SwiftShader.
.github/workflows/test-cli-templates.yml (new) — discovers templates from packages/typegpu-cli/templates, builds and packs the workspace, runs one job per template against the checkout, a weekly @typegpu/cli@latest job, and a four-bug checker self-test gated on changes to the checker.
I verified the checker end to end from this checkout: packed typegpu, unplugin-typegpu and @typegpu/cli, then ran vite-bare with Chrome 156 on SwiftShader. The tarball install guard, check/build/types, both serve modes and both browser passes succeeded, and all four --inject bugs failed in browser-production with the expected problem text. oxfmt --check and type-aware oxlint are clean on the new script; actionlint reports only a shellcheck info about ls.
( ◦°^°◦) 🏴☠️ I read every line o' the diff and sailed the checker through a real packed-CLI run, canvas an' all.
ℹ️ The weekly run has no notification path
The schedule trigger is the only early warning for third-party breakage of the templates, but a red weekly run notifies nobody, so it will go stale unnoticed (the PR body raises this too).
Technical details
# Schedule failures need an owner## Affected sites-`.github/workflows/test-cli-templates.yml:31-32` — `schedule` cron with no failure handling.
## Required outcome- A failed scheduled run reaches a person or a tracked issue instead of only the Actions tab.
## Suggested approach- Add a final job with `if: failure() && github.event_name == 'schedule'` that opens or updates a GitHub issue (or reuses whatever notification path other workflows use), and name the owner in the workflow comment.
- The self-test requires each planted bug to be reported for its own reason,
not just any browser failure.
- Fail when the app never creates a WebGPU device (a page whose script never
ran used to pass), with a `no-device` self-test for it.
- Bound each readiness request by the 60 s deadline.
The reason will be displayed to describe this comment to others. Learn more.
✅ No new issues found.
Reviewed changes
Added a no-device self-test case that replaces the scaffolded entry module with export {} and requires the browser pass to report the missing device.
Replaced the self-test's "first failing step is browser-*" assertion with a per-bug expected problem prefix, so each planted bug must be caught for its own reason.
Added an info.devices === 0 check to the browser pass, so a page that loads without errors but never initializes WebGPU fails instead of passing silently.
Bounded the server readiness fetch with AbortSignal.timeout(...), so a server that accepts the connection but never answers cannot outlive the 60-second deadline.
I checked the new expectation against Chrome 156 on SwiftShader: an invalid shader module produces uncapturederror: Error while parsing WGSL: :1:1 error: unexpected token ..., which matches the WebGPU uncapturederror: Error while parsing WGSL prefix. The checker-self-test jobs for all five bugs, including no-device, passed on this head.
( ◦°^°◦) 🏴☠️ I re-checked the fresh commits from stem to stern and found no new leaks in the hull.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The checker can mask WebGPU validation errors by expanding texture usage and miss same-origin transport failures because it lacks a requestfailed listener.
No open issues 🎉
2 previously missed issues
In code that hasn't changed since last review
Preserve configured texture usage in CI
scripts/test-cli-templates.ts:487
Adding TEXTURE_BINDING and COPY_SRC to the replacement texture makes operations valid in CI that would fail on the real canvas, such as copying from a canvas configured with only the default RENDER_ATTACHMENT usage. This masks WebGPU validation errors that the checker is meant to catch. Preserve the configured usage without granting additional capabilities.
Report failed same-origin requests
scripts/test-cli-templates.ts:544
The response event only covers requests that receive an HTTP response; transport failures and aborted requests emit requestfailed instead. A failed same-origin request whose rejection is handled without logging can therefore leave this check green. Add a same-origin requestfailed listener that records the URL and failure reason, and extend the local Page interface accordingly.
Thanks for this work!
A few things I'd try to do differently before we merge:
I think using parseArgs from node:util would reduce the custom helpers, and improve the strictness of the args (it throws when an unknown arg was passed in)
Instead of keeping failed global boolean and if guarding on each step, could we use throw, try and catch? We set the global flag and return anyway.
This branch has not been deployed
No deployments
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
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.
Closes #3299
New workflow
test-cli-templates.yml+ checkerscripts/test-cli-templates.ts. For every template inpackages/typegpu-cli/templates(the list is read from the folder): scaffold with the CLI,npm install,check,build,types, then load the production build and the dev server in headless Chrome (WebGPU on SwiftShader). Fails on console errors, page errors, failed requests and WebGPU validation errors.@typegpu/cli@latestagainst whatever npm serves today (templates use caret ranges, so third-party releases can break them).Whole PR run takes ~5 min.
Known limits:
checkandtypesonly (nobuildscript, no browser).vite-reactdev logs a React 19.3use()error (fix(@typegpu/react):useRootwithout a Suspense boundary logs a React 19.3use()error #3353); ignored explicitly until the fix is released.To decide:
packages/**would wait forever).-yalways runsnpx skills add; the checker removes its output. A--skip-skillsflag in the CLI would be cleaner.