渠道清单只读核对补统一总号与线上一致性断言
Project CI / Frontend tests (push) Has been cancelled
Project CI / AI game creator shell Rust lane 2/2 (push) Has been cancelled
Project CI / AI game creator shell Rust smoke (push) Has been cancelled
Project CI / AI game creator shell Rust crates (push) Has been cancelled
Project CI / Backend tests (push) Has been cancelled
Project CI / Native shell tests (push) Has been cancelled
Project CI / Repository checks (push) Has been cancelled
Project CI / AI game creator shell web tests (push) Has been cancelled
Project CI / AI game creator shell Rust lane 1/2 (push) Has been cancelled
Project CI / Frontend tests (push) Has been cancelled
Project CI / AI game creator shell Rust lane 2/2 (push) Has been cancelled
Project CI / AI game creator shell Rust smoke (push) Has been cancelled
Project CI / AI game creator shell Rust crates (push) Has been cancelled
Project CI / Backend tests (push) Has been cancelled
Project CI / Native shell tests (push) Has been cancelled
Project CI / Repository checks (push) Has been cancelled
Project CI / AI game creator shell web tests (push) Has been cancelled
Project CI / AI game creator shell Rust lane 1/2 (push) Has been cancelled
- check:agc-update-channel-manifests:读 agc/global-version.json,断言任何渠道清单版本不高于统一总号(渠道落后按 INFO 提示,只有反超才失败),复用 agc-global-version 的 compareVersions - 渠道化里程碑本轮核对补线上总号证据:总号 0.1.155(dev-win 取号),四个渠道 0.1.154/0.1.150/0.1.142/0.1.139 均不高于总号 - decision-log 记录该线上口径
This commit is contained in:
@@ -25,6 +25,7 @@ import { pipeline } from 'node:stream/promises';
|
||||
|
||||
import * as tar from 'tar';
|
||||
|
||||
import { compareVersions } from '../apps/ai-game-creator-shell/scripts/agc-global-version.mjs';
|
||||
import { resolveChannelInstallIdentity } from '../apps/ai-game-creator-shell/scripts/channel-identity.mjs';
|
||||
import { readMacosAppInfoIdentity } from '../apps/ai-game-creator-shell/scripts/macos-release-identity.mjs';
|
||||
import {
|
||||
@@ -58,6 +59,8 @@ let failures = 0;
|
||||
let skipped = 0;
|
||||
/** 下载过的更新包摘要:用于「不同渠道不能共用同一份产物字节」这条隔离断言。 */
|
||||
const downloadedArtifacts = [];
|
||||
/** 各渠道清单版本:用于和统一总号(`agc/global-version.json`)比对。 */
|
||||
const channelVersions = new Map();
|
||||
function check(name, ok, detail = '') {
|
||||
if (!ok) failures += 1;
|
||||
console.log(
|
||||
@@ -179,6 +182,7 @@ async function verifyChannel(channel, tempDir) {
|
||||
return;
|
||||
}
|
||||
const version = String(manifest.version ?? '');
|
||||
channelVersions.set(channel, version);
|
||||
check(
|
||||
`${channel} 清单版本与发布元数据齐备`,
|
||||
/^\d+\.\d+\.\d+$/u.test(version) &&
|
||||
@@ -424,6 +428,41 @@ if (!VERIFY_DOWNLOAD) {
|
||||
);
|
||||
}
|
||||
|
||||
// 统一总号:`agc/global-version.json` 是发号唯一事实源,任何渠道清单都不允许高于它;
|
||||
// 总号高于渠道是正常的(渠道可能正在构建或尚未发布),这里只提示,不判失败。
|
||||
{
|
||||
const response = await fetch(`${OSS_BASE_URL}/global-version.json`);
|
||||
check(
|
||||
'统一总号对象可读',
|
||||
response.status === 200,
|
||||
`status=${response.status} ${OSS_BASE_URL}/global-version.json`,
|
||||
);
|
||||
if (response.status === 200) {
|
||||
const global = await response.json();
|
||||
const globalVersion = String(global.version ?? '');
|
||||
check(
|
||||
'统一总号字段齐备',
|
||||
/^\d+\.\d+\.\d+$/u.test(globalVersion) &&
|
||||
!Number.isNaN(Date.parse(String(global.updatedAt ?? ''))) &&
|
||||
String(global.channel ?? '').trim().length > 0,
|
||||
`version=${globalVersion} updatedAt=${global.updatedAt ?? ''} channel=${global.channel ?? ''}`,
|
||||
);
|
||||
for (const [channel, version] of channelVersions) {
|
||||
if (!/^\d+\.\d+\.\d+$/u.test(version)) continue;
|
||||
check(
|
||||
`${channel} 清单版本不高于统一总号`,
|
||||
compareVersions(version, globalVersion) <= 0,
|
||||
`channel=${version} global=${globalVersion}`,
|
||||
);
|
||||
if (compareVersions(version, globalVersion) < 0) {
|
||||
console.log(
|
||||
`INFO ${channel} 还没发到总号版本(渠道 ${version} < 总号 ${globalVersion};总号最近由 ${global.channel} 在 ${global.updatedAt} 取号,构建可能仍在进行)`,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
console.log(
|
||||
failures === 0
|
||||
? `\n全部通过${skipped > 0 ? `(${skipped} 项跳过)` : ''}`
|
||||
|
||||
Reference in New Issue
Block a user