@jira-deploy/core 1.0.11 → 1.0.13
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/constants/config.js +183 -0
- package/constants/defaults.js +4 -38
- package/constants/environments.js +7 -29
- package/constants/field-ids.js +9 -41
- package/constants/index.js +3 -1
- package/constants/issue-types.js +7 -19
- package/constants/modules.js +5 -32
- package/constants/repos.js +5 -53
- package/constants/server.js +5 -98
- package/constants/system-codes.js +9 -68
- package/constants/users.js +4 -24
- package/jira-client.js +6 -3
- package/package.json +17 -5
- package/platform-config.js +2 -7
- package/scripts/jabber_notify.py +2 -2
- package/tools/grayrelease.js +43 -32
- package/tools/helpers.js +6 -22
- package/tools/index.js +16 -16
- package/tools/jabber.js +3 -3
- package/tools/release.js +17 -11
- package/dry-run.js +0 -695
- package/tools/ci.test.js +0 -154
- package/tools/jabber.test.js +0 -54
- package/tools/release.test.js +0 -137
- package/tools.test.js +0 -2775
package/tools/release.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import https from 'https';
|
|
9
9
|
import http from 'http';
|
|
10
10
|
import { error, getModuleName, ok } from './helpers.js';
|
|
11
|
-
import { SYSTEM_CODES, SYSTEM_MODULES
|
|
11
|
+
import {getDeployConfig, getReleaseProjectKey, SYSTEM_CODES, SYSTEM_MODULES} from '../constants/index.js';
|
|
12
12
|
|
|
13
13
|
// ── Schema definitions ───────────────────────────────────────────
|
|
14
14
|
export function getReleaseToolDefinitions() {
|
|
@@ -16,7 +16,7 @@ export function getReleaseToolDefinitions() {
|
|
|
16
16
|
{
|
|
17
17
|
name: 'get_unreleased_versions',
|
|
18
18
|
description:
|
|
19
|
-
'查詢
|
|
19
|
+
'查詢 release 專案所有 unreleased versions。可依 systemCode 篩選,自動解析版本名稱為 module + branch。',
|
|
20
20
|
inputSchema: {
|
|
21
21
|
type: 'object',
|
|
22
22
|
required: [],
|
|
@@ -29,7 +29,7 @@ export function getReleaseToolDefinitions() {
|
|
|
29
29
|
},
|
|
30
30
|
projectKey: {
|
|
31
31
|
type: 'string',
|
|
32
|
-
description: '(選填) Jira 專案 key
|
|
32
|
+
description: '(選填) Jira 專案 key,預設讀 JIRA_RELEASE_PROJECT_KEY 或 JIRA_DEPLOY_CONFIG_PATH',
|
|
33
33
|
},
|
|
34
34
|
},
|
|
35
35
|
},
|
|
@@ -52,7 +52,7 @@ export function getReleaseToolDefinitions() {
|
|
|
52
52
|
{
|
|
53
53
|
name: 'get_release_manager',
|
|
54
54
|
description:
|
|
55
|
-
'查詢指定日期的
|
|
55
|
+
'查詢指定日期的 release 值班人員(從 Confluence Team Calendar 讀取 Sign off staff 事件)。',
|
|
56
56
|
inputSchema: {
|
|
57
57
|
type: 'object',
|
|
58
58
|
required: [],
|
|
@@ -67,7 +67,7 @@ export function getReleaseToolDefinitions() {
|
|
|
67
67
|
{
|
|
68
68
|
name: 'wait_for_comment',
|
|
69
69
|
description:
|
|
70
|
-
'輪詢等待 Jira issue 出現包含特定關鍵字的 comment
|
|
70
|
+
'輪詢等待 Jira issue 出現包含特定關鍵字的 comment。可選擇限定 comment 作者。',
|
|
71
71
|
inputSchema: {
|
|
72
72
|
type: 'object',
|
|
73
73
|
required: ['issueKey', 'keyword'],
|
|
@@ -82,7 +82,7 @@ export function getReleaseToolDefinitions() {
|
|
|
82
82
|
},
|
|
83
83
|
authorAccountId: {
|
|
84
84
|
type: 'string',
|
|
85
|
-
description: '(選填) 限定特定用戶的 comment
|
|
85
|
+
description: '(選填) 限定特定用戶的 comment accountId',
|
|
86
86
|
},
|
|
87
87
|
timeoutMs: {
|
|
88
88
|
type: 'number',
|
|
@@ -102,7 +102,7 @@ export function getReleaseToolDefinitions() {
|
|
|
102
102
|
|
|
103
103
|
export async function handleGetUnreleasedVersions(args, { jira }) {
|
|
104
104
|
try {
|
|
105
|
-
const projectKey = args.projectKey ??
|
|
105
|
+
const projectKey = args.projectKey ?? getReleaseProjectKey();
|
|
106
106
|
const versions = await jira.getUnreleasedVersionsList(projectKey);
|
|
107
107
|
|
|
108
108
|
if (!args.systemCode) {
|
|
@@ -165,9 +165,12 @@ export async function handleGetReleaseManager(args, _ctx) {
|
|
|
165
165
|
return ok({
|
|
166
166
|
date,
|
|
167
167
|
found: true,
|
|
168
|
-
name:
|
|
168
|
+
name: getDeployConfig().release.dryRunManager.name,
|
|
169
169
|
dryRun: true,
|
|
170
|
-
event: {
|
|
170
|
+
event: {
|
|
171
|
+
what: 'Sign off staff',
|
|
172
|
+
who: `${getDeployConfig().release.dryRunManager.name} (${getDeployConfig().release.dryRunManager.accountId})`,
|
|
173
|
+
},
|
|
171
174
|
});
|
|
172
175
|
}
|
|
173
176
|
|
|
@@ -177,8 +180,11 @@ export async function handleGetReleaseManager(args, _ctx) {
|
|
|
177
180
|
return error('缺少環境變數 CONF_BASE_URL 或 CONF_TOKEN');
|
|
178
181
|
}
|
|
179
182
|
|
|
180
|
-
|
|
181
|
-
|
|
183
|
+
const SUB_CALENDAR_ID = process.env.CONF_RELEASE_MANAGER_SUB_CALENDAR_ID
|
|
184
|
+
?? getDeployConfig().release.managerSubCalendarId;
|
|
185
|
+
if (!SUB_CALENDAR_ID) {
|
|
186
|
+
return error('缺少環境變數 CONF_RELEASE_MANAGER_SUB_CALENDAR_ID 或 release.managerSubCalendarId config');
|
|
187
|
+
}
|
|
182
188
|
|
|
183
189
|
const nextDay = new Date(date);
|
|
184
190
|
nextDay.setDate(nextDay.getDate() + 1);
|