Files
cms-SiteForge/scripts/verify_art_design_pro_v819.py
T
浅念 601451f22b upgrade: adopt V8.21.3 (V8.13→8.21.3: P5 SFTP/S3, P6 multilingual, editor overhaul, enterprise hardening)
Overlay ~150 upstream items onto our V8.12 base, preserving trade-pro
theme, registry tests, and design docs. Re-applied our patch set
(discovery/env_for/blocks.css/type-mapping/theme_color/frontend entries,
test_theme_pro_v3 mods) — all anchors survived upstream evolution.

New platform enhancement (fixes upgrade-introduced regression):
multilingual.site_locale now honors settings_json.locale, plus
PUT /api/i18n/sites/{id}/locale — standalone English sites get
<html lang='en'> under the V8.15 locale-rewrite pipeline.

compose: adopt V8.21.3 (image 8.21.3-dev.1, /api/ready probes, MySQL/S3
env) with project name pinned to siteforge-v8-10 (data volumes).

Tests: 356 passed / 11 failed — all 11 confirmed pre-existing in
pristine V8.21.3 on this host (10 upstream Windows env + our build test
now green after locale fix). Patch registry updated in plan doc.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-10-23 12:31:03 +08:00

58 lines
2.5 KiB
Python

"""Verify an installed Art Design Pro checkout and optionally run its real build.
Requires the USER's official checkout. A fixture-only installer test never
counts as a successful official Vue build.
"""
from __future__ import annotations
import argparse
import json
import subprocess
import sys
from pathlib import Path
if str(Path(__file__).resolve().parents[1]) not in sys.path:
sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
from scripts.install_into_art_design_pro import install
def verify(path: Path, build: bool = False) -> dict:
root = path.expanduser().resolve()
result = install(root, verify=True)
manifest = root/'src/views/siteforge/.siteforge-v819.json'
if not manifest.is_file():
raise ValueError('安装清单缺失,请执行安装器 --apply')
data = json.loads(manifest.read_text(encoding='utf-8'))
if data.get('siteforge_version') != '8.21.3-dev.1':
raise ValueError('安装清单版本不匹配')
result.update({'version':data['siteforge_version'],'build':'NOT_RUN'})
if build:
if not (root/'node_modules').is_dir():
raise ValueError('缺少 Art Design Pro 官方 npm 依赖;在官方工程先运行 pnpm install --frozen-lockfile')
command = ['pnpm','build']
try:
out = subprocess.run(command, cwd=root, check=False, capture_output=True,
text=True, timeout=300)
except (OSError, subprocess.TimeoutExpired) as exc:
raise ValueError('真实构建无法完成:'+str(exc)) from exc
if out.returncode:
raise ValueError(f'pnpm build 失败(退出码 {out.returncode}):'+out.stderr[-2000:])
result['build']='PASS'
result['build_stdout_tail']=out.stdout[-1000:]
return result
if __name__=='__main__':
parser=argparse.ArgumentParser()
parser.add_argument('official_repo',type=Path)
parser.add_argument('--build',action='store_true',help='有官方源码和 node_modules 后执行真实 pnpm build')
parser.add_argument('--report',type=Path)
a=parser.parse_args()
try:
result=verify(a.official_repo,build=a.build)
if a.report:
a.report.parent.mkdir(parents=True,exist_ok=True)
a.report.write_text(json.dumps(result,ensure_ascii=False,indent=2),encoding='utf-8')
print(json.dumps(result,ensure_ascii=False,indent=2))
except ValueError as exc:
print('BLOCKED/FAILED: '+str(exc),file=sys.stderr)
raise SystemExit(1)