fix(cli): 统一生产环境确认协议与预览行为
- 新增 src/cli/production.ts:--allow-prod 为唯一生产覆盖参数, --allow-production / --force 仅作兼容别名;JSON 阻断统一为 PROD_OVERRIDE_REQUIRED,并携带 nextAction 与 details.operation - workflow test 与 workflow nodes grant 统一提示文案、错误结构与 nextAction 生成;workflow test 的 JSON 阻断不再返回空 stdout - 预览 --dry-run 始终放行,实际执行才要求覆盖参数;nodes grant 参数校验前置,缺少节点类型时不再先报生产阻断 - 两个命令的成功结果统一携带 productionOverride / productionWarning - corps tag 将企业从 prod 降级为 test/demo 时输出显著警告 - 同步 CLI 帮助、CLI/workflow README 与 Skill;补充对应单测 Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
1 parent
038aca10fb
commit
5be2bd5432
16 files changed
+575
-127
No files matched your search
@@ -159,6 +159,25 @@ describe("CLI - corps environment attributes & filtering", () => {
|
||||
expect(res.stdout).toContain("[DRY-RUN]");
|
||||
expect(res.stdout).toContain("设置企业环境属性");
|
||||
expect(res.stdout).toContain("newEnv: test");
|
||||
expect(res.stdout).toContain("将不再触发生产环境确认");
|
||||
});
|
||||
|
||||
it("corps tag dry-run from production to demo includes the same downgrade warning", async () => {
|
||||
const runtime = createMockRuntime();
|
||||
const res = await handleCorpsCommand(
|
||||
{
|
||||
area: "corps",
|
||||
action: "tag",
|
||||
args: ["corp_prod"],
|
||||
options: { demo: true, "dry-run": true },
|
||||
raw: ["corps", "tag", "corp_prod", "--demo", "--dry-run"],
|
||||
},
|
||||
runtime
|
||||
);
|
||||
|
||||
expect(res.exitCode).toBe(0);
|
||||
expect(res.stdout).toContain("将不再触发生产环境确认");
|
||||
expect(res.stdout).toContain("newEnv: demo");
|
||||
});
|
||||
|
||||
it("corps current displays environment attribute label", async () => {
|
||||
|
||||
Reference in new issue
Block a user