feat(#288): post-deploy @smoke suite + fix(#348) the CSS-as-script bug it caught#349
Merged
Conversation
… defect → #348) #288 item 2 — the missing post-deploy verification. Runs against the LIVE origin after each deploy (+ daily) and asserts the deployed product a customer touches works (the #287 gap: green tests, unusable prod). - tests/e2e/smoke/production.smoke.spec.ts + playwright.smoke.config.ts + .github/workflows/smoke.yml: read-only checks against prod — providers enabled (/auth/v1/settings), OAuth authorize redirects carry real non-placeholder client_ids (#287 detector, read from the live /auth/v1/authorize Location — no flaky provider nav), canonical origin serves + github.io 301s to the custom domain. Triggered on workflow_run after 'Deploy to GitHub Pages' (success) + daily cron + dispatch + PRs touching the suite. No build/serve — hits prod directly. - tests/e2e/utils/oauth-validity.ts: extracted assertValidOAuthClientId (was module-private in oauth-csrf.spec.ts) so the pre-merge E2E and the smoke share one source of truth for the #287 regexes. The suite immediately DID ITS JOB: the 'sign-in zero console errors' check caught a REAL live defect — /sign-in throws a browser-only 'Invalid or unexpected token' parse error (#294 SWC-octal class; the sloppy-mode build gate misses it). Filed as #348 (p1); that one check is SKIPPED (not deleted/allowlisted) with a link — delete the skip line to re-gate once #348 is fixed. Verified locally: 4 passed / 1 skipped against live prod; type-check + lint clean. Refs #288 (item 2). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… the smoke console check The @smoke suite (previous commit) caught a real, SITE-WIDE prod defect on its first run: Next.js 15 App-Router static export emits the same stylesheet BOTH as <link rel=stylesheet> AND as <script src="....css">. The browser runs the CSS as JS → 'SyntaxError: Invalid or unexpected token', partially breaking the client on 108/110 pages. The sloppy-mode check-chunks-parse gate misses it (JS-only), so it shipped green — the exact #287/#288 class. - scripts/strip-css-script-tags.mjs + package.json build: strip the bogus <script src="*.css"> from every exported HTML after 'next build' (the <link> stays). Verified: a fresh build removed 108 tags → 0 css-as-script in out/, stylesheets intact. - tests/e2e/smoke/production.smoke.spec.ts: UN-SKIP the 'sign-in zero console errors' check — it gates for real now (no skip, no allowlist). Passes once this deploys (prod actually fixed). - .github/workflows/smoke.yml: drop the pull_request trigger — a post-deploy monitor tests the DEPLOYED site, so it can't gate a PR whose fix isn't live yet; runs after Deploy + daily + dispatch. Closes #348. Refs #288. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jul 24, 2026
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.
What
#288, item 2 — the post-deploy production smoke suite: the missing verification that the deployed product works. #287 proved the whole suite can be green while prod is unusable. This runs against the live origin after each deploy (+ daily) and asserts the thing a customer touches — and on its very first run it caught a real production bug, which this PR also fixes.
Refs #288 (item 2). Closes #348.
It caught a real prod defect — and we fixed it (not muted it)
Run against live
scripthammer.com, the "sign-in loads with zero console errors" check went red on a genuine defect: the exported HTML emits the same stylesheet twice — correctly as<link rel="stylesheet">and wrongly as<script src="/_next/static/css/….css" async>. The browser fetches the CSS as a script →SyntaxError: Invalid or unexpected token, partially breaking the client on every page. The sloppy-modecheck-chunks-parse.mjsgate never saw it (it only parses JS chunks), so it shipped green — the exact #287/#288 class.This is a known Next.js 15 App-Router static-export bug. Fix (#348):
scripts/strip-css-script-tags.mjs, wired intopnpm buildafternext build, strips the bogus<script src="*.css">from every exported HTML file (the<link>stays, styling unaffected). Idempotent + logs the count, so a future Next upgrade that fixes it upstream shows0and the script can retire.No test was skipped or allowlisted — the console-error check gates, and it passes because prod is actually fixed.
The smoke checks (all gating)
GET /auth/v1/settings→external.{github,google,email}GET /auth/v1/authorize?provider=…maxRedirects:0→assertValidOAuthClientId(Location)/sign-in— caught #348github.io301s → custom domainStructure
tests/e2e/smoke/production.smoke.spec.ts+playwright.smoke.config.ts— dedicated config (noglobalSetup, nowebServer); excluded from the main config's projects.tests/e2e/utils/oauth-validity.ts— extractedassertValidOAuthClientId(was module-private inoauth-csrf.spec.ts) — one source of truth for the Production OAuth broken since the Supabase project migration: client IDs are placeholders (recurrence of #85, closed-but-never-fixed) #287 regexes..github/workflows/smoke.yml— triggers:workflow_runafter "Deploy to GitHub Pages" (success-guarded) + daily cron +workflow_dispatch. Nopull_request— a post-deploy monitor tests the deployed site, so it can't gate a PR (the PR's fix isn't live yet); it runs after this deploys, against the fixed site.scripts/strip-css-script-tags.mjs+package.jsonbuild— the prod /sign-in throws 'Invalid or unexpected token' — browser-only JS parse error (client-partial-dead, #294 SWC-octal class) #348 fix.Verified
<script src=css>, keeps all 3<link>s.out/) has 0<script src="*.css">after the strip; the strip logs the removed count.type-check+lintclean.Note for the owner
Canonical:
public/CNAME=wwwbut live traffic resolves to apex (github.io301s →scripthammer.com, apex serves 200). Works, but the CNAME/config mismatch is worth a glance.🤖 Generated with Claude Code