Compare commits
19 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5c068ace81 | |||
| f4397db869 | |||
| 9e5c5abbdf | |||
| 8b949484c1 | |||
| 9887a5958a | |||
| cc6b376f56 | |||
| cfa3d426a0 | |||
| f7c6681c47 | |||
| b76642e06d | |||
| 2570ea13bd | |||
| d316b0de03 | |||
| 2a324c4d19 | |||
| 628449735b | |||
| 7dca4495bb | |||
| 30ac83cd85 | |||
| aa3c0cf11d | |||
| ada5338af5 | |||
| a3935c5adc | |||
| abc6eafd0c |
@@ -11,10 +11,29 @@ on:
|
|||||||
- 'scripts/integration.sh'
|
- 'scripts/integration.sh'
|
||||||
- 'scripts/cleanup-integration.sh'
|
- 'scripts/cleanup-integration.sh'
|
||||||
- 'scripts/test-integration-cleanup.py'
|
- 'scripts/test-integration-cleanup.py'
|
||||||
|
- 'scripts/cleanup-review-images.sh'
|
||||||
|
- 'scripts/test-review-image-cleanup.py'
|
||||||
concurrency:
|
concurrency:
|
||||||
group: creative-workspace-${{ gitea.event.pull_request.number }}
|
group: creative-workspace-${{ gitea.event.pull_request.number }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
jobs:
|
jobs:
|
||||||
|
verify-deployed-canvas:
|
||||||
|
runs-on: ces-control
|
||||||
|
timeout-minutes: 10
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Verify canvas acceptance script against the designated deployed server
|
||||||
|
run: |
|
||||||
|
node --check apps/studio/scripts/infinite-canvas-smoke.cjs
|
||||||
|
wiki_image=$(docker inspect --format '{{.Config.Image}}' prompt-waterfall-wiki-1)
|
||||||
|
[[ "$wiki_image" =~ ^waterfall-wiki:[0-9a-f]{40}$ ]]
|
||||||
|
test_image="waterfall-wiki-tests:${wiki_image#waterfall-wiki:}"
|
||||||
|
docker image inspect "$test_image" >/dev/null
|
||||||
|
docker run --rm \
|
||||||
|
--mount "type=bind,src=$PWD,dst=/delivery,readonly" \
|
||||||
|
-e NODE_PATH=/repo/apps/waterfall-wiki/node_modules \
|
||||||
|
-e CHROMIUM_PATH=/usr/bin/chromium \
|
||||||
|
--entrypoint node "$test_image" /delivery/apps/studio/scripts/infinite-canvas-smoke.cjs
|
||||||
verify:
|
verify:
|
||||||
runs-on: ces-control
|
runs-on: ces-control
|
||||||
timeout-minutes: 60
|
timeout-minutes: 60
|
||||||
@@ -25,8 +44,11 @@ jobs:
|
|||||||
- name: Check patch formatting
|
- name: Check patch formatting
|
||||||
run: |
|
run: |
|
||||||
git diff --check HEAD^ HEAD
|
git diff --check HEAD^ HEAD
|
||||||
bash -n scripts/integration.sh scripts/cleanup-integration.sh
|
bash -n scripts/integration.sh scripts/cleanup-integration.sh scripts/verify-studio-production.sh scripts/cleanup-review-images.sh
|
||||||
|
node --check scripts/verify-studio-visual.cjs
|
||||||
python3 scripts/test-integration-cleanup.py
|
python3 scripts/test-integration-cleanup.py
|
||||||
|
python3 scripts/test-review-image-cleanup.py
|
||||||
|
node --test apps/waterfall-wiki/tests/brand-navigation.test.mjs
|
||||||
- name: Verify Studio types, tests, build and smoke
|
- name: Verify Studio types, tests, build and smoke
|
||||||
run: docker build -f apps/studio/Dockerfile -t "creative-studio-review:${{ gitea.sha }}" .
|
run: docker build -f apps/studio/Dockerfile -t "creative-studio-review:${{ gitea.sha }}" .
|
||||||
- name: Build Wiki integration and runtime images
|
- name: Build Wiki integration and runtime images
|
||||||
@@ -45,3 +67,8 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
GITEA_RUN_ID: ${{ gitea.run_id }}
|
GITEA_RUN_ID: ${{ gitea.run_id }}
|
||||||
run: bash scripts/cleanup-integration.sh
|
run: bash scripts/cleanup-integration.sh
|
||||||
|
- name: Remove this run disposable review image tags
|
||||||
|
if: always()
|
||||||
|
env:
|
||||||
|
REVIEW_SHA: ${{ gitea.sha }}
|
||||||
|
run: bash scripts/cleanup-review-images.sh
|
||||||
|
|||||||
+3
-3
@@ -13,9 +13,8 @@ RUN corepack enable && corepack prepare pnpm@11.25.0 --activate
|
|||||||
COPY apps/waterfall-wiki/pnpm-lock.yaml ./
|
COPY apps/waterfall-wiki/pnpm-lock.yaml ./
|
||||||
COPY pnpm-workspace.yaml /repo/pnpm-workspace.yaml
|
COPY pnpm-workspace.yaml /repo/pnpm-workspace.yaml
|
||||||
COPY packages/brand/ /repo/packages/brand/
|
COPY packages/brand/ /repo/packages/brand/
|
||||||
RUN pnpm --ignore-workspace fetch --frozen-lockfile --fetch-timeout=300000 --network-concurrency=8
|
|
||||||
COPY apps/waterfall-wiki/package.json ./
|
COPY apps/waterfall-wiki/package.json ./
|
||||||
RUN pnpm --filter @prompt/waterfall-wiki install --offline --frozen-lockfile
|
RUN pnpm --filter @prompt/waterfall-wiki install --frozen-lockfile --fetch-timeout=300000 --network-concurrency=8
|
||||||
|
|
||||||
FROM dependencies AS build
|
FROM dependencies AS build
|
||||||
# .dockerignore excludes docs and operational notes without extra legacy COPY snapshots.
|
# .dockerignore excludes docs and operational notes without extra legacy COPY snapshots.
|
||||||
@@ -27,9 +26,10 @@ USER node
|
|||||||
CMD ["npm", "run", "test:integration"]
|
CMD ["npm", "run", "test:integration"]
|
||||||
|
|
||||||
FROM base AS runtime
|
FROM base AS runtime
|
||||||
|
WORKDIR /app/apps/waterfall-wiki
|
||||||
ENV NODE_ENV=production HOSTNAME=0.0.0.0 PORT=3000 \
|
ENV NODE_ENV=production HOSTNAME=0.0.0.0 PORT=3000 \
|
||||||
FFMPEG_PATH=/usr/bin/ffmpeg FFPROBE_PATH=/usr/bin/ffprobe
|
FFMPEG_PATH=/usr/bin/ffmpeg FFPROBE_PATH=/usr/bin/ffprobe
|
||||||
COPY --from=build --chown=node:node /repo/apps/waterfall-wiki/.next/standalone/ ./
|
COPY --from=build --chown=node:node /repo/apps/waterfall-wiki/.next/standalone/ /app/
|
||||||
COPY --from=build --chown=node:node /repo/apps/waterfall-wiki/dist/worker.cjs /repo/apps/waterfall-wiki/dist/bootstrap.cjs /repo/apps/waterfall-wiki/dist/publish-learning-series.cjs /repo/apps/waterfall-wiki/dist/auth-cli.cjs ./
|
COPY --from=build --chown=node:node /repo/apps/waterfall-wiki/dist/worker.cjs /repo/apps/waterfall-wiki/dist/bootstrap.cjs /repo/apps/waterfall-wiki/dist/publish-learning-series.cjs /repo/apps/waterfall-wiki/dist/auth-cli.cjs ./
|
||||||
COPY --from=build --chown=node:node /repo/apps/waterfall-wiki/db/ ./db/
|
COPY --from=build --chown=node:node /repo/apps/waterfall-wiki/db/ ./db/
|
||||||
COPY --chown=node:node apps/waterfall-wiki/scripts/container-health.mjs ./
|
COPY --chown=node:node apps/waterfall-wiki/scripts/container-health.mjs ./
|
||||||
|
|||||||
@@ -4,9 +4,8 @@ RUN corepack enable && corepack prepare pnpm@11.25.0 --activate
|
|||||||
COPY apps/studio/pnpm-lock.yaml ./
|
COPY apps/studio/pnpm-lock.yaml ./
|
||||||
COPY pnpm-workspace.yaml /repo/pnpm-workspace.yaml
|
COPY pnpm-workspace.yaml /repo/pnpm-workspace.yaml
|
||||||
COPY packages/brand/ /repo/packages/brand/
|
COPY packages/brand/ /repo/packages/brand/
|
||||||
RUN pnpm --ignore-workspace fetch --frozen-lockfile --fetch-timeout=300000 --network-concurrency=8
|
|
||||||
COPY apps/studio/package.json ./
|
COPY apps/studio/package.json ./
|
||||||
RUN pnpm --filter @prompt/studio install --offline --frozen-lockfile
|
RUN pnpm --filter @prompt/studio install --frozen-lockfile --fetch-timeout=300000 --network-concurrency=8
|
||||||
COPY apps/studio/ .
|
COPY apps/studio/ .
|
||||||
# Compare the two public parameter validators inside the isolated CI build.
|
# Compare the two public parameter validators inside the isolated CI build.
|
||||||
COPY apps/waterfall-wiki/src/lib/layout-parameters.ts /repo/apps/waterfall-wiki/src/lib/layout-parameters.ts
|
COPY apps/waterfall-wiki/src/lib/layout-parameters.ts /repo/apps/waterfall-wiki/src/lib/layout-parameters.ts
|
||||||
@@ -14,9 +13,9 @@ COPY apps/waterfall-wiki/src/lib/series.ts /repo/apps/waterfall-wiki/src/lib/ser
|
|||||||
COPY apps/waterfall-wiki/src/lib/canvas-document.ts /repo/apps/waterfall-wiki/src/lib/canvas-document.ts
|
COPY apps/waterfall-wiki/src/lib/canvas-document.ts /repo/apps/waterfall-wiki/src/lib/canvas-document.ts
|
||||||
RUN pnpm typecheck && pnpm test && pnpm build && pnpm test:smoke
|
RUN pnpm typecheck && pnpm test && pnpm build && pnpm test:smoke
|
||||||
FROM node:24-bookworm-slim
|
FROM node:24-bookworm-slim
|
||||||
WORKDIR /app
|
WORKDIR /app/apps/studio
|
||||||
ENV NODE_ENV=production HOSTNAME=0.0.0.0 PORT=3000
|
ENV NODE_ENV=production HOSTNAME=0.0.0.0 PORT=3000
|
||||||
COPY --from=build --chown=node:node /repo/apps/studio/.next/standalone/ ./
|
COPY --from=build --chown=node:node /repo/apps/studio/.next/standalone/ /app/
|
||||||
COPY --from=build --chown=node:node /repo/apps/studio/.next/static/ ./.next/static/
|
COPY --from=build --chown=node:node /repo/apps/studio/.next/static/ ./.next/static/
|
||||||
COPY --from=build --chown=node:node /repo/apps/studio/public/ ./public/
|
COPY --from=build --chown=node:node /repo/apps/studio/public/ ./public/
|
||||||
USER node
|
USER node
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { resolve } from "node:path";
|
||||||
import type { NextConfig } from "next";
|
import type { NextConfig } from "next";
|
||||||
const config: NextConfig = { basePath: "/studio", output: "standalone", outputFileTracingRoot: process.cwd(), poweredByHeader: false };
|
const config: NextConfig = { turbopack: { root: resolve(process.cwd(), "../..") }, basePath: "/studio", output: "standalone", outputFileTracingRoot: resolve(process.cwd(), "../.."), poweredByHeader: false };
|
||||||
export default config;
|
export default config;
|
||||||
|
|||||||
@@ -20,7 +20,9 @@ const fs=require('node:fs/promises');
|
|||||||
async function unobstructed(id){const box=await node(id).boundingBox();assert.ok(box);for(const card of (await snapshot()).cards.filter(n=>n.id!==id)){const other=await node(card.id).boundingBox();assert.ok(other);assert.equal(box.x<other.x+other.width&&box.x+box.width>other.x&&box.y<other.y+other.height&&box.y+box.height>other.y,false,`${id} overlaps ${card.id}`)}}
|
async function unobstructed(id){const box=await node(id).boundingBox();assert.ok(box);for(const card of (await snapshot()).cards.filter(n=>n.id!==id)){const other=await node(card.id).boundingBox();assert.ok(other);assert.equal(box.x<other.x+other.width&&box.x+box.width>other.x&&box.y<other.y+other.height&&box.y+box.height>other.y,false,`${id} overlaps ${card.id}`)}}
|
||||||
const close=(a,b)=>assert.ok(Math.abs(a-b)<2,`${a} ≈ ${b}`);
|
const close=(a,b)=>assert.ok(Math.abs(a-b)<2,`${a} ≈ ${b}`);
|
||||||
async function drag(handle,dx,dy){const b=await handle.boundingBox();assert.ok(b);await page.mouse.move(b.x+b.width/2,b.y+b.height/2);await page.mouse.down();await page.mouse.move(b.x+b.width/2+dx,b.y+b.height/2+dy,{steps:12});await page.mouse.up()}
|
async function drag(handle,dx,dy){const b=await handle.boundingBox();assert.ok(b);await page.mouse.move(b.x+b.width/2,b.y+b.height/2);await page.mouse.down();await page.mouse.move(b.x+b.width/2+dx,b.y+b.height/2+dy,{steps:12});await page.mouse.up()}
|
||||||
await page.goto(base+'/infinite_canvas');
|
const canvasResponse=await page.goto(base+'/infinite_canvas',{waitUntil:'commit',timeout:60000});
|
||||||
|
assert.ok(canvasResponse?.ok(),'Canvas document returns HTTP success');
|
||||||
|
await page.locator('button[data-theme-ready="true"]').waitFor();
|
||||||
await page.getByRole('button',{name:'从示例开始 ↗',exact:true}).click();
|
await page.getByRole('button',{name:'从示例开始 ↗',exact:true}).click();
|
||||||
await page.getByRole('button',{name:'适应画布',exact:true}).click();
|
await page.getByRole('button',{name:'适应画布',exact:true}).click();
|
||||||
await content('brief').click({position:{x:20,y:20}});
|
await content('brief').click({position:{x:20,y:20}});
|
||||||
@@ -99,12 +101,28 @@ const fs=require('node:fs/promises');
|
|||||||
const anchorBefore=await worldAt();await page.mouse.move(1450,150);await page.keyboard.down('Control');await page.mouse.wheel(0,-80);await page.keyboard.up('Control');
|
const anchorBefore=await worldAt();await page.mouse.move(1450,150);await page.keyboard.down('Control');await page.mouse.wheel(0,-80);await page.keyboard.up('Control');
|
||||||
await page.waitForFunction(z=>new DOMMatrix(getComputedStyle(document.querySelector('[class*=world]')).transform).a!==z,anchorBefore.z);
|
await page.waitForFunction(z=>new DOMMatrix(getComputedStyle(document.querySelector('[class*=world]')).transform).a!==z,anchorBefore.z);
|
||||||
const anchorAfter=await worldAt();close(anchorBefore.x,anchorAfter.x);close(anchorBefore.y,anchorAfter.y);
|
const anchorAfter=await worldAt();close(anchorBefore.x,anchorAfter.x);close(anchorBefore.y,anchorAfter.y);
|
||||||
const saved=await snapshot();await page.reload();await page.waitForFunction(()=>!!localStorage.getItem('studio.infinite-canvas.v1'));assert.deepEqual(await snapshot(),saved);
|
const saved=await snapshot();await page.reload({waitUntil:'commit',timeout:60000});await page.locator('button[data-theme-ready="true"]').waitFor();await page.waitForFunction(()=>!!localStorage.getItem('studio.infinite-canvas.v1'));assert.deepEqual(await snapshot(),saved);
|
||||||
await page.getByRole('button',{name:'切换明暗主题',exact:true}).click();await page.reload();await page.waitForFunction(()=>document.querySelector('main').dataset.theme==='light');
|
const themeToggle=page.getByRole('button',{name:'切换明暗主题',exact:true});
|
||||||
|
await page.waitForFunction(()=>document.querySelector('[data-theme-ready]')?.dataset.themeReady==='true');
|
||||||
|
const initialMode=await page.evaluate(()=>document.documentElement.dataset.mode);
|
||||||
|
assert.ok(['light','dark'].includes(initialMode));
|
||||||
|
for(const mode of [initialMode==='light'?'dark':'light',initialMode]){
|
||||||
|
await themeToggle.click();
|
||||||
|
const matchesTheme=mode=>{
|
||||||
|
const root=document.documentElement,canvas=document.querySelector('main');
|
||||||
|
return root.dataset.mode===mode&&root.dataset.theme===`canvas-${mode}`&&localStorage.getItem('endoleap.theme')===mode&&getComputedStyle(canvas).backgroundColor===(mode==='dark'?'rgb(20, 20, 20)':'rgb(250, 250, 250)');
|
||||||
|
};
|
||||||
|
await page.waitForFunction(matchesTheme,mode);
|
||||||
|
await page.reload({waitUntil:'commit'});
|
||||||
|
await page.waitForFunction(()=>document.querySelector('[data-theme-ready]')?.dataset.themeReady==='true');
|
||||||
|
await page.waitForFunction(matchesTheme,mode);
|
||||||
|
assert.deepEqual(await snapshot(),saved,'Theme changes must preserve canvas content');
|
||||||
|
await capture('canvas-theme-'+mode);
|
||||||
|
}
|
||||||
if(process.env.SCREENSHOT_DIR){await fs.mkdir(process.env.SCREENSHOT_DIR,{recursive:true});await page.screenshot({path:process.env.SCREENSHOT_DIR+'/canvas-nodes-desktop.png'});}
|
if(process.env.SCREENSHOT_DIR){await fs.mkdir(process.env.SCREENSHOT_DIR,{recursive:true});await page.screenshot({path:process.env.SCREENSHOT_DIR+'/canvas-nodes-desktop.png'});}
|
||||||
await page.setViewportSize({width:390,height:844});assert.ok(await page.evaluate(()=>document.documentElement.scrollWidth<=innerWidth));
|
await page.setViewportSize({width:390,height:844});assert.ok(await page.evaluate(()=>document.documentElement.scrollWidth<=innerWidth));
|
||||||
const viewport=await page.locator('[class*=viewport]').boundingBox();assert.equal(viewport.width,390);assert.equal(viewport.height,844);
|
const viewport=await page.locator('[class*=viewport]').boundingBox();assert.equal(viewport.width,390);assert.equal(viewport.height,844);
|
||||||
if(process.env.SCREENSHOT_DIR)await page.screenshot({path:process.env.SCREENSHOT_DIR+'/canvas-nodes-mobile.png'});
|
if(process.env.SCREENSHOT_DIR)await page.screenshot({path:process.env.SCREENSHOT_DIR+'/canvas-nodes-mobile.png'});
|
||||||
assert.deepEqual(errors,[]);console.log('Passed: selected-node re-click editing, drag, formatting, fixed composer, upload, references, task export, deletion/undo, reload and mobile bounds');
|
assert.deepEqual(errors,[]);console.log('Passed: selected-node re-click editing, drag, formatting, fixed composer, upload, references, task export, deletion/undo, reload, both persistent root themes and mobile bounds');
|
||||||
}catch(error){if(process.env.SCREENSHOT_DIR&&page){await fs.mkdir(process.env.SCREENSHOT_DIR,{recursive:true});await page.screenshot({path:process.env.SCREENSHOT_DIR+'/canvas-failure.png'}).catch(()=>{})}throw error}finally{await browser.close()}
|
}catch(error){if(process.env.SCREENSHOT_DIR&&page){await fs.mkdir(process.env.SCREENSHOT_DIR,{recursive:true});await page.screenshot({path:process.env.SCREENSHOT_DIR+'/canvas-failure.png'}).catch(()=>{})}throw error}finally{await browser.close()}
|
||||||
})().catch(e=>{console.error(e);process.exitCode=1});
|
})().catch(e=>{console.error(e);process.exitCode=1});
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ const assetId='00000000-0000-4000-8000-000000000005';doc.sources=[{assetId,autho
|
|||||||
let reads=0,mediaReads=0;
|
let reads=0,mediaReads=0;
|
||||||
const wiki=createHttpServer((req,res)=>{assert.equal(req.headers.cookie,'session=smoke-test');if(/^\/api\/media\/[0-9a-f-]{36}$/.test(req.url)){mediaReads++;res.setHeader('Content-Type','image/png');return res.end(Buffer.from('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+j3ioAAAAASUVORK5CYII=','base64'))}reads++;res.setHeader('Content-Type','application/json');if(req.url.endsWith(seriesId))return res.end(JSON.stringify({design:{id:seriesId,name:'完整三页作品',layoutId:'standard-01',revision:1,url:'/studio/template-layout?id='+seriesId,parameters:doc.pages[0].parameters,document:doc}}));const standard=req.url.endsWith(standardId);if(!standard&&!req.url.endsWith(designId)){res.writeHead(404);return res.end('{}')}res.end(JSON.stringify({design:{id:standard?standardId:designId,name:'已保存的实际页面',layoutId:standard?'standard-01':'ref-01',revision:3,url:'/studio/designs/'+designId,parameters:{added:[{id:'user-smoke',kind:'text',role:'Added text',box:[10,10,20,10],direction:'horizontal',text:'新增元素已恢复',reading:'custom'}],layers:{T01:{x:12,rotation:25,opacity:.7},'user-smoke':{z:12}},texts:{T01:{value:'确定的页面文字',color:'#123456'}},images:{I01:{color:'#abcdef'}},decorations:{D01:{hidden:true}},paper:'#eeeeee'}}}))});
|
const wiki=createHttpServer((req,res)=>{assert.equal(req.headers.cookie,'session=smoke-test');if(/^\/api\/media\/[0-9a-f-]{36}$/.test(req.url)){mediaReads++;res.setHeader('Content-Type','image/png');return res.end(Buffer.from('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+j3ioAAAAASUVORK5CYII=','base64'))}reads++;res.setHeader('Content-Type','application/json');if(req.url.endsWith(seriesId))return res.end(JSON.stringify({design:{id:seriesId,name:'完整三页作品',layoutId:'standard-01',revision:1,url:'/studio/template-layout?id='+seriesId,parameters:doc.pages[0].parameters,document:doc}}));const standard=req.url.endsWith(standardId);if(!standard&&!req.url.endsWith(designId)){res.writeHead(404);return res.end('{}')}res.end(JSON.stringify({design:{id:standard?standardId:designId,name:'已保存的实际页面',layoutId:standard?'standard-01':'ref-01',revision:3,url:'/studio/designs/'+designId,parameters:{added:[{id:'user-smoke',kind:'text',role:'Added text',box:[10,10,20,10],direction:'horizontal',text:'新增元素已恢复',reading:'custom'}],layers:{T01:{x:12,rotation:25,opacity:.7},'user-smoke':{z:12}},texts:{T01:{value:'确定的页面文字',color:'#123456'}},images:{I01:{color:'#abcdef'}},decorations:{D01:{hidden:true}},paper:'#eeeeee'}}}))});
|
||||||
wiki.listen(0,'127.0.0.1');await once(wiki,'listening');
|
wiki.listen(0,'127.0.0.1');await once(wiki,'listening');
|
||||||
const socket=createServer();socket.listen(0,'127.0.0.1');await once(socket,'listening');const port=socket.address().port;await new Promise(r=>socket.close(r));const child=spawn(process.execPath,[process.env.STUDIO_STANDALONE_SERVER || '.next/standalone/server.js'],{env:{...process.env,PORT:String(port),HOSTNAME:'127.0.0.1',STUDIO_WIKI_ORIGIN:'http://127.0.0.1:'+wiki.address().port},stdio:'inherit'}),base='http://127.0.0.1:'+port;
|
const socket=createServer();socket.listen(0,'127.0.0.1');await once(socket,'listening');const port=socket.address().port;await new Promise(r=>socket.close(r));const child=spawn(process.execPath,[process.env.STUDIO_STANDALONE_SERVER || '.next/standalone/apps/studio/server.js'],{env:{...process.env,PORT:String(port),HOSTNAME:'127.0.0.1',STUDIO_WIKI_ORIGIN:'http://127.0.0.1:'+wiki.address().port},stdio:'inherit'}),base='http://127.0.0.1:'+port;
|
||||||
try{let ready=false;for(let i=0;i<60;i++){try{if((await fetch(base+'/studio/api/health')).ok){ready=true;break}}catch{}await setTimeout(250)}assert.ok(ready);const entry=await fetch(base+'/studio',{redirect:'manual'});assert.equal(entry.status,307);assert.equal(entry.headers.get('location'),'/studio/graphic');const library=await fetch(base+'/studio/graphic').then(r=>r.text());assert.ok(library.includes('GRAPHIC'));assert.ok(!library.includes('ref-27')); const catalog=await fetch(base+'/studio/api/layouts').then(r=>r.json());assert.equal(catalog.layouts.length,28);
|
try{let ready=false;for(let i=0;i<60;i++){try{if((await fetch(base+'/studio/api/health')).ok){ready=true;break}}catch{}await setTimeout(250)}assert.ok(ready);const entry=await fetch(base+'/studio',{redirect:'manual'});assert.equal(entry.status,307);assert.equal(entry.headers.get('location'),'/studio/graphic');const library=await fetch(base+'/studio/graphic').then(r=>r.text());assert.ok(library.includes('GRAPHIC'));assert.ok(!library.includes('ref-27')); const catalog=await fetch(base+'/studio/api/layouts').then(r=>r.json());assert.equal(catalog.layouts.length,28);
|
||||||
for(const l of catalog.layouts){const page=await fetch(base+l.url);assert.equal(page.status,200,l.id);const html=await page.text();assert.ok(html.includes(l.name));assert.ok(html.includes('data-layout-id="'+l.id+'"'));assert.ok(!/<svg|<img|data:image|trial-controls|page-tools|workbench-top|contenteditable|编辑页面/.test(html),'Default page must use native elements, not source imagery');const schema=await fetch(base+l.api).then(r=>r.json());assert.equal(schema.id,l.id);for(const s of schema.elements)assert.ok(html.includes('data-element="'+s.id+'"'));if(l.family==='standard'){assert.equal((await fetch(base+l.api+'?format=svg')).status,400);continue;}const original=await fetch(base+l.api+'?format=svg',{headers:{cookie:'session=smoke-test'}}).then(r=>r.text());assert.ok(original.includes('data-layout-id="'+l.id+'"'));const text=schema.elements.find(e=>e.kind==='text');const result=await fetch(base+l.api,{method:'POST',headers:{'Content-Type':'application/json',cookie:'session=smoke-test'},body:JSON.stringify({texts:{[text.id]:{value:'API render <test>'}}})});assert.equal(result.status,200);assert.ok((await result.text()).includes('<'));}
|
for(const l of catalog.layouts){const page=await fetch(base+l.url);assert.equal(page.status,200,l.id);const html=await page.text();assert.ok(html.includes(l.name));assert.ok(html.includes('data-layout-id="'+l.id+'"'));assert.ok(!/<svg|<img|data:image|trial-controls|page-tools|workbench-top|contenteditable|编辑页面/.test(html),'Default page must use native elements, not source imagery');const schema=await fetch(base+l.api).then(r=>r.json());assert.equal(schema.id,l.id);for(const s of schema.elements)assert.ok(html.includes('data-element="'+s.id+'"'));if(l.family==='standard'){assert.equal((await fetch(base+l.api+'?format=svg')).status,400);continue;}const original=await fetch(base+l.api+'?format=svg',{headers:{cookie:'session=smoke-test'}}).then(r=>r.text());assert.ok(original.includes('data-layout-id="'+l.id+'"'));const text=schema.elements.find(e=>e.kind==='text');const result=await fetch(base+l.api,{method:'POST',headers:{'Content-Type':'application/json',cookie:'session=smoke-test'},body:JSON.stringify({texts:{[text.id]:{value:'API render <test>'}}})});assert.equal(result.status,200);assert.ok((await result.text()).includes('<'));}
|
||||||
assert.equal(reads,0,'Default pages never load a saved design');assert.ok(mediaReads>0,'SVG exports load isolated media fixtures');
|
assert.equal(reads,0,'Default pages never load a saved design');assert.ok(mediaReads>0,'SVG exports load isolated media fixtures');
|
||||||
|
|||||||
@@ -13,4 +13,4 @@
|
|||||||
.layer[data-selected=true],.tabs button[aria-pressed=true]{background:var(--selection);color:var(--foreground)}
|
.layer[data-selected=true],.tabs button[aria-pressed=true]{background:var(--selection);color:var(--foreground)}
|
||||||
.element[data-selected=true],.corner{outline-color:var(--selection-border);border-color:var(--selection-border)}
|
.element[data-selected=true],.corner{outline-color:var(--selection-border);border-color:var(--selection-border)}
|
||||||
/* The artwork board is deliberately independent of dark UI chrome. */
|
/* The artwork board is deliberately independent of dark UI chrome. */
|
||||||
.blankHint{color:#49372E}
|
.blankHint{color:var(--el-espresso)}
|
||||||
|
|||||||
@@ -11,9 +11,8 @@ RUN corepack enable && corepack prepare pnpm@11.25.0 --activate
|
|||||||
COPY apps/waterfall-wiki/pnpm-lock.yaml ./
|
COPY apps/waterfall-wiki/pnpm-lock.yaml ./
|
||||||
COPY pnpm-workspace.yaml /repo/pnpm-workspace.yaml
|
COPY pnpm-workspace.yaml /repo/pnpm-workspace.yaml
|
||||||
COPY packages/brand/ /repo/packages/brand/
|
COPY packages/brand/ /repo/packages/brand/
|
||||||
RUN pnpm --ignore-workspace fetch --frozen-lockfile --fetch-timeout=300000 --network-concurrency=8
|
|
||||||
COPY apps/waterfall-wiki/package.json ./
|
COPY apps/waterfall-wiki/package.json ./
|
||||||
RUN pnpm --filter @prompt/waterfall-wiki install --offline --frozen-lockfile
|
RUN pnpm --filter @prompt/waterfall-wiki install --frozen-lockfile --fetch-timeout=300000 --network-concurrency=8
|
||||||
|
|
||||||
FROM dependencies AS build
|
FROM dependencies AS build
|
||||||
# .dockerignore excludes docs and operational notes without extra legacy COPY snapshots.
|
# .dockerignore excludes docs and operational notes without extra legacy COPY snapshots.
|
||||||
@@ -25,9 +24,10 @@ USER node
|
|||||||
CMD ["npm", "run", "test:integration"]
|
CMD ["npm", "run", "test:integration"]
|
||||||
|
|
||||||
FROM base AS runtime
|
FROM base AS runtime
|
||||||
|
WORKDIR /app/apps/waterfall-wiki
|
||||||
ENV NODE_ENV=production HOSTNAME=0.0.0.0 PORT=3000 \
|
ENV NODE_ENV=production HOSTNAME=0.0.0.0 PORT=3000 \
|
||||||
FFMPEG_PATH=/usr/bin/ffmpeg FFPROBE_PATH=/usr/bin/ffprobe
|
FFMPEG_PATH=/usr/bin/ffmpeg FFPROBE_PATH=/usr/bin/ffprobe
|
||||||
COPY --from=build --chown=node:node /repo/apps/waterfall-wiki/.next/standalone/ ./
|
COPY --from=build --chown=node:node /repo/apps/waterfall-wiki/.next/standalone/ /app/
|
||||||
COPY --from=build --chown=node:node /repo/apps/waterfall-wiki/dist/worker.cjs /repo/apps/waterfall-wiki/dist/bootstrap.cjs /repo/apps/waterfall-wiki/dist/publish-learning-series.cjs /repo/apps/waterfall-wiki/dist/auth-cli.cjs ./
|
COPY --from=build --chown=node:node /repo/apps/waterfall-wiki/dist/worker.cjs /repo/apps/waterfall-wiki/dist/bootstrap.cjs /repo/apps/waterfall-wiki/dist/publish-learning-series.cjs /repo/apps/waterfall-wiki/dist/auth-cli.cjs ./
|
||||||
COPY --from=build --chown=node:node /repo/apps/waterfall-wiki/db/ ./db/
|
COPY --from=build --chown=node:node /repo/apps/waterfall-wiki/db/ ./db/
|
||||||
COPY --chown=node:node apps/waterfall-wiki/scripts/container-health.mjs ./
|
COPY --chown=node:node apps/waterfall-wiki/scripts/container-health.mjs ./
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
|
import { resolve } from "node:path";
|
||||||
import type { NextConfig } from "next";
|
import type { NextConfig } from "next";
|
||||||
import managedMedia from "./src/content/managed-media.json";
|
import managedMedia from "./src/content/managed-media.json";
|
||||||
|
|
||||||
const nextConfig: NextConfig = {
|
const nextConfig: NextConfig = {
|
||||||
|
turbopack: { root: resolve(process.cwd(), "../..") },
|
||||||
serverExternalPackages: ["playwright-core"],
|
serverExternalPackages: ["playwright-core"],
|
||||||
async redirects(){return [
|
async redirects(){return [
|
||||||
{source:'/studio/graphic',destination:'/graphic',permanent:true},
|
{source:'/studio/graphic',destination:'/graphic',permanent:true},
|
||||||
@@ -20,7 +22,7 @@ const nextConfig: NextConfig = {
|
|||||||
{source:"/agent/index.md",destination:"/api/agent-index"},
|
{source:"/agent/index.md",destination:"/api/agent-index"},
|
||||||
{source:"/skills/:skill/:doc.md",destination:"/api/skill-docs/:skill/:doc"},
|
{source:"/skills/:skill/:doc.md",destination:"/api/skill-docs/:skill/:doc"},
|
||||||
]},
|
]},
|
||||||
output: "standalone", outputFileTracingRoot: process.cwd(),
|
output: "standalone", outputFileTracingRoot: resolve(process.cwd(), "../.."),
|
||||||
outputFileTracingIncludes: {"/*":["./node_modules/playwright-core/**/*"]},
|
outputFileTracingIncludes: {"/*":["./node_modules/playwright-core/**/*"]},
|
||||||
poweredByHeader: false,
|
poweredByHeader: false,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ async function main() {
|
|||||||
const request = (path:string,init:RequestInit={}) => fetch(base+path,{...init,redirect:'manual'});
|
const request = (path:string,init:RequestInit={}) => fetch(base+path,{...init,redirect:'manual'});
|
||||||
const buildId = readFileSync('.next/BUILD_ID','utf8').trim();
|
const buildId = readFileSync('.next/BUILD_ID','utf8').trim();
|
||||||
for(const path of ['/','/workspace','/documents','/account'])assert.equal((await request(path)).status,200,'Public shell '+path);
|
for(const path of ['/','/workspace','/documents','/account'])assert.equal((await request(path)).status,200,'Public shell '+path);
|
||||||
|
for(const path of ['/favicon.ico','/brand/logo-light.svg','/brand/logo-dark.svg','/brand/icon-dark.svg','/apple-touch-icon.png']) assert.equal((await request(path)).status,200,'Public brand asset '+path);
|
||||||
const studio=await request('/studio');assert.equal(studio.status,307);assert.equal(studio.headers.get('location'),'/workspace');
|
const studio=await request('/studio');assert.equal(studio.status,307);assert.equal(studio.headers.get('location'),'/workspace');
|
||||||
for(const [from,to] of [['/studio/graphic','/graphic'],['/studio/infinite_canvas','/infinite_canvas']]){const r=await request(from);assert.equal(r.status,308);assert.equal(r.headers.get('location'),to)}
|
for(const [from,to] of [['/studio/graphic','/graphic'],['/studio/infinite_canvas','/infinite_canvas']]){const r=await request(from);assert.equal(r.status,308);assert.equal(r.headers.get('location'),to)}
|
||||||
assert.equal((await request('/account')).status,200,'Public account page');
|
assert.equal((await request('/account')).status,200,'Public account page');
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { cp,mkdir,access } from 'node:fs/promises';
|
import { cp,mkdir,access } from 'node:fs/promises';
|
||||||
await mkdir('.next/standalone/.next',{recursive:true});
|
await mkdir('.next/standalone/apps/waterfall-wiki/.next',{recursive:true});
|
||||||
await cp('.next/static','.next/standalone/.next/static',{recursive:true});
|
await cp('.next/static','.next/standalone/apps/waterfall-wiki/.next/static',{recursive:true});
|
||||||
try{await access('public');await cp('public','.next/standalone/public',{recursive:true});}catch(e){if(e.code!=='ENOENT')throw e;}
|
try{await access('public');await cp('public','.next/standalone/apps/waterfall-wiki/public',{recursive:true});}catch(e){if(e.code!=='ENOENT')throw e;}
|
||||||
|
|||||||
@@ -17,9 +17,9 @@ async function availablePort() {
|
|||||||
|
|
||||||
const port = process.env.SMOKE_PORT || await availablePort();
|
const port = process.env.SMOKE_PORT || await availablePort();
|
||||||
const release = "smoke-test";
|
const release = "smoke-test";
|
||||||
const previewFixture='.next/standalone/public/__smoke-preview.png';
|
const previewFixture='.next/standalone/apps/waterfall-wiki/public/__smoke-preview.png';
|
||||||
await writeFile(previewFixture,await sharp({create:{width:48,height:48,channels:3,background:'#eee'}}).png().toBuffer());
|
await writeFile(previewFixture,await sharp({create:{width:48,height:48,channels:3,background:'#eee'}}).png().toBuffer());
|
||||||
const child = spawn(process.execPath, [".next/standalone/server.js"], {
|
const child = spawn(process.execPath, [".next/standalone/apps/waterfall-wiki/server.js"], {
|
||||||
// This loopback-only child checks retained resources without production credentials.
|
// This loopback-only child checks retained resources without production credentials.
|
||||||
// Production keeps failing closed; the bypass requires both explicit test settings.
|
// Production keeps failing closed; the bypass requires both explicit test settings.
|
||||||
env: { ...process.env, AUTH_CONFIG_FILE: "", AUTH_DISABLED_FOR_TESTS: "true", PORT: port, HOSTNAME: "127.0.0.1", RELEASE_SHA: release },
|
env: { ...process.env, AUTH_CONFIG_FILE: "", AUTH_DISABLED_FOR_TESTS: "true", PORT: port, HOSTNAME: "127.0.0.1", RELEASE_SHA: release },
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ import { NextResponse, type NextRequest } from 'next/server';
|
|||||||
import { authConfig, SESSION_COOKIE, validSession } from './lib/auth';
|
import { authConfig, SESSION_COOKIE, validSession } from './lib/auth';
|
||||||
export function proxy(request: NextRequest) {
|
export function proxy(request: NextRequest) {
|
||||||
const path = request.nextUrl.pathname;
|
const path = request.nextUrl.pathname;
|
||||||
|
const publicBrandAssets = ['/favicon.ico','/apple-touch-icon.png','/brand/logo-light.svg','/brand/logo-dark.svg','/brand/icon-dark.svg','/studio/favicon.ico','/studio/apple-touch-icon.png','/studio/brand/logo-light.svg','/studio/brand/logo-dark.svg','/studio/brand/icon-dark.svg'];
|
||||||
|
if (['GET','HEAD'].includes(request.method) && publicBrandAssets.includes(path)) return NextResponse.next({headers:{'Referrer-Policy':'same-origin'}});
|
||||||
const responseHeaders = {'Cache-Control':'private, no-store', 'Referrer-Policy':'same-origin'};
|
const responseHeaders = {'Cache-Control':'private, no-store', 'Referrer-Policy':'same-origin'};
|
||||||
// Public knowledge pages are read-only. Account handlers enforce their own origin and session checks.
|
// Public knowledge pages are read-only. Account handlers enforce their own origin and session checks.
|
||||||
const publicRead = ['GET','HEAD'].includes(request.method) && (path === '/' || ['/workspace','/graphic','/infinite_canvas','/studio','/studio/graphic','/studio/infinite_canvas','/studio/api'].includes(path) || path.startsWith('/studio/_next/') || path === '/protocol' || ['/llms.txt','/index.md','/agent','/agent/index.md','/api/agent-index','/api/guides'].includes(path) || path.startsWith('/guide/') || path.startsWith('/api/guides/'));
|
const publicRead = ['GET','HEAD'].includes(request.method) && (path === '/' || ['/workspace','/graphic','/infinite_canvas','/studio','/studio/graphic','/studio/infinite_canvas','/studio/api'].includes(path) || path.startsWith('/studio/_next/') || path === '/protocol' || ['/llms.txt','/index.md','/agent','/agent/index.md','/api/agent-index','/api/guides'].includes(path) || path.startsWith('/guide/') || path.startsWith('/api/guides/'));
|
||||||
|
|||||||
@@ -19,3 +19,5 @@ input,textarea,select{accent-color:var(--primary)}
|
|||||||
|
|
||||||
.primary-button,.auth-submit{background:var(--primary);color:var(--primary-foreground)}
|
.primary-button,.auth-submit{background:var(--primary);color:var(--primary-foreground)}
|
||||||
.primary-button:hover,.auth-submit:hover{background:var(--primary-hover)}
|
.primary-button:hover,.auth-submit:hover{background:var(--primary-hover)}
|
||||||
|
/* The legacy library rail collapses on tablets, while its mobile drawer expands. */
|
||||||
|
@media(min-width:651px) and (max-width:950px){.sidebar .endoleap-wordmark{display:none!important}}
|
||||||
|
|||||||
@@ -71,8 +71,8 @@
|
|||||||
top: 8px;
|
top: 8px;
|
||||||
left: 250px;
|
left: 250px;
|
||||||
transform: translateY(-200%);
|
transform: translateY(-200%);
|
||||||
background: var(--ink);
|
background: var(--primary);
|
||||||
color: var(--foreground) !important;
|
color: var(--primary-foreground) !important;
|
||||||
padding: 10px 16px;
|
padding: 10px 16px;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -37,7 +37,7 @@ test('proxy exposes creative entry pages while protecting APIs, data and Studio
|
|||||||
for(const path of ['/library/import','/skills/example.png','/_next/data/build/library/import.json','/studio/layouts/ref-01']) assert.equal(proxy(new NextRequest('http://wiki.test'+path)).status,307,path);
|
for(const path of ['/library/import','/skills/example.png','/_next/data/build/library/import.json','/studio/layouts/ref-01']) assert.equal(proxy(new NextRequest('http://wiki.test'+path)).status,307,path);
|
||||||
for(const path of ['/api/upload','/studio/api/export','/studio/api/layouts','/api/feed']) assert.equal(proxy(new NextRequest('http://wiki.test'+path)).status,401,path);
|
for(const path of ['/api/upload','/studio/api/export','/studio/api/layouts','/api/feed']) assert.equal(proxy(new NextRequest('http://wiki.test'+path)).status,401,path);
|
||||||
for(const path of ['/','/_next/data/build/index.json','/llms.txt','/index.md','/agent','/agent/index.md','/api/agent-index','/api/guides','/write','/documents','/api/documents','/api/documents/preview','/guide/welcome','/protocol','/api/guides/welcome','/account','/api/account/session','/login','/brand-mark.svg','/_next/static/chunk.js','/api/health','/api/ready']) assert.equal(proxy(new NextRequest('http://wiki.test'+path)).status,200,path);
|
for(const path of ['/','/_next/data/build/index.json','/llms.txt','/index.md','/agent','/agent/index.md','/api/agent-index','/api/guides','/write','/documents','/api/documents','/api/documents/preview','/guide/welcome','/protocol','/api/guides/welcome','/account','/api/account/session','/login','/brand-mark.svg','/_next/static/chunk.js','/api/health','/api/ready']) assert.equal(proxy(new NextRequest('http://wiki.test'+path)).status,200,path);
|
||||||
const creativeEntries=['/workspace','/graphic','/infinite_canvas','/studio','/studio/graphic','/studio/infinite_canvas','/studio/api','/studio/_next/static/chunk.js'];
|
const creativeEntries=['/favicon.ico','/apple-touch-icon.png','/brand/logo-light.svg','/brand/logo-dark.svg','/brand/icon-dark.svg','/studio/favicon.ico','/studio/apple-touch-icon.png','/studio/brand/logo-light.svg','/studio/brand/logo-dark.svg','/studio/brand/icon-dark.svg','/workspace','/graphic','/infinite_canvas','/studio','/studio/graphic','/studio/infinite_canvas','/studio/api','/studio/_next/static/chunk.js'];
|
||||||
for(const path of creativeEntries){
|
for(const path of creativeEntries){
|
||||||
for(const method of ['GET','HEAD'])assert.equal(proxy(new NextRequest('http://wiki.test'+path,{method})).status,200,`${method} ${path}`);
|
for(const method of ['GET','HEAD'])assert.equal(proxy(new NextRequest('http://wiki.test'+path,{method})).status,200,`${method} ${path}`);
|
||||||
assert.equal(proxy(new NextRequest('http://wiki.test'+path,{method:'POST'})).status,401,`POST ${path} must not bypass authentication`);
|
assert.equal(proxy(new NextRequest('http://wiki.test'+path,{method:'POST'})).status,401,`POST ${path} must not bypass authentication`);
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
/**
|
||||||
|
* Recover once from an idempotent document GET's transient proxy failure.
|
||||||
|
* This never retries hydration, theme assertions, or mutations, and shares one
|
||||||
|
* 60-second budget across both attempts rather than extending the deadline.
|
||||||
|
* @param {(timeout: number) => Promise<{ok(): boolean, status(): number} | null>} navigate
|
||||||
|
* @param {string} url
|
||||||
|
* @param {() => number} now
|
||||||
|
*/
|
||||||
|
export async function navigateBrandDocument(navigate, url, now = Date.now) {
|
||||||
|
const deadline = now() + 60000;
|
||||||
|
for (let attempt = 1; attempt <= 2; attempt++) {
|
||||||
|
const remaining = deadline - now();
|
||||||
|
if (remaining <= 0) throw new Error(`Document navigation budget exhausted: ${url}`);
|
||||||
|
try {
|
||||||
|
const response = await navigate(remaining);
|
||||||
|
if (response?.ok()) return response;
|
||||||
|
const status = response?.status();
|
||||||
|
if (attempt === 1 && [500, 502, 503, 504].includes(status ?? 0)) {
|
||||||
|
console.warn('Brand navigation proxy recovery', JSON.stringify({url, status, attempt}));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
throw new Error(`Document navigation failed: ${url}, HTTP ${status ?? 'no response'}`);
|
||||||
|
} catch (error) {
|
||||||
|
if (attempt === 1 && /ECONNRESET|net::ERR_(?:CONNECTION_RESET|CONNECTION_CLOSED|EMPTY_RESPONSE|ABORTED)/.test(String(error))) {
|
||||||
|
console.warn('Brand navigation connection recovery', JSON.stringify({url, error: String(error), attempt}));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw new Error(`Document navigation failed: ${url}`);
|
||||||
|
}
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
import {test} from 'node:test';
|
||||||
|
import assert from 'node:assert/strict';
|
||||||
|
import {navigateBrandDocument} from './brand-navigation.mjs';
|
||||||
|
const response = status => ({ok: () => status === 200, status: () => status});
|
||||||
|
|
||||||
|
test('successful documents are fetched once', async () => {
|
||||||
|
let calls = 0;
|
||||||
|
await navigateBrandDocument(async () => { calls++; return response(200); }, '/canvas');
|
||||||
|
assert.equal(calls, 1);
|
||||||
|
});
|
||||||
|
test('one proxy failure can recover within the original deadline', async () => {
|
||||||
|
const timeouts = []; let elapsed = 0;
|
||||||
|
await navigateBrandDocument(async timeout => {
|
||||||
|
timeouts.push(timeout); elapsed = 15000;
|
||||||
|
return response(timeouts.length === 1 ? 500 : 200);
|
||||||
|
}, '/canvas', () => elapsed);
|
||||||
|
assert.deepEqual(timeouts, [60000, 45000]);
|
||||||
|
});
|
||||||
|
test('connection reset and interrupted bootstrap scripts can recover once', async () => {
|
||||||
|
for(const failure of ['net::ERR_CONNECTION_RESET','Document bootstrap script request failed: net::ERR_ABORTED']){
|
||||||
|
let calls = 0;
|
||||||
|
await navigateBrandDocument(async () => {
|
||||||
|
if (++calls === 1) throw new Error(failure);
|
||||||
|
return response(200);
|
||||||
|
}, '/canvas');
|
||||||
|
assert.equal(calls, 2);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
test('persistent server failure is not hidden', async () => {
|
||||||
|
let calls = 0;
|
||||||
|
await assert.rejects(navigateBrandDocument(async () => { calls++; return response(502); }, '/canvas'), /HTTP 502/);
|
||||||
|
assert.equal(calls, 2);
|
||||||
|
});
|
||||||
|
test('missing routes, authentication failures and ordinary timeouts are not retried', async () => {
|
||||||
|
for (const status of [401, 403, 404]) {
|
||||||
|
let calls = 0;
|
||||||
|
await assert.rejects(navigateBrandDocument(async () => { calls++; return response(status); }, '/canvas'), /HTTP/);
|
||||||
|
assert.equal(calls, 1);
|
||||||
|
}
|
||||||
|
let calls = 0;
|
||||||
|
await assert.rejects(navigateBrandDocument(async () => { calls++; throw new Error('Timeout 60000ms exceeded'); }, '/canvas'), /Timeout/);
|
||||||
|
assert.equal(calls, 1);
|
||||||
|
});
|
||||||
|
test('recovery cannot extend the total navigation budget', async () => {
|
||||||
|
let calls = 0, elapsed = 0;
|
||||||
|
await assert.rejects(navigateBrandDocument(async () => {
|
||||||
|
calls++; elapsed = 60000; return response(503);
|
||||||
|
}, '/canvas', () => elapsed), /budget exhausted/);
|
||||||
|
assert.equal(calls, 1);
|
||||||
|
});
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
/** CI-only checks against the disposable stack, never against personal documents. */
|
/** CI-only checks against the disposable stack, never against personal documents. */
|
||||||
import assert from 'node:assert/strict';
|
import assert from 'node:assert/strict';
|
||||||
import { chromium } from 'playwright-core';
|
import { chromium, type Request } from 'playwright-core';
|
||||||
|
import { navigateBrandDocument } from './brand-navigation.mjs';
|
||||||
export async function verifyBrandUI(base: string) {
|
export async function verifyBrandUI(base: string) {
|
||||||
for (const prefix of process.env.VERIFY_CANVAS_UI === '1' ? ['', '/studio'] : ['']) {
|
for (const prefix of process.env.VERIFY_CANVAS_UI === '1' ? ['', '/studio'] : ['']) {
|
||||||
const icon = await fetch(`${base}${prefix}/favicon.ico`);
|
const icon = await fetch(`${base}${prefix}/favicon.ico`);
|
||||||
@@ -17,10 +18,37 @@ export async function verifyBrandUI(base: string) {
|
|||||||
const browser = await chromium.launch({ executablePath: process.env.CHROMIUM_PATH || '/usr/bin/chromium', headless: true, args: ['--no-sandbox', '--disable-dev-shm-usage'] });
|
const browser = await chromium.launch({ executablePath: process.env.CHROMIUM_PATH || '/usr/bin/chromium', headless: true, args: ['--no-sandbox', '--disable-dev-shm-usage'] });
|
||||||
try {
|
try {
|
||||||
const page = await browser.newPage({ viewport: { width: 1440, height: 960 } });
|
const page = await browser.newPage({ viewport: { width: 1440, height: 960 } });
|
||||||
|
page.setDefaultTimeout(60000);page.setDefaultNavigationTimeout(60000);
|
||||||
|
const failures: string[] = [], scripts: {path:string;status?:number;ms:number;error?:string}[] = [];
|
||||||
|
const scriptStarted = new WeakMap<Request,number>();
|
||||||
|
page.on('request', request => { if(request.resourceType()==='script') scriptStarted.set(request,Date.now()); });
|
||||||
|
page.on('response', response => { if(response.request().resourceType()==='script') { scripts.push({path:new URL(response.url()).pathname,status:response.status(),ms:Date.now()-(scriptStarted.get(response.request())??Date.now())}); if(scripts.length>24)scripts.shift(); } });
|
||||||
|
page.on('pageerror', error => failures.push(error.message));
|
||||||
|
page.on('requestfailed', request => { failures.push(new URL(request.url()).pathname + ': ' + request.failure()?.errorText); if(request.resourceType()==='script') scripts.push({path:new URL(request.url()).pathname,ms:Date.now()-(scriptStarted.get(request)??Date.now()),error:request.failure()?.errorText}); });
|
||||||
const visit = async (path: string, theme: string) => {
|
const visit = async (path: string, theme: string) => {
|
||||||
await page.goto(base + path, { waitUntil: 'commit' });
|
const started = Date.now();
|
||||||
await page.locator('button[data-theme-ready="true"]').first().waitFor();
|
try {
|
||||||
await page.waitForFunction(expected => document.documentElement.dataset.theme === expected, theme);
|
// DOMContentLoaded also waits for this document's deferred scripts, unlike commit.
|
||||||
|
await navigateBrandDocument(async timeout => {
|
||||||
|
const attemptStarted=Date.now(), bootstrapFailures:string[]=[];
|
||||||
|
const failed=(request:Request)=>{
|
||||||
|
if(request.resourceType()==='script'&&(scriptStarted.get(request)??0)>=attemptStarted)
|
||||||
|
bootstrapFailures.push(request.failure()?.errorText||'unknown script failure');
|
||||||
|
};
|
||||||
|
page.on('requestfailed',failed);
|
||||||
|
try {
|
||||||
|
const response=await page.goto(base+path,{waitUntil:'domcontentloaded',timeout});
|
||||||
|
if(response?.ok()&&bootstrapFailures.length)throw new Error('Document bootstrap script request failed: '+bootstrapFailures.join('; '));
|
||||||
|
return response;
|
||||||
|
} finally {page.off('requestfailed',failed);}
|
||||||
|
}, base + path);
|
||||||
|
await page.locator('button[data-theme-ready="true"]').first().waitFor();
|
||||||
|
await page.waitForFunction(expected => document.documentElement.dataset.theme === expected, theme);
|
||||||
|
console.log('Brand UI route ready:', path, theme, Date.now() - started);
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Brand UI navigation diagnostics', JSON.stringify({path, url:page.url(), elapsedMs:Date.now()-started, failures:failures.slice(-20), scripts:scripts.slice(-24), controls:await page.locator('[data-theme-ready]').evaluateAll(elements=>elements.map(el=>({ready:el.getAttribute('data-theme-ready'),display:getComputedStyle(el).display}))), body:(await page.locator('body').innerText({timeout:3000}).catch(()=>'unavailable')).slice(0,1200)}));
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
const background = (selector: string) => page.locator(selector).first().evaluate(el => getComputedStyle(el).backgroundColor);
|
const background = (selector: string) => page.locator(selector).first().evaluate(el => getComputedStyle(el).backgroundColor);
|
||||||
await visit('/', 'home-light');
|
await visit('/', 'home-light');
|
||||||
|
|||||||
@@ -21,8 +21,8 @@ export async function verifyCanvasAgentUI(base:string){
|
|||||||
page.on('requestfailed',request=>{pending.delete(request);network.push(requestName(request)+': '+request.failure()?.errorText)});
|
page.on('requestfailed',request=>{pending.delete(request);network.push(requestName(request)+': '+request.failure()?.errorText)});
|
||||||
page.on('response',response=>{const url=new URL(response.url());if(url.pathname.startsWith('/api/canvases'))canvasRequests.push(`${response.request().method()} ${url.pathname} ${response.status()}`)});
|
page.on('response',response=>{const url=new URL(response.url());if(url.pathname.startsWith('/api/canvases'))canvasRequests.push(`${response.request().method()} ${url.pathname} ${response.status()}`)});
|
||||||
try{
|
try{
|
||||||
page.setDefaultTimeout(20000);page.on('pageerror',e=>errors.push(e.message));
|
page.setDefaultTimeout(60000);page.setDefaultNavigationTimeout(60000);page.on('pageerror',e=>errors.push(e.message));
|
||||||
mark('open landing');await page.goto(base+'/',{waitUntil:'domcontentloaded'});
|
mark('open landing');await page.goto(base+'/',{waitUntil:'commit'});
|
||||||
await page.getByRole('heading',{name:/想法不该停在对话里/,level:1}).waitFor();
|
await page.getByRole('heading',{name:/想法不该停在对话里/,level:1}).waitFor();
|
||||||
const accountSession=page.waitForResponse(response=>new URL(response.url()).pathname==='/api/account/session'&&response.request().method()==='GET');
|
const accountSession=page.waitForResponse(response=>new URL(response.url()).pathname==='/api/account/session'&&response.request().method()==='GET');
|
||||||
const [,sessionResponse]=await Promise.all([page.getByRole('link',{name:'开始创作',exact:true}).click(),accountSession]);
|
const [,sessionResponse]=await Promise.all([page.getByRole('link',{name:'开始创作',exact:true}).click(),accountSession]);
|
||||||
@@ -97,7 +97,7 @@ export async function verifyCanvasAgentUI(base:string){
|
|||||||
assert.equal((await fetch(base+root,{headers:{authorization:second.authorization}})).status,404);
|
assert.equal((await fetch(base+root,{headers:{authorization:second.authorization}})).status,404);
|
||||||
await page.setViewportSize({width:390,height:844});
|
await page.setViewportSize({width:390,height:844});
|
||||||
const bounds=await panel.boundingBox();assert.ok(bounds&&bounds.x>=0&&bounds.x+bounds.width<=390,'Agent panel stays within the mobile viewport');
|
const bounds=await panel.boundingBox();assert.ok(bounds&&bounds.x>=0&&bounds.x+bounds.width<=390,'Agent panel stays within the mobile viewport');
|
||||||
await page.reload({waitUntil:'domcontentloaded'});
|
await page.reload({waitUntil:'commit'});
|
||||||
await page.getByRole('link',{name:email,exact:true,includeHidden:true}).waitFor({state:'attached'});
|
await page.getByRole('link',{name:email,exact:true,includeHidden:true}).waitFor({state:'attached'});
|
||||||
await page.getByRole('button',{name:'Agent',exact:true}).click();
|
await page.getByRole('button',{name:'Agent',exact:true}).click();
|
||||||
const reopened=page.getByRole('region',{name:'Agent 连接',exact:true});
|
const reopened=page.getByRole('region',{name:'Agent 连接',exact:true});
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ export async function verifyGuidancePublishing(base:string){
|
|||||||
// The document discovery list hydrates from the real API; the homepage is the product landing page.
|
// The document discovery list hydrates from the real API; the homepage is the product landing page.
|
||||||
const browser=await chromium.launch({executablePath:process.env.CHROMIUM_PATH||'/usr/bin/chromium',headless:true,args:['--no-sandbox','--disable-dev-shm-usage']});
|
const browser=await chromium.launch({executablePath:process.env.CHROMIUM_PATH||'/usr/bin/chromium',headless:true,args:['--no-sandbox','--disable-dev-shm-usage']});
|
||||||
try{
|
try{
|
||||||
const page=await browser.newPage();
|
const page=await browser.newPage();page.setDefaultTimeout(60000);page.setDefaultNavigationTimeout(60000);
|
||||||
const navigationDiagnostics:string[]=[],inflight=new Set<string>();
|
const navigationDiagnostics:string[]=[],inflight=new Set<string>();
|
||||||
const record=(value:string)=>{navigationDiagnostics.push(value.slice(0,1800));if(navigationDiagnostics.length>24)navigationDiagnostics.shift();};
|
const record=(value:string)=>{navigationDiagnostics.push(value.slice(0,1800));if(navigationDiagnostics.length>24)navigationDiagnostics.shift();};
|
||||||
page.on('pageerror',error=>record('pageerror: '+error.message));
|
page.on('pageerror',error=>record('pageerror: '+error.message));
|
||||||
@@ -46,30 +46,33 @@ export async function verifyGuidancePublishing(base:string){
|
|||||||
page.on('response',response=>{const path=new URL(response.url()).pathname;if(path.startsWith('/api/')||path.includes('/_next/data/'))void response.text().then(body=>record(`data ${response.status()} ${path}: ${body.slice(0,1400)}`)).catch(()=>{});else if(response.status()>=400||response.request().resourceType()==='script')record(`resource ${response.status()} ${path}`);});
|
page.on('response',response=>{const path=new URL(response.url()).pathname;if(path.startsWith('/api/')||path.includes('/_next/data/'))void response.text().then(body=>record(`data ${response.status()} ${path}: ${body.slice(0,1400)}`)).catch(()=>{});else if(response.status()>=400||response.request().resourceType()==='script')record(`resource ${response.status()} ${path}`);});
|
||||||
try{
|
try{
|
||||||
const link=`a[href="/documents/${httpDoc.id}?revision=1"]`;
|
const link=`a[href="/documents/${httpDoc.id}?revision=1"]`;
|
||||||
const navigation=await page.goto(base+'/documents',{waitUntil:'domcontentloaded'});record('directory HTTP '+navigation?.status());
|
const navigation=await page.goto(base+'/documents',{waitUntil:'commit'});record('directory HTTP '+navigation?.status());
|
||||||
await page.locator(link).waitFor({state:'visible'});assert.equal(await page.locator(link).getByRole('heading').textContent(),httpDoc.title);
|
await page.locator(link).waitFor({state:'visible'});assert.equal(await page.locator(link).getByRole('heading').textContent(),httpDoc.title);
|
||||||
// Published matches must not inherit the examples' empty state; submitted filters survive reload.
|
// Published matches must not inherit the examples' empty state; submitted filters survive reload.
|
||||||
const search=page.getByRole('textbox',{name:'搜索文档'});
|
const search=page.getByRole('textbox',{name:'搜索文档'});
|
||||||
await search.fill(httpDoc.title);await search.press('Enter');
|
await search.fill(httpDoc.title);await search.press('Enter');
|
||||||
await page.waitForURL(url=>url.searchParams.get('q')===httpDoc.title);
|
await page.waitForURL(url=>url.searchParams.get('q')===httpDoc.title,{waitUntil:'commit'});
|
||||||
await page.getByRole('status').filter({hasText:'找到 2 篇文档'}).waitFor();
|
await page.getByRole('status').filter({hasText:'找到 2 篇文档'}).waitFor();
|
||||||
assert.equal(await page.getByText('没有匹配文档',{exact:false}).count(),0);
|
assert.equal(await page.getByText('没有匹配文档',{exact:false}).count(),0);
|
||||||
await page.reload({waitUntil:'domcontentloaded'});
|
await page.reload({waitUntil:'commit'});
|
||||||
await page.getByRole('status').filter({hasText:'找到 2 篇文档'}).waitFor();
|
await page.getByRole('status').filter({hasText:'找到 2 篇文档'}).waitFor();
|
||||||
|
// The matching count can also describe the unfiltered list before router hydration.
|
||||||
|
await page.waitForFunction(title=>document.querySelector<HTMLInputElement>('input[aria-label="搜索文档"]')?.value===title,httpDoc.title);
|
||||||
assert.equal(await search.inputValue(),httpDoc.title);
|
assert.equal(await search.inputValue(),httpDoc.title);
|
||||||
await page.getByRole('tab',{name:/事实依据/}).click();
|
await page.getByRole('tab',{name:/事实依据/}).click();
|
||||||
await page.waitForURL(url=>url.searchParams.get('kind')==='evidence');
|
await page.waitForURL(url=>url.searchParams.get('kind')==='evidence',{waitUntil:'commit'});
|
||||||
await page.getByRole('heading',{name:'没有匹配文档',exact:true}).waitFor();
|
await page.getByRole('heading',{name:'没有匹配文档',exact:true}).waitFor();
|
||||||
await page.getByRole('button',{name:'清除所有筛选'}).click();
|
await page.getByRole('button',{name:'清除所有筛选'}).click();
|
||||||
await page.waitForURL(url=>url.search==='');
|
await page.waitForURL(url=>url.search==='',{waitUntil:'commit'});
|
||||||
await page.locator(link).waitFor({state:'visible'});
|
await page.locator(link).waitFor({state:'visible'});
|
||||||
|
await page.waitForFunction(()=>document.querySelector<HTMLInputElement>('input[aria-label="搜索文档"]')?.value==='');
|
||||||
assert.equal(await search.inputValue(),'');
|
assert.equal(await search.inputValue(),'');
|
||||||
await page.getByRole('navigation',{name:'主导航',exact:true}).getByRole('link',{name:'社区文档',exact:true}).click();await page.locator(link).waitFor({state:'visible'});
|
await page.getByRole('navigation',{name:'主导航',exact:true}).getByRole('link',{name:'社区文档',exact:true}).click();await page.locator(link).waitFor({state:'visible'});
|
||||||
await page.locator(link).click();
|
await page.locator(link).click();
|
||||||
await page.waitForURL(url=>url.pathname==='/documents/'+httpDoc.id&&url.searchParams.get('revision')==='1');
|
await page.waitForURL(url=>url.pathname==='/documents/'+httpDoc.id&&url.searchParams.get('revision')==='1',{waitUntil:'commit'});
|
||||||
await page.getByRole('heading',{name:httpDoc.title,exact:true,level:1}).waitFor();
|
await page.getByRole('heading',{name:httpDoc.title,exact:true,level:1}).waitFor();
|
||||||
assert.equal(await page.locator('h1').textContent(),httpDoc.title);
|
assert.equal(await page.locator('h1').textContent(),httpDoc.title);
|
||||||
await page.goto(base+'/write',{waitUntil:'domcontentloaded'});assert.equal(await page.locator('h1').textContent(),'发布独立文档');
|
await page.goto(base+'/write',{waitUntil:'commit'});await page.getByRole('heading',{name:'发布独立文档',exact:true,level:1}).waitFor();assert.equal(await page.locator('h1').textContent(),'发布独立文档');
|
||||||
}catch(error){console.error('Document navigation diagnostics',JSON.stringify({url:page.url(),headings:await page.locator('h1').allTextContents(),body:(await page.locator('body').innerText()).slice(0,2200),inflight:[...inflight].map(url=>new URL(url).pathname),events:navigationDiagnostics}));throw error;}
|
}catch(error){console.error('Document navigation diagnostics',JSON.stringify({url:page.url(),headings:await page.locator('h1').allTextContents(),body:(await page.locator('body').innerText()).slice(0,2200),inflight:[...inflight].map(url=>new URL(url).pathname),events:navigationDiagnostics}));throw error;}
|
||||||
await page.close();
|
await page.close();
|
||||||
await verifyGuidanceWorkspaceUI(base,browser);
|
await verifyGuidanceWorkspaceUI(base,browser);
|
||||||
|
|||||||
@@ -89,7 +89,8 @@ export async function verifyGuidanceWorkspaceUI(base: string, browser: Browser)
|
|||||||
route.fulfill({ json: { document: authored } }),
|
route.fulfill({ json: { document: authored } }),
|
||||||
);
|
);
|
||||||
const page = await context.newPage();
|
const page = await context.newPage();
|
||||||
page.setDefaultTimeout(10000);
|
page.setDefaultTimeout(60000);
|
||||||
|
page.setDefaultNavigationTimeout(60000);
|
||||||
page.on("pageerror", (error) => errors.push(error.message));
|
page.on("pageerror", (error) => errors.push(error.message));
|
||||||
page.on("crash", () => errors.push("Browser renderer crashed"));
|
page.on("crash", () => errors.push("Browser renderer crashed"));
|
||||||
const pending = new Set<string>(), network: string[] = [];
|
const pending = new Set<string>(), network: string[] = [];
|
||||||
@@ -99,7 +100,7 @@ export async function verifyGuidanceWorkspaceUI(base: string, browser: Browser)
|
|||||||
async function navigate(url: string, reload = false) {
|
async function navigate(url: string, reload = false) {
|
||||||
const previousSessionReplies = sessionReplies;
|
const previousSessionReplies = sessionReplies;
|
||||||
try {
|
try {
|
||||||
const navigation = await (reload ? page.reload({waitUntil:"domcontentloaded"}) : page.goto(url,{waitUntil:"domcontentloaded"}));
|
const navigation = await (reload ? page.reload({waitUntil:"commit"}) : page.goto(url,{waitUntil:"commit"}));
|
||||||
assert.ok(navigation?.ok(), "Navigation returns a successful document");
|
assert.ok(navigation?.ok(), "Navigation returns a successful document");
|
||||||
await page.getByText(signedIn ? "editor@example.com" : "登录你的账户",{exact:true}).first().waitFor({state:"attached"});
|
await page.getByText(signedIn ? "editor@example.com" : "登录你的账户",{exact:true}).first().waitFor({state:"attached"});
|
||||||
assert.ok(sessionReplies > previousSessionReplies, "The new document requests its account fixture and renders the resulting account state");
|
assert.ok(sessionReplies > previousSessionReplies, "The new document requests its account fixture and renders the resulting account state");
|
||||||
@@ -124,6 +125,7 @@ export async function verifyGuidanceWorkspaceUI(base: string, browser: Browser)
|
|||||||
.waitFor();
|
.waitFor();
|
||||||
await navigate(page.url(), true);
|
await navigate(page.url(), true);
|
||||||
await page.getByRole("heading",{name:"没有匹配文档",exact:true}).waitFor();
|
await page.getByRole("heading",{name:"没有匹配文档",exact:true}).waitFor();
|
||||||
|
await page.waitForFunction(() => document.querySelector<HTMLInputElement>('input[aria-label="搜索文档"]')?.value === "不存在的文档");
|
||||||
assert.equal(await search.inputValue(), "不存在的文档");
|
assert.equal(await search.inputValue(), "不存在的文档");
|
||||||
await page
|
await page
|
||||||
.getByRole("button", { name: "清除所有筛选", exact: true })
|
.getByRole("button", { name: "清除所有筛选", exact: true })
|
||||||
|
|||||||
@@ -23,18 +23,25 @@ import {verifyFlatNoteMigration} from './flat-note-migration';
|
|||||||
import {staticEntries} from '../src/lib/explore';
|
import {staticEntries} from '../src/lib/explore';
|
||||||
import {publishLearningSeries} from '../src/lib/publish-learning-series';
|
import {publishLearningSeries} from '../src/lib/publish-learning-series';
|
||||||
|
|
||||||
|
// Browser acceptance gets its own deadline; it must not consume the existing business-flow budget.
|
||||||
|
test('Endoleap icons, persisted themes and artwork isolation in the real browser', {timeout:300000,skip:!process.env.PROMPT_TEST_BASE_URL}, async()=>{
|
||||||
|
assert.equal(process.env.PROMPT_INTEGRATION_TEST,'1');
|
||||||
|
const base=process.env.PROMPT_TEST_BASE_URL;assert.ok(base);
|
||||||
|
await verifyBrandUI(base);
|
||||||
|
});
|
||||||
|
|
||||||
test('real PostgreSQL + S3 notes, flat tags, resource sharing and video processing', {timeout:600000}, async()=>{
|
test('real PostgreSQL + S3 notes, flat tags, resource sharing and video processing', {timeout:600000}, async()=>{
|
||||||
assert.equal(process.env.PROMPT_INTEGRATION_TEST,'1','Run only against an explicitly isolated test database');
|
assert.equal(process.env.PROMPT_INTEGRATION_TEST,'1','Run only against an explicitly isolated test database');
|
||||||
const socket=createServer();socket.listen(0,'127.0.0.1');await once(socket,'listening');const address=socket.address();assert.ok(address&&typeof address!=='string');const port=address.port;await new Promise<void>(r=>socket.close(()=>r()));
|
const socket=createServer();socket.listen(0,'127.0.0.1');await once(socket,'listening');const address=socket.address();assert.ok(address&&typeof address!=='string');const port=address.port;await new Promise<void>(r=>socket.close(()=>r()));
|
||||||
const external=process.env.PROMPT_TEST_BASE_URL;
|
const external=process.env.PROMPT_TEST_BASE_URL;
|
||||||
const base=external||`http://127.0.0.1:${port}`;
|
const base=external||`http://127.0.0.1:${port}`;
|
||||||
const server=external?null:spawn(process.execPath,['.next/standalone/server.js'],{env:{...process.env,PORT:String(port),HOSTNAME:'127.0.0.1'},stdio:'inherit'});
|
const server=external?null:spawn(process.execPath,['.next/standalone/apps/waterfall-wiki/server.js'],{env:{...process.env,PORT:String(port),HOSTNAME:'127.0.0.1'},stdio:'inherit'});
|
||||||
const worker=external?null:spawn(process.execPath,['dist/worker.cjs'],{env:process.env,stdio:'inherit'});const dir=await mkdtemp(join(tmpdir(),'prompt-test-'));
|
const worker=external?null:spawn(process.execPath,['dist/worker.cjs'],{env:process.env,stdio:'inherit'});const dir=await mkdtemp(join(tmpdir(),'prompt-test-'));
|
||||||
const request=async(path:string,body?:unknown)=>{const res=await fetch(base+path,body?{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify(body)}:undefined);assert.ok(res.ok,`${path}: ${res.status} ${res.ok?'':await res.text()}`);return res.json();};
|
const request=async(path:string,body?:unknown)=>{const res=await fetch(base+path,body?{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify(body)}:undefined);assert.ok(res.ok,`${path}: ${res.status} ${res.ok?'':await res.text()}`);return res.json();};
|
||||||
try{
|
try{
|
||||||
let ready=false;for(let i=0;i<60;i++){try{if((await fetch(base+'/api/health')).ok){ready=true;break;}}catch{}await setTimeout(250);}assert.ok(ready);
|
let ready=false;for(let i=0;i<60;i++){try{if((await fetch(base+'/api/health')).ok){ready=true;break;}}catch{}await setTimeout(250);}assert.ok(ready);
|
||||||
for(const route of ['/','/images','/videos','/audio','/articles','/motion','/library/import','/tools/doodle','/tools/skills','/tools/skills/street-people','/tools/skills/shadow-puppet'])assert.equal((await fetch(base+route)).status,200,route);
|
for(const route of ['/','/images','/videos','/audio','/articles','/motion','/library/import','/tools/doodle','/tools/skills','/tools/skills/street-people','/tools/skills/shadow-puppet'])assert.equal((await fetch(base+route)).status,200,route);
|
||||||
await verifyBrandUI(base);
|
if(!external)await verifyBrandUI(base);
|
||||||
await verifyEmailAccounts();
|
await verifyEmailAccounts();
|
||||||
await verifyCanvasWorkspace(base);
|
await verifyCanvasWorkspace(base);
|
||||||
if(process.env.VERIFY_CANVAS_UI==='1')await verifyCanvasAgentUI(base);
|
if(process.env.VERIFY_CANVAS_UI==='1')await verifyCanvasAgentUI(base);
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
在消费应用的 `package.json` 声明 `"@endoleap/brand": "workspace:*"`,按仓库独立锁文件策略更新该应用锁文件。包为私有内部资源,无需 npm 发布、React peer dependency 或运行时主题库。
|
在消费应用的 `package.json` 声明 `"@endoleap/brand": "workspace:*"`,按仓库独立锁文件策略更新该应用锁文件。包为私有内部资源,无需 npm 发布、React peer dependency 或运行时主题库。
|
||||||
|
|
||||||
Studio / Wiki 已声明 `workspace:*` 依赖。Docker 构建在 `/repo/apps/<app>` 保留与 `/repo/packages/brand` 的相对位置;运行镜像仍在 `/app` 执行 standalone 服务。保持消费应用与品牌包的相对位置,不恢复原有孤立安装流程。
|
Studio / Wiki 已声明 `workspace:*` 依赖。Docker 构建在 `/repo/apps/<app>` 保留与 `/repo/packages/brand` 的相对位置;Next.js 的模块解析与文件追踪都以 `/repo` 为根,standalone 保留 `apps/<app>` 层次。运行镜像复制完整 standalone 到 `/app`,在 `/app/apps/<app>` 执行服务;静态文件、图标、worker 与健康检查文件都放在对应应用目录。保持消费应用与品牌包的相对位置,不恢复原有孤立安装流程。
|
||||||
|
|
||||||
## Tailwind CSS v4
|
## Tailwind CSS v4
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -Eeuo pipefail
|
||||||
|
: "${REVIEW_SHA:?The exact review commit SHA is required}"
|
||||||
|
[[ "$REVIEW_SHA" =~ ^[0-9a-f]{40}$ ]] || { echo 'Refusing invalid review SHA' >&2; exit 2; }
|
||||||
|
# Only this workflow's disposable tags; production tags, volumes and other projects stay out of scope.
|
||||||
|
for repository in creative-studio-review creative-wiki-tests creative-wiki-review; do
|
||||||
|
tag="$repository:$REVIEW_SHA"
|
||||||
|
referenced=$(docker ps -aq | xargs -r docker inspect --format '{{.Image}}')
|
||||||
|
if ! image=$(docker image inspect --format '{{.Id}}' "$tag" 2>/dev/null); then
|
||||||
|
echo "No review image: $tag"
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
if printf '%s\n' "$referenced" | grep -Fxq "$image"; then
|
||||||
|
echo "Keeping container-referenced review image: $tag"
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
# Preserve parent layers so unchanged dependency installs stay cached.
|
||||||
|
docker image rm --no-prune "$tag"
|
||||||
|
done
|
||||||
@@ -17,7 +17,15 @@ compose(){ docker compose -p "$COMPOSE_PROJECT_NAME" --env-file "$TEST_ENV" "${C
|
|||||||
cleanup(){
|
cleanup(){
|
||||||
code=$?
|
code=$?
|
||||||
trap - EXIT INT TERM
|
trap - EXIT INT TERM
|
||||||
if [ "$code" -ne 0 ]; then compose logs --tail 160 waterfall-wiki waterfall-wiki-worker "${STUDIO_SERVICES[@]}" || true; fi
|
if [ "$code" -ne 0 ]; then
|
||||||
|
echo 'Runner pressure at integration failure (before disposable stack cleanup)'
|
||||||
|
uptime || true
|
||||||
|
free -m || true
|
||||||
|
df -h / || true
|
||||||
|
for resource in cpu memory io; do cat "/proc/pressure/$resource" || true; done
|
||||||
|
timeout 10s docker stats --no-stream --format '{{.Name}} cpu={{.CPUPerc}} memory={{.MemUsage}} io={{.BlockIO}} pids={{.PIDs}}' || true
|
||||||
|
compose logs --tail 160 waterfall-wiki waterfall-wiki-worker "${STUDIO_SERVICES[@]}" || true
|
||||||
|
fi
|
||||||
cleanup_code=0
|
cleanup_code=0
|
||||||
bash scripts/cleanup-integration.sh || cleanup_code=$?
|
bash scripts/cleanup-integration.sh || cleanup_code=$?
|
||||||
rm -f "$TEST_ENV"
|
rm -f "$TEST_ENV"
|
||||||
|
|||||||
@@ -0,0 +1,73 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
"""Check review cleanup scope without Docker or build output."""
|
||||||
|
import json
|
||||||
|
import os
|
||||||
|
from pathlib import Path
|
||||||
|
import subprocess
|
||||||
|
import tempfile
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
SCRIPT = Path(__file__).with_name('cleanup-review-images.sh')
|
||||||
|
SHA = 'a' * 40
|
||||||
|
FAKE_DOCKER = '''#!/usr/bin/env python3
|
||||||
|
import json, os, sys
|
||||||
|
args=sys.argv[1:]
|
||||||
|
with open(os.environ['DOCKER_CALLS'], 'a') as output:
|
||||||
|
output.write(json.dumps(args)+'\\n')
|
||||||
|
if args[0]=='ps':
|
||||||
|
if os.environ.get('FAIL_INVENTORY'): sys.exit(1)
|
||||||
|
if os.environ.get('REFERENCED'): print('container-id')
|
||||||
|
elif args[0]=='inspect':
|
||||||
|
print('sha256:review-image')
|
||||||
|
elif args[:2]==['image','inspect']:
|
||||||
|
if os.environ.get('MISSING_IMAGE'): sys.exit(1)
|
||||||
|
print('sha256:review-image')
|
||||||
|
'''
|
||||||
|
|
||||||
|
|
||||||
|
class ReviewCleanupTests(unittest.TestCase):
|
||||||
|
def run_cleanup(self, sha=SHA, **extra):
|
||||||
|
with tempfile.TemporaryDirectory() as directory:
|
||||||
|
root = Path(directory)
|
||||||
|
docker = root / 'docker'
|
||||||
|
docker.write_text(FAKE_DOCKER)
|
||||||
|
docker.chmod(0o700)
|
||||||
|
calls = root / 'calls'
|
||||||
|
result = subprocess.run(['bash', str(SCRIPT)], capture_output=True, env={
|
||||||
|
**os.environ, 'PATH': directory + os.pathsep + os.environ['PATH'],
|
||||||
|
'DOCKER_CALLS': str(calls), 'REVIEW_SHA': sha, **extra})
|
||||||
|
return result.returncode, [json.loads(line) for line in calls.read_text().splitlines()] if calls.exists() else []
|
||||||
|
|
||||||
|
def test_removes_only_exact_review_tags_without_force_and_keeps_parent_cache(self):
|
||||||
|
code, calls = self.run_cleanup()
|
||||||
|
self.assertEqual(code, 0)
|
||||||
|
self.assertEqual([args for args in calls if args[:2] == ['image', 'rm']], [
|
||||||
|
['image', 'rm', '--no-prune', name + ':' + SHA] for name in
|
||||||
|
['creative-studio-review', 'creative-wiki-tests', 'creative-wiki-review']])
|
||||||
|
self.assertFalse(any('-f' in args or 'prune' in args or 'volume' in args for args in calls))
|
||||||
|
|
||||||
|
def test_invalid_sha_never_contacts_docker(self):
|
||||||
|
for value in ['', 'main', 'a' * 39, 'a' * 41, 'A' * 40, '*' * 40]:
|
||||||
|
with self.subTest(value=value):
|
||||||
|
code, calls = self.run_cleanup(value)
|
||||||
|
self.assertNotEqual(code, 0)
|
||||||
|
self.assertEqual(calls, [])
|
||||||
|
|
||||||
|
def test_container_referenced_images_are_kept(self):
|
||||||
|
code, calls = self.run_cleanup(REFERENCED='1')
|
||||||
|
self.assertEqual(code, 0)
|
||||||
|
self.assertFalse(any(args[:2] == ['image', 'rm'] for args in calls))
|
||||||
|
|
||||||
|
def test_missing_tags_are_a_successful_noop(self):
|
||||||
|
code, calls = self.run_cleanup(MISSING_IMAGE='1')
|
||||||
|
self.assertEqual(code, 0)
|
||||||
|
self.assertFalse(any(args[:2] == ['image', 'rm'] for args in calls))
|
||||||
|
|
||||||
|
def test_inventory_failure_prevents_removal(self):
|
||||||
|
code, calls = self.run_cleanup(FAIL_INVENTORY='1')
|
||||||
|
self.assertNotEqual(code, 0)
|
||||||
|
self.assertEqual(len(calls), 1)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main()
|
||||||
@@ -10,7 +10,8 @@ fi
|
|||||||
REPO_ROOT=$(git rev-parse --show-toplevel)
|
REPO_ROOT=$(git rev-parse --show-toplevel)
|
||||||
RESULT_DIR="$REPO_ROOT/artifacts/studio-acceptance"
|
RESULT_DIR="$REPO_ROOT/artifacts/studio-acceptance"
|
||||||
MODE=${1:-verify}
|
MODE=${1:-verify}
|
||||||
[[ "$MODE" == verify || "$MODE" == --diagnose ]] || exit 2
|
# Legacy template visual checks are opt-in; their API compatibility checks remain below.
|
||||||
|
[[ "$MODE" == verify || "$MODE" == --diagnose || "$MODE" == --legacy-layouts ]] || exit 2
|
||||||
WIKI_IMAGE=$(docker inspect --format '{{.Config.Image}}' prompt-waterfall-wiki-1)
|
WIKI_IMAGE=$(docker inspect --format '{{.Config.Image}}' prompt-waterfall-wiki-1)
|
||||||
[[ "$WIKI_IMAGE" =~ ^waterfall-wiki:[0-9a-f]{40}$ ]] || { echo 'Unexpected Wiki image'; exit 1; }
|
[[ "$WIKI_IMAGE" =~ ^waterfall-wiki:[0-9a-f]{40}$ ]] || { echo 'Unexpected Wiki image'; exit 1; }
|
||||||
TEST_IMAGE="waterfall-wiki-tests:${WIKI_IMAGE#waterfall-wiki:}"
|
TEST_IMAGE="waterfall-wiki-tests:${WIKI_IMAGE#waterfall-wiki:}"
|
||||||
@@ -41,11 +42,11 @@ run_api "$RESULT_DIR" verify-studio-library.mjs
|
|||||||
docker run --rm --volumes-from prompt-waterfall-wiki-1:ro \
|
docker run --rm --volumes-from prompt-waterfall-wiki-1:ro \
|
||||||
--mount "type=bind,src=$REPO_ROOT,dst=/delivery,readonly" \
|
--mount "type=bind,src=$REPO_ROOT,dst=/delivery,readonly" \
|
||||||
--mount "type=bind,src=$RESULT_DIR,dst=/tmp/studio-library" \
|
--mount "type=bind,src=$RESULT_DIR,dst=/tmp/studio-library" \
|
||||||
-e AUTH_CONFIG_FILE=/auth/config.json -e NODE_PATH=/app/node_modules \
|
-e AUTH_CONFIG_FILE=/auth/config.json -e NODE_PATH=/repo/apps/waterfall-wiki/node_modules \
|
||||||
--entrypoint node "$TEST_IMAGE" /delivery/scripts/verify-studio-visual.cjs "$MODE"
|
--entrypoint node "$TEST_IMAGE" /delivery/scripts/verify-studio-visual.cjs "$MODE"
|
||||||
docker run --rm \
|
docker run --rm \
|
||||||
--mount "type=bind,src=$REPO_ROOT,dst=/delivery,readonly" \
|
--mount "type=bind,src=$REPO_ROOT,dst=/delivery,readonly" \
|
||||||
--mount "type=bind,src=$RESULT_DIR,dst=/tmp/studio-library" \
|
--mount "type=bind,src=$RESULT_DIR,dst=/tmp/studio-library" \
|
||||||
-e NODE_PATH=/app/node_modules -e CHROMIUM_PATH=/usr/bin/chromium \
|
-e NODE_PATH=/repo/apps/waterfall-wiki/node_modules -e CHROMIUM_PATH=/usr/bin/chromium \
|
||||||
-e SCREENSHOT_DIR=/tmp/studio-library/visual \
|
-e SCREENSHOT_DIR=/tmp/studio-library/visual \
|
||||||
--entrypoint node "$TEST_IMAGE" /delivery/apps/studio/scripts/infinite-canvas-smoke.cjs
|
--entrypoint node "$TEST_IMAGE" /delivery/apps/studio/scripts/infinite-canvas-smoke.cjs
|
||||||
|
|||||||
@@ -14,15 +14,18 @@ const assert=require('node:assert/strict');
|
|||||||
const page=await context.newPage(),errors=[],images=[];
|
const page=await context.newPage(),errors=[],images=[];
|
||||||
page.on('pageerror',error=>errors.push({url:page.url(),message:error.message}));
|
page.on('pageerror',error=>errors.push({url:page.url(),message:error.message}));
|
||||||
page.on('response',async response=>{if(response.request().resourceType()==='image'){const url=new URL(response.url());images.push({path:url.pathname+url.search,status:response.status(),type:response.headers()['content-type'],bytes:(await response.body().catch(()=>Buffer.alloc(0))).length})}});
|
page.on('response',async response=>{if(response.request().resourceType()==='image'){const url=new URL(response.url());images.push({path:url.pathname+url.search,status:response.status(),type:response.headers()['content-type'],bytes:(await response.body().catch(()=>Buffer.alloc(0))).length})}});
|
||||||
const metrics=process.argv.includes('--after-layouts')?JSON.parse(await readFile(dir+'/metrics.json','utf8')).metrics:[];
|
// The retired catalogue is retained for existing API consumers, not a release UI gate.
|
||||||
for(let i=1;i<=27&&!process.argv.includes('--after-layouts');i++){
|
// Explicit legacy/diagnostic runs still exercise its full overflow assertions.
|
||||||
|
const checkLegacy=process.argv.includes('--legacy-layouts')||process.argv.includes('--diagnose');
|
||||||
|
const metrics=[];
|
||||||
|
for(let i=1;i<=27&&checkLegacy;i++){
|
||||||
const id='ref-'+String(i).padStart(2,'0');await page.goto(base+'/studio/layouts/'+id,{waitUntil:'networkidle'});await page.locator('article.native-layout').screenshot({path:dir+'/'+id+'.png',style:'.page-tools{visibility:hidden}'});
|
const id='ref-'+String(i).padStart(2,'0');await page.goto(base+'/studio/layouts/'+id,{waitUntil:'networkidle'});await page.locator('article.native-layout').screenshot({path:dir+'/'+id+'.png',style:'.page-tools{visibility:hidden}'});
|
||||||
const m=await page.locator('article.native-layout').evaluate(el=>{
|
const m=await page.locator('article.native-layout').evaluate(el=>{
|
||||||
const overflow=[...el.querySelectorAll('.native-copy')].filter(e=>e.scrollHeight>e.clientHeight+2||e.scrollWidth>e.clientWidth+2);
|
const overflow=[...el.querySelectorAll('.native-copy')].filter(e=>e.scrollHeight>e.clientHeight+2||e.scrollWidth>e.clientWidth+2);
|
||||||
return {id:el.dataset.layoutId,elements:el.querySelectorAll('[data-element]').length,width:el.clientWidth,height:el.clientHeight,overflow:overflow.map(e=>e.closest('[data-element]').dataset.element),overflowDetails:overflow.map(e=>{const style=getComputedStyle(e);return {id:e.closest('[data-element]').dataset.element,text:e.textContent,clientWidth:e.clientWidth,scrollWidth:e.scrollWidth,clientHeight:e.clientHeight,scrollHeight:e.scrollHeight,fontSize:style.fontSize,lineHeight:style.lineHeight,letterSpacing:style.letterSpacing,fontFamily:style.fontFamily,fontWeight:style.fontWeight,writingMode:style.writingMode}})};
|
return {id:el.dataset.layoutId,elements:el.querySelectorAll('[data-element]').length,width:el.clientWidth,height:el.clientHeight,overflow:overflow.map(e=>e.closest('[data-element]').dataset.element),overflowDetails:overflow.map(e=>{const style=getComputedStyle(e);return {id:e.closest('[data-element]').dataset.element,text:e.textContent,clientWidth:e.clientWidth,scrollWidth:e.scrollWidth,clientHeight:e.clientHeight,scrollHeight:e.scrollHeight,fontSize:style.fontSize,lineHeight:style.lineHeight,letterSpacing:style.letterSpacing,fontFamily:style.fontFamily,fontWeight:style.fontWeight,writingMode:style.writingMode}})};
|
||||||
});metrics.push(m);await writeFile(dir+'/metrics.json',JSON.stringify({metrics,images,errors},null,2));
|
});metrics.push(m);await writeFile(dir+'/metrics.json',JSON.stringify({metrics,images,errors},null,2));
|
||||||
}
|
}
|
||||||
if(!process.argv.includes('--after-layouts')&&!process.argv.includes('--diagnose'))assert.deepEqual(metrics.filter(m=>m.overflow.length),[],'Default copy must fit every native slot');
|
if(checkLegacy&&!process.argv.includes('--diagnose'))assert.deepEqual(metrics.filter(m=>m.overflow.length),[],'Default copy must fit every native slot');
|
||||||
await page.goto(base+'/',{waitUntil:'networkidle'});await page.getByRole('heading',{name:/想法不该停在对话里/}).waitFor();await page.screenshot({path:dir+'/landing-desktop.png',fullPage:true});
|
await page.goto(base+'/',{waitUntil:'networkidle'});await page.getByRole('heading',{name:/想法不该停在对话里/}).waitFor();await page.screenshot({path:dir+'/landing-desktop.png',fullPage:true});
|
||||||
await page.goto(base+'/graphic',{waitUntil:'networkidle'});
|
await page.goto(base+'/graphic',{waitUntil:'networkidle'});
|
||||||
assert.equal(new URL(page.url()).pathname,'/graphic');
|
assert.equal(new URL(page.url()).pathname,'/graphic');
|
||||||
@@ -52,7 +55,7 @@ const assert=require('node:assert/strict');
|
|||||||
await page.goto(base+verify.results[0].url,{waitUntil:'networkidle'});await page.screenshot({path:dir+'/standard-mobile.png',fullPage:true});
|
await page.goto(base+verify.results[0].url,{waitUntil:'networkidle'});await page.screenshot({path:dir+'/standard-mobile.png',fullPage:true});
|
||||||
await page.goto(base+'/categories?category='+encodeURIComponent('文档入口'),{waitUntil:'domcontentloaded',timeout:60000});await page.getByRole('navigation',{name:'系统标签分类',exact:true}).waitFor({state:'visible'});assert.equal(await page.locator('.discovery-card').count(),3);await page.waitForFunction(()=>Array.from(document.querySelectorAll('.discovery-card img')).every(img=>img.complete&&img.naturalWidth>0),null,{timeout:60000});await page.screenshot({path:dir+'/document-entries.png',fullPage:true});
|
await page.goto(base+'/categories?category='+encodeURIComponent('文档入口'),{waitUntil:'domcontentloaded',timeout:60000});await page.getByRole('navigation',{name:'系统标签分类',exact:true}).waitFor({state:'visible'});assert.equal(await page.locator('.discovery-card').count(),3);await page.waitForFunction(()=>Array.from(document.querySelectorAll('.discovery-card img')).every(img=>img.complete&&img.naturalWidth>0),null,{timeout:60000});await page.screenshot({path:dir+'/document-entries.png',fullPage:true});
|
||||||
await writeFile(dir+'/metrics.json',JSON.stringify({metrics,images,errors},null,2));
|
await writeFile(dir+'/metrics.json',JSON.stringify({metrics,images,errors},null,2));
|
||||||
assert.equal(images.filter(r=>new URL(r.path,base).pathname.startsWith('/api/media/')).length,0,'Display must never fetch originals');if(!process.argv.includes('--diagnose'))assert.equal(errors.length,0,JSON.stringify(errors));for(const image of images){if(new URL(image.path,base).pathname==='/brand-mark.svg'){assert.equal(image.status,200);assert.match(image.type,/image\/svg\+xml/);continue;}assert.equal(new URL(image.path,base).pathname,'/api/preview');assert.equal(image.status,200);assert.equal(image.type,'image/webp');assert.ok(image.bytes>0&&image.bytes<=220000)}
|
assert.equal(images.filter(r=>new URL(r.path,base).pathname.startsWith('/api/media/')).length,0,'Display must never fetch originals');if(!process.argv.includes('--diagnose'))assert.equal(errors.length,0,JSON.stringify(errors));for(const image of images){if(/^\/(?:studio\/)?brand\/(?:logo-light|logo-dark|icon-dark)\.svg$/.test(new URL(image.path,base).pathname)){assert.equal(image.status,200);assert.match(image.type,/image\/svg\+xml/);continue;}assert.equal(new URL(image.path,base).pathname,'/api/preview');assert.equal(image.status,200);assert.equal(image.type,'image/webp');assert.ok(image.bytes>0&&image.bytes<=220000)}
|
||||||
await writeFile(dir+'/metrics.json',JSON.stringify({metrics,images,errors},null,2));await browser.close();
|
await writeFile(dir+'/metrics.json',JSON.stringify({metrics,images,errors},null,2));await browser.close();
|
||||||
console.log(JSON.stringify({diagnostic:process.argv.includes('--diagnose'),pages:27,errors:errors.length,displayImages:images.length,originalImageRequests:0,overflow:metrics.filter(m=>m.overflow.length)}));
|
console.log(JSON.stringify({diagnostic:process.argv.includes('--diagnose'),legacyLayoutsChecked:checkLegacy,legacyPages:metrics.length,errors:errors.length,displayImages:images.length,originalImageRequests:0,overflow:metrics.filter(m=>m.overflow.length)}));
|
||||||
})().catch(e=>{console.error(e.message);process.exit(1)});
|
})().catch(e=>{console.error(e.message);process.exit(1)});
|
||||||
|
|||||||
Reference in New Issue
Block a user