55 lines
3.5 KiB
Python
55 lines
3.5 KiB
Python
"""Finalize already verified local v1.4.28 package; do not install or upload."""
|
||
from pathlib import Path
|
||
import hashlib
|
||
import json
|
||
import shutil
|
||
|
||
folder = Path(__file__).resolve().parent
|
||
root = Path('C:/wechat_rpa')
|
||
read = lambda name: json.loads((folder / name).read_text(encoding='utf-8-sig'))
|
||
plan = read('contact-recovery-release-plan.json')
|
||
tests = read('frozen-contact-recovery-tests.json')
|
||
notifications = read('frozen-contact-recovery-notifications.json')
|
||
frozen = read('frozen-release-qa.json')
|
||
integrity = read('nsis-payload-integrity.json')
|
||
asr = read('frozen-offline-asr.json')
|
||
assert plan['finalized'] and plan['version'] == '1.4.28'
|
||
assert {'test_protocol_contact_recovery', 'test_contact_relation_snapshot'} <= set(tests['modules'])
|
||
assert tests['tests_run'] > 0 and not any(tests[k] for k in ('failures', 'errors', 'skipped', 'blocked_external_actions'))
|
||
assert notifications['ok'] and notifications['passed'] == plan['notificationExpectedTests']
|
||
assert not notifications['skipped'] and not notifications['blocked_external_actions']
|
||
assert frozen['sourceManifestMatches'] and frozen['privateFilesExcluded'] and frozen['uiAssetsMatchSource']
|
||
assert {'contact_relation', 'contact_reply_guard', 'protocol_engine', 'wxwork_db', 'reply_database'} <= set(frozen['compiledModulesMatchSource'])
|
||
assert integrity['crcPassed'] and integrity['completeDeflateStream'] and not integrity['missingFiles']
|
||
assert asr['ok'] and len(asr['results']) == 3
|
||
assert not asr['site_packages_leaks'] and not asr['escaped_dlls'] and not asr['network_or_external_attempts']
|
||
for name, digest in read('build-source-manifest.json').items():
|
||
assert hashlib.sha256((root / name).read_bytes()).hexdigest() == digest, name
|
||
old = root / 'releases/甄AI客服-安装包-v1.4.27.exe'
|
||
assert hashlib.sha256(old.read_bytes()).hexdigest() == plan['previousInstallerSha256']
|
||
installer = root / 'dist/installer/甄AI客服-安装包-v1.4.28.exe'
|
||
release = root / 'releases' / installer.name
|
||
digest = hashlib.sha256(installer.read_bytes()).hexdigest()
|
||
assert digest == integrity['installerSha256']
|
||
if release.exists():
|
||
assert hashlib.sha256(release.read_bytes()).hexdigest() == digest
|
||
else:
|
||
shutil.copy2(installer, release)
|
||
assert hashlib.sha256(release.read_bytes()).hexdigest() == digest
|
||
report = {'version': '1.4.28', 'installer': str(release), 'bytes': release.stat().st_size,
|
||
'sha256': digest, 'frozenRegressionTests': tests['tests_run'],
|
||
'frozenNotificationTests': notifications['passed'], 'frozenAsrFormats': 3,
|
||
'realMessagesSent': 0, 'existingSettingsChanged': False, 'installed': False,
|
||
'cloudDeploymentNeeded': False, 'oldInstallerPreserved': True}
|
||
(folder / 'release-v1.4.28.json').write_text(json.dumps(report, ensure_ascii=False, indent=2), encoding='utf-8')
|
||
(folder / 'RESULT.md').write_text(
|
||
'# 联系人重新添加后的协议收信修复 v1.4.28\n\n'
|
||
f"实际 EXE 冻结模块回归 {tests['tests_run']} 项、提醒回归 {notifications['passed']} 项通过。"
|
||
'实际包内 ASR 对三格式合成中文音频通过,未回退构建环境依赖。'
|
||
'安装包 CRC、压缩流、全部应用文件哈希及私有文件排除检查通过。\n\n'
|
||
f'安装包:`{release}`\n\nSHA256:`{digest}`\n\n'
|
||
'旧 v1.4.27 安装包保留。未安装、重启、修改用户配置/队列、上传或发送真实消息。'
|
||
'从托盘退出旧客户端后安装新版。原有绑定收件人及开启状态不会自动更改。\n',
|
||
encoding='utf-8')
|
||
print(json.dumps(report, ensure_ascii=False))
|