Preserve prebuilt dist during release gate (#210)

## Summary

- serve the release workflow's already-built `dist` from the production
Playwright gate
- preserve the existing auto-build behavior for standalone local
production tests
- keep the pre/post `dist` inventory guard strict and unchanged

## Root cause

The release workflow built and fingerprinted `dist`, but Playwright then
launched `preview:prod`, which ran a second Vite build. Timestamped
build metadata changed hashed chunks and caused the integrity comparison
to fail after all 26 production browser tests had passed.

## Verification

- production Playwright gate: 26/26 passed
- pre/post inventory: 735 files, zero changes
- release package validation: 735 files passed
- ESLint passed
- Prettier passed
- release package unit tests: 7/7 passed
- workflow YAML parsed successfully
- no test files changed

Co-authored-by: Jeppe Bundgaard <jb@truckwash.dk>
This commit is contained in:
Jeppe B
2026-07-21 15:23:41 +00:00
committed by GitHub
co-authored by Jeppe Bundgaard
parent de3f067372
commit 0692cb3aea
2 changed files with 7 additions and 1 deletions
+1
View File
@@ -111,6 +111,7 @@ jobs:
if: steps.branch-head.outputs.current == 'true' if: steps.branch-head.outputs.current == 'true'
run: npm run test:e2e:prod run: npm run test:e2e:prod
env: env:
PLAYWRIGHT_PROD_PREBUILT: "1"
PLAYWRIGHT_PROD_WEBKIT: "0" PLAYWRIGHT_PROD_WEBKIT: "0"
- name: Confirm production gate did not mutate dist - name: Confirm production gate did not mutate dist
+6 -1
View File
@@ -3,6 +3,11 @@ import { defineConfig, devices } from "@playwright/test";
const baseURL = "http://127.0.0.1:4173"; const baseURL = "http://127.0.0.1:4173";
const isCI = !!process.env.CI; const isCI = !!process.env.CI;
const usePrebuiltDist = ["1", "true"].includes(
String(process.env.PLAYWRIGHT_PROD_PREBUILT || "")
.trim()
.toLowerCase()
);
process.env.PLAYWRIGHT_BASE_URL = baseURL; process.env.PLAYWRIGHT_BASE_URL = baseURL;
@@ -73,7 +78,7 @@ export default defineConfig({
video: "retain-on-failure", video: "retain-on-failure",
}, },
webServer: { webServer: {
command: "npm run preview:prod", command: usePrebuiltDist ? "npm run preview -- --host 127.0.0.1 --port 4173" : "npm run preview:prod",
url: baseURL, url: baseURL,
timeout: 240_000, timeout: 240_000,
reuseExistingServer: !isCI, reuseExistingServer: !isCI,