Merge pull request #2757 from pikasTech/fix/2721-trigger-next-delivery-observe

fix: 发布触发后引导 delivery-observe
This commit is contained in:
Lyon
2026-07-21 15:52:07 +08:00
committed by GitHub
3 changed files with 7 additions and 1 deletions
@@ -156,3 +156,5 @@ L2 与 L3 发布必须使用 `plan -> 人工审阅 -> trigger` 的受控手动
范围相对 owning YAML 声明的发布意图扩大时,`plan` 必须明确列出新增项。操作者应先修正源码、配置或 planner,使范围回到预期后重新生成计划;不得通过确认参数、白名单、忽略 warning 或扩大资源预算继续触发。
唯一 mutation 是受控手动 `trigger`。它必须显式选择 target、lane、精确 source commit 和 pipeline intent,并向 PaC 发送 webhookPaC 从同一 source authority 创建 commit-pinned PipelineRun。触发前必须先审阅当前输入的 plan;计划输入或范围已变化时必须重新 plan。禁止 CLI 直建或裸创建 PipelineRun、由 PR 合并回调 trigger,或为兼容旧自动链保留第二入口。
`trigger` 被 PaC 接收后,动态 `next` 必须指向同一 source commit 的只读 `delivery-observe`。不得引导旧 `closeout`、自动同步、人工 PipelineRun 或 Argo mutation;触发失败或输入变化时只能回到重新 plan。
@@ -345,6 +345,10 @@ test("PaC failed or expanded plan never points next to trigger", () => {
expect(manualReleaseNext(...args, { planSucceeded: false, scopeExpanded: false, remoteError: false })).toContain("then rerun");
expect(manualReleaseNext(...args, { planSucceeded: true, scopeExpanded: true, remoteError: false })).toContain("then rerun");
expect(manualReleaseNext(...args, { planSucceeded: true, scopeExpanded: false, remoteError: false })).toContain("release trigger");
const observed = manualReleaseNext("trigger", args[1], args[2], args[3], args[4], { planSucceeded: true, scopeExpanded: false, remoteError: false });
expect(observed).toContain("delivery-observe");
expect(observed).toContain("a".repeat(40));
expect(observed).not.toContain("closeout");
const remote = readFileSync(resolve(import.meta.dir, "platform-infra-pipelines-as-code-remote.sh"), "utf8");
const action = remote.slice(remote.indexOf("manual_release_plan_json()"), remote.indexOf("repository_manifest()"));
expect(action).not.toContain('DOMAIN_PLAN="$domain_plan"');
@@ -1707,7 +1707,7 @@ export function manualReleaseNext(
}
return outcome.remoteError
? `fix the source range, planner, or owning YAML, then rerun: ${plan}`
: `bun scripts/cli.ts platform-infra pipelines-as-code closeout --target ${targetId} --consumer ${consumerId} --source-commit ${sourceCommit} --wait`;
: `bun scripts/cli.ts platform-infra pipelines-as-code delivery-observe --target ${targetId} --consumer ${consumerId} --source-commit ${sourceCommit}`;
}
async function bootstrap(config: UniDeskConfig, options: ApplyOptions): Promise<Record<string, unknown>> {