Skip to content

Commit 0c6c631

Browse files
committed
fix(website): verify stage against matching production replay
1 parent d8d5951 commit 0c6c631

3 files changed

Lines changed: 20 additions & 5 deletions

File tree

.github/workflows/ci.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -679,23 +679,29 @@ jobs:
679679
# Spec §8: scroll-craft's own harness walks the homepage's pinned stage
680680
# act and fails on dead scroll outside the declared hold and on cues that
681681
# never peak. The Nx build lands in dist/apps/website with a rewritten
682-
# next.config, which only `nx serve --configuration=production` can
683-
# start, and the serve's own build dependency is the one build here:
684-
# it runs with --skip-nx-cache (the earlier e2e builds wrote no cache
685-
# entry either) so it emits dist rather than restoring it. The content
682+
# next.config, which `nx serve --configuration=production` starts.
683+
# Rebuild explicitly with the paired stage origin: serve reuses the
684+
# prior output, whose public-copy build points at production. The content
686685
# symlink, which mirrors playwright.config.ts's production mode, is
687686
# added only after the server answers, so it lands on the dist the
688687
# build has finished writing rather than on one it is about to replace.
689688
- name: Stage scroll verification (scroll-craft harness)
690689
env:
691690
GROWTH_FORM_POLICY: growth_v1
692691
SCROLLCRAFT_CHROME: /usr/bin/google-chrome
692+
NEXT_PUBLIC_STAGE_DEMO_ORIGIN: http://localhost:4200
693693
run: |
694694
command -v ffmpeg > /dev/null || (sudo apt-get update && sudo apt-get install -y ffmpeg)
695+
# Verify this commit's recording, not the older production demo.
696+
(npx nx serve examples-chat-angular --configuration=production --port=4200 > /tmp/stage-demo.log 2>&1 &)
697+
for i in $(seq 1 60); do curl -sf http://localhost:4200/stage > /dev/null && break; sleep 2; done
698+
curl -sf http://localhost:4200/stage > /dev/null || { cat /tmp/stage-demo.log; exit 1; }
699+
npx nx build website --configuration=production --skip-nx-cache
695700
(npx nx serve website --configuration=production --port=4308 --skip-nx-cache > /tmp/next-start.log 2>&1 &)
696701
for i in $(seq 1 60); do curl -sf http://127.0.0.1:4308/ > /dev/null && break; sleep 2; done
697702
curl -sf http://127.0.0.1:4308/ > /dev/null || { cat /tmp/next-start.log; exit 1; }
698703
ln -sfn ../../../apps/website/content dist/apps/website/content
704+
STAGE_LIVE_FRAME=true BASE_URL=http://127.0.0.1:4308 npx playwright test apps/website/e2e/home-stage.spec.ts --config apps/website/playwright.config.ts
699705
node apps/website/e2e/scroll-craft/verify-home.mjs --url http://127.0.0.1:4308 --out dist/stage-shots
700706
- name: Upload stage contact sheets
701707
if: always()

apps/website/src/components/landing/use-stage-publisher.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
export type { StageMilestone } from '../../lib/stage-beats';
1717

1818
export const STAGE_DEMO_ORIGIN = new URL(
19-
process.env['NEXT_PUBLIC_STAGE_DEMO_ORIGIN'] || 'https://demo.threadplane.ai'
19+
process.env.NEXT_PUBLIC_STAGE_DEMO_ORIGIN || 'https://demo.threadplane.ai'
2020
).origin;
2121
export const STAGE_DEMO_URL = `${STAGE_DEMO_ORIGIN}/stage?t=0`;
2222
export const STAGE_MESSAGE_TYPE = 'tplane-stage';

scripts/ci-workflow.spec.mjs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,15 @@ function readNamedStep(job, name) {
7878
}
7979

8080
describe('CI workflow', () => {
81+
it('verifies stage scrolling and interaction against the matching local replay build', async () => {
82+
const workflow = await readFile('.github/workflows/ci.yml', 'utf8');
83+
const step = readNamedStep(readJobBlock(workflow, 'website-e2e'), 'Stage scroll verification (scroll-craft harness)');
84+
assert.match(step, /NEXT_PUBLIC_STAGE_DEMO_ORIGIN: http:\/\/localhost:4200/);
85+
assert.match(step, /nx serve examples-chat-angular --configuration=production --port=4200/);
86+
assert.match(step, /nx build website --configuration=production --skip-nx-cache/);
87+
assert.match(step, /STAGE_LIVE_FRAME=true BASE_URL=http:\/\/127\.0\.0\.1:4308/);
88+
assert.match(step, /scroll-craft\/verify-home\.mjs/);
89+
});
8190
it('scopes every vercel promote to the team that owns the deployment', async () => {
8291
const workflow = await readFile('.github/workflows/ci.yml', 'utf8');
8392
const promotes = workflow

0 commit comments

Comments
 (0)