@waron97/prbot 2.0.0 → 2.1.0
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/package.json +1 -1
- package/src/commands/autopr.js +5 -1
- package/src/commands/init.js +6 -3
package/package.json
CHANGED
package/src/commands/autopr.js
CHANGED
|
@@ -43,6 +43,7 @@ async function fetchTask(taskId) {
|
|
|
43
43
|
"name",
|
|
44
44
|
"x_subpackage_id",
|
|
45
45
|
"x_workflow",
|
|
46
|
+
"x_cluster_id",
|
|
46
47
|
"x_release_checklist",
|
|
47
48
|
],
|
|
48
49
|
},
|
|
@@ -274,13 +275,16 @@ async function autopr(options) {
|
|
|
274
275
|
const anchor = tasks.find(
|
|
275
276
|
(t) =>
|
|
276
277
|
(Array.isArray(t.x_subpackage_id) && t.x_subpackage_id[1]) ||
|
|
277
|
-
(Array.isArray(t.x_workflow) && t.x_workflow[1])
|
|
278
|
+
(Array.isArray(t.x_workflow) && t.x_workflow[1]) ||
|
|
279
|
+
(Array.isArray(t.x_cluster_id) && t.x_cluster_id[1]),
|
|
278
280
|
);
|
|
279
281
|
if (anchor) {
|
|
280
282
|
if (Array.isArray(anchor.x_subpackage_id) && anchor.x_subpackage_id[1])
|
|
281
283
|
candidates.push(anchor.x_subpackage_id[1]);
|
|
282
284
|
if (Array.isArray(anchor.x_workflow) && anchor.x_workflow[1])
|
|
283
285
|
candidates.push(anchor.x_workflow[1]);
|
|
286
|
+
if (Array.isArray(anchor.x_cluster_id) && anchor.x_cluster_id[1])
|
|
287
|
+
candidates.push(anchor.x_cluster_id[1]);
|
|
284
288
|
}
|
|
285
289
|
}
|
|
286
290
|
|
package/src/commands/init.js
CHANGED
|
@@ -41,8 +41,7 @@ async function init(completion) {
|
|
|
41
41
|
{
|
|
42
42
|
type: "password",
|
|
43
43
|
name: "KC_PASSWORD",
|
|
44
|
-
message:
|
|
45
|
-
default: existing.KC_PASSWORD ?? "",
|
|
44
|
+
message: `Keycloak password${existing.KC_PASSWORD ? " (leave blank to keep existing)" : ""}:`,
|
|
46
45
|
mask: "*",
|
|
47
46
|
},
|
|
48
47
|
{
|
|
@@ -109,7 +108,7 @@ async function init(completion) {
|
|
|
109
108
|
type: "input",
|
|
110
109
|
name: "TRIDENT_DB",
|
|
111
110
|
message: "Trident DB name:",
|
|
112
|
-
default: existing.TRIDENT_DB ?? "",
|
|
111
|
+
default: existing.TRIDENT_DB ?? "trident-agora",
|
|
113
112
|
},
|
|
114
113
|
{
|
|
115
114
|
type: "input",
|
|
@@ -119,6 +118,10 @@ async function init(completion) {
|
|
|
119
118
|
},
|
|
120
119
|
]);
|
|
121
120
|
|
|
121
|
+
if (!answers.KC_PASSWORD && existing.KC_PASSWORD) {
|
|
122
|
+
answers.KC_PASSWORD = existing.KC_PASSWORD;
|
|
123
|
+
}
|
|
124
|
+
|
|
122
125
|
writeFileSync(
|
|
123
126
|
CONFIG_FILE,
|
|
124
127
|
Object.entries(answers)
|