fix(acceptance): 支持显式跳过本地验收

在用户明确授权时,将本地原生与 amd64 制品阶段记录为 skipped/waived,并直接使用当前生产脱敏快照进入线上模拟。修复线上报告合并未写入生产 Run ID 导致后续 promote CAS 必然失败的问题。已通过报告回归测试、bash -n、ShellCheck 和 diff 检查。
This commit is contained in:
2026-07-31 23:15:22 +08:00
parent a95184b5b6
commit 0b681275ed
4 changed files with 147 additions and 29 deletions
+19
View File
@@ -22,6 +22,7 @@ const output = join(temporary, 'acceptance-report.json');
const partialOutput = join(temporary, 'acceptance-report.partial.json');
const productionPartial = join(temporary, 'production-summary.partial.json');
const mergedPartialOutput = join(temporary, 'acceptance-report.production-partial.json');
const waivedOutput = join(temporary, 'acceptance-report.waived.json');
writeJSON(runtime, {
schemaVersion: 'acceptance-runtime/v1',
runId: runID,
@@ -108,6 +109,7 @@ assert.equal(readFileSync(partialOutput, 'utf8').includes('must-not-be-copied'),
execFileSync('node', [join(root, 'scripts/acceptance/report.mjs'), 'validate', '--input', partialOutput]);
writeJSON(productionPartial, {
runId: runID,
releaseSha,
apiImageDigest: digest,
snapshotConfigHash: configHash,
@@ -132,8 +134,25 @@ execFileSync('node', [
]);
const mergedPartial = JSON.parse(readFileSync(mergedPartialOutput, 'utf8'));
assert.equal(mergedPartial.stages.onlineSimulation.status, 'failed');
assert.equal(mergedPartial.runId, runID);
assert.equal(mergedPartial.stages.realCanary.status, 'failed');
assert.equal(mergedPartial.promotion.ready, false);
assert.equal(mergedPartial.promotion.trafficMode, 'validation');
assert.equal(mergedPartial.gates.at(-1).id, 'workflow_interrupted');
execFileSync('node', [join(root, 'scripts/acceptance/report.mjs'), 'validate', '--input', mergedPartialOutput]);
execFileSync('node', [
join(root, 'scripts/acceptance/report.mjs'),
'build-online-waiver',
'--release-sha', releaseSha,
'--api-digest', digest,
'--snapshot', snapshot,
'--waiver-reason', 'user_directed_online_only_acceptance',
'--output', waivedOutput
]);
const waived = JSON.parse(readFileSync(waivedOutput, 'utf8'));
assert.equal(waived.stages.localNative.status, 'skipped');
assert.equal(waived.stages.amd64Artifact.status, 'skipped');
assert.equal(waived.gates[0].id, 'local_acceptance_explicitly_waived');
assert.equal(waived.promotion.ready, false);
execFileSync('node', [join(root, 'scripts/acceptance/report.mjs'), 'validate', '--input', waivedOutput]);