@lark-apaas/miaoda-cli 0.1.39-alpha.ba612c9 → 0.1.39-alpha.e79f9a3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/commands/deploy/modern.js +4 -1
- package/dist/cli/handlers/deploy/modern.js +10 -3
- package/dist/services/deploy/modern/atoms/local-release.js +1 -0
- package/dist/services/deploy/modern/pipelines/design-local.js +1 -0
- package/dist/services/deploy/modern/pipelines/local.js +1 -0
- package/dist/utils/http.js +2 -2
- package/package.json +1 -1
|
@@ -18,7 +18,7 @@ function registerDeployCommandsModern(program) {
|
|
|
18
18
|
.option('--dir <path>', '项目目录', '.')
|
|
19
19
|
.option('--skip-build', '跳过 build 步骤(已构建好时使用)', false)
|
|
20
20
|
.option('--skip-release', '不创建/更新本地发布单,发布单状态由外部托管', false)
|
|
21
|
-
.option('--conf <json>', '关联元信息 JSON,仅识别 checkPointVersion / commitID / sessionID / marker
|
|
21
|
+
.option('--conf <json>', '关联元信息 JSON,仅识别 checkPointVersion / commitID / sessionID / marker / versionLevel 五字段')
|
|
22
22
|
// 这三个 flag 只在父命令声明一份,deploy 与 deploy patch 共用。
|
|
23
23
|
// 不能在 patch 上再声明一遍:commander 遇到父子同名 option 会把值判给父命令,
|
|
24
24
|
// 子命令拿到空数组,`deploy patch --create x` 会静默失效(deploy-patch-wiring 测试可复现)。
|
|
@@ -66,6 +66,9 @@ function registerDeployCommandsModern(program) {
|
|
|
66
66
|
sessionID 发起本次发布的页面会话 ID,原样透传不做净化
|
|
67
67
|
marker 本次发布的变更说明,落发布单 description
|
|
68
68
|
四字段均可选;非法 JSON / 非对象 / 字段值非字符串会报错。
|
|
69
|
+
versionLevel:本次发布的版本档位。"major" 声明这是一个大版本,历史记录里强制开新组;
|
|
70
|
+
"minor" 声明是小版本,即使距上次发布超过聚合阈值也不提升。不传则由服务端按
|
|
71
|
+
时间间隔自动判定,与改造前行为一致——只有会主动声明档位的链路需要传。
|
|
69
72
|
|
|
70
73
|
JSON 输出(stdout)
|
|
71
74
|
{"data": {"appId": "...", "version": <n>, "url": "...", "releaseID": "...", "preReleaseID": "..."}}
|
|
@@ -12,9 +12,9 @@ const error_1 = require("../../../utils/error");
|
|
|
12
12
|
const index_1 = require("../../../services/deploy/modern/index");
|
|
13
13
|
const index_2 = require("../../../services/deploy/modern/patch/index");
|
|
14
14
|
const logger_1 = require("../../../utils/logger");
|
|
15
|
-
const CONF_EXPECTED = '期望形如 {"checkPointVersion":"...","commitID":"...","sessionID":"...","marker":"..."} 的 JSON 对象';
|
|
15
|
+
const CONF_EXPECTED = '期望形如 {"checkPointVersion":"...","commitID":"...","sessionID":"...","marker":"...","versionLevel":"major"} 的 JSON 对象';
|
|
16
16
|
/**
|
|
17
|
-
* 解析 `--conf` JSON string,只取 checkPointVersion / commitID / sessionID / marker
|
|
17
|
+
* 解析 `--conf` JSON string,只取 checkPointVersion / commitID / sessionID / marker / versionLevel 五个白名单字段。
|
|
18
18
|
* - 未传 → 返回 {}(行为不变)。
|
|
19
19
|
* - 非法 JSON / 非 object / 字段值非 string → 抛 DEPLOY_CONF_INVALID。
|
|
20
20
|
* - 空串字段视为未提供(不进 body,保持可选语义);未知 key 忽略。
|
|
@@ -34,7 +34,13 @@ function parseDeployConf(raw) {
|
|
|
34
34
|
}
|
|
35
35
|
const source = parsed;
|
|
36
36
|
const conf = {};
|
|
37
|
-
for (const key of [
|
|
37
|
+
for (const key of [
|
|
38
|
+
'checkPointVersion',
|
|
39
|
+
'commitID',
|
|
40
|
+
'sessionID',
|
|
41
|
+
'marker',
|
|
42
|
+
'versionLevel',
|
|
43
|
+
]) {
|
|
38
44
|
const value = source[key];
|
|
39
45
|
if (value === undefined)
|
|
40
46
|
continue;
|
|
@@ -86,6 +92,7 @@ async function handleDeployModern(opts) {
|
|
|
86
92
|
commitID: conf.commitID,
|
|
87
93
|
sessionID: conf.sessionID,
|
|
88
94
|
marker: conf.marker,
|
|
95
|
+
versionLevel: conf.versionLevel,
|
|
89
96
|
changedFiles: parseChangedFiles(opts),
|
|
90
97
|
});
|
|
91
98
|
(0, output_1.emit)({
|
package/dist/utils/http.js
CHANGED
|
@@ -64,13 +64,13 @@ function createClient(opts) {
|
|
|
64
64
|
* 默认灰度泳道。当前 miaoda CLI 接入的新接口(modern deploy 等)只在该泳道生效,
|
|
65
65
|
* 缺省走这个。MIAODA_CANARY_HEADER 可显式覆盖;设为空字符串则去掉头。
|
|
66
66
|
*
|
|
67
|
-
* ⚠️ TEMP(creative-upgrade 联调用):默认泳道临时指向开发泳道
|
|
67
|
+
* ⚠️ TEMP(creative-upgrade 联调用):默认泳道临时指向开发泳道 boe_creative_history,
|
|
68
68
|
* 使 alpha 发版进沙箱镜像后,app export / code-archive 等新接口无需 wrapper 即可命中
|
|
69
69
|
* 尚未合流的 studio_server 改动。
|
|
70
70
|
* 上线前必须还原为 'boe_miaoda_ccm',或改为由 agent_tool 按请求 x-tt-env 注入
|
|
71
71
|
* MIAODA_CANARY_HEADER(详见 http.ts 的 applyCanaryHeader 与 agent_tool ExecShellCmd)。
|
|
72
72
|
*/
|
|
73
|
-
const DEFAULT_CANARY_HEADER = '
|
|
73
|
+
const DEFAULT_CANARY_HEADER = 'boe_creative_history';
|
|
74
74
|
/**
|
|
75
75
|
* 注入 x-tt-env 小流量头:env 显式设值 > DEFAULT_CANARY_HEADER。
|
|
76
76
|
*
|