From f4f69c8a53c2fb8e549ebed01a39fe216b0bbfd9 Mon Sep 17 00:00:00 2001 From: Vijay Janapa Reddi Date: Tue, 28 Apr 2026 18:13:03 -0400 Subject: [PATCH] feat(ci): visual smoke gate before tinytorch dev deploy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds a Playwright-based smoke check that runs after the Quarto build and before the dev preview deploy. Catches the four classes of regression we just fixed in commit 6fdf81dd4: • 404s (broken site_libs/ deploy) • JS console errors during page load • Blank-page renders (homepage body shorter than 1.5× viewport) • Navbar collapse breakpoint drift across the shared chrome (asserts expanded at 1200/1400, collapsed at 992/1199 in light + dark) Layout follows the publish-guard pattern already in use: .github/scripts/visual_smoke.py — test logic, runnable locally against any Quarto _build/ tree .github/workflows/infra-visual-smoke.yml — workflow_call reusable that runs the script on an uploaded build artifact tinytorch-preview-dev.yml is split into three jobs: 1. build-site — builds Quarto, injects PDFs, uploads _build/ artifact 2. smoke — `uses:` the reusable; deploy is gated on this passing 3. deploy — downloads the same artifact (so we ship the exact bytes smoke validated) and SSH-pushes to the dev repo Verified locally: • script passes 8/8 (4 viewports × 2 schemes) on the fixed dev tip • script catches the regression: with collapse-below reverted to "lg" and re-rendered, smoke fails 4/8 with [NAVBAR_COLLAPSE_AT_XL] at exactly 992 + 1199 px in light + dark — the same widths a human would notice the wrap Other sites' preview-dev workflows are intentionally untouched. Once this proof-of-concept settles, copying the build-site/smoke/deploy split to labs/kits/mlsysim/site/etc. is mechanical (the reusable workflow doesn't change). A follow-up infra-visual-cross-site.yml will run nightly across every site in a matrix and add the cross-site consistency assertions. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/scripts/visual_smoke.py | 252 ++++++++++++++++++++ .github/workflows/infra-visual-smoke.yml | 103 ++++++++ .github/workflows/tinytorch-preview-dev.yml | 47 +++- 3 files changed, 398 insertions(+), 4 deletions(-) create mode 100755 .github/scripts/visual_smoke.py create mode 100644 .github/workflows/infra-visual-smoke.yml diff --git a/.github/scripts/visual_smoke.py b/.github/scripts/visual_smoke.py new file mode 100755 index 0000000000..a1d83eeab9 --- /dev/null +++ b/.github/scripts/visual_smoke.py @@ -0,0 +1,252 @@ +#!/usr/bin/env python3 +# ============================================================================= +# Visual Smoke Test — Quarto site rendering sanity check +# ============================================================================= +# Runs four cheap assertions against a built _build/ directory, at four +# viewport widths × light + dark color schemes, on each --page passed in: +# +# 1. STYLESHEETS_RESOLVE — every returns 200. +# Catches the site_libs/ deploy regression that left mlsysbook.ai/about/ +# shipping a raw