@tarcisiopgs/lisa 1.40.1 → 1.40.2
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.
|
@@ -1238,17 +1238,48 @@ async function pullBaseBranch(config) {
|
|
|
1238
1238
|
}
|
|
1239
1239
|
}
|
|
1240
1240
|
}
|
|
1241
|
+
var AUTO_MERGE_CI_TIMEOUT_MS = 10 * 60 * 1e3;
|
|
1242
|
+
var AUTO_MERGE_POLL_MS = 15e3;
|
|
1241
1243
|
async function autoMergePr(prUrl, issueId, config) {
|
|
1242
1244
|
if (!config.pr?.auto_merge) return;
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1245
|
+
const { checkPrCiStatus, mergePr } = await import("./merge-NWSEV3FR.js");
|
|
1246
|
+
log(`Waiting for CI before auto-merge of ${issueId}...`);
|
|
1247
|
+
kanbanEmitter.emit("issue:ci-status", issueId, "pending");
|
|
1248
|
+
const deadline = Date.now() + AUTO_MERGE_CI_TIMEOUT_MS;
|
|
1249
|
+
while (Date.now() < deadline) {
|
|
1250
|
+
if (isShuttingDown() || hasUserQuitFromWatchPrompt()) return;
|
|
1251
|
+
const ciStatus = await checkPrCiStatus(prUrl);
|
|
1252
|
+
if (ciStatus === "passing") {
|
|
1253
|
+
kanbanEmitter.emit("issue:ci-status", issueId, "passing");
|
|
1254
|
+
log(`CI passed for ${issueId}. Auto-merging...`);
|
|
1255
|
+
const result = await mergePr(prUrl);
|
|
1256
|
+
if (result.success) {
|
|
1257
|
+
ok(`Auto-merged: ${prUrl}`);
|
|
1258
|
+
kanbanEmitter.emit("issue:merged", issueId);
|
|
1259
|
+
} else {
|
|
1260
|
+
warn(`Auto-merge failed for ${issueId}: ${result.error}`);
|
|
1261
|
+
}
|
|
1262
|
+
return;
|
|
1263
|
+
}
|
|
1264
|
+
if (ciStatus === "failing") {
|
|
1265
|
+
kanbanEmitter.emit("issue:ci-status", issueId, "failing");
|
|
1266
|
+
warn(`CI failed for ${issueId}. Skipping auto-merge.`);
|
|
1267
|
+
return;
|
|
1268
|
+
}
|
|
1269
|
+
if (ciStatus === "unknown") {
|
|
1270
|
+
log(`No CI checks found for ${issueId}. Auto-merging...`);
|
|
1271
|
+
const result = await mergePr(prUrl);
|
|
1272
|
+
if (result.success) {
|
|
1273
|
+
ok(`Auto-merged: ${prUrl}`);
|
|
1274
|
+
kanbanEmitter.emit("issue:merged", issueId);
|
|
1275
|
+
} else {
|
|
1276
|
+
warn(`Auto-merge failed for ${issueId}: ${result.error}`);
|
|
1277
|
+
}
|
|
1278
|
+
return;
|
|
1279
|
+
}
|
|
1280
|
+
await sleep(AUTO_MERGE_POLL_MS);
|
|
1251
1281
|
}
|
|
1282
|
+
warn(`CI did not complete within timeout for ${issueId}. Skipping auto-merge.`);
|
|
1252
1283
|
}
|
|
1253
1284
|
function appendSessionLog(logFile, result) {
|
|
1254
1285
|
try {
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
runLoop,
|
|
15
15
|
saveConfig,
|
|
16
16
|
validateConfig
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-BI6MR2UP.js";
|
|
18
18
|
import {
|
|
19
19
|
CliError,
|
|
20
20
|
buildExecutionWaves,
|
|
@@ -1861,7 +1861,7 @@ async function reviewAndCreate(plan2, planPath, opts) {
|
|
|
1861
1861
|
log("Run `lisa run` when ready.");
|
|
1862
1862
|
return;
|
|
1863
1863
|
}
|
|
1864
|
-
const { runLoop: runLoop2 } = await import("./loop-
|
|
1864
|
+
const { runLoop: runLoop2 } = await import("./loop-RWZJG7BG.js");
|
|
1865
1865
|
const waves = buildExecutionWaves(plan2.issues);
|
|
1866
1866
|
const maxWaveSize = Math.max(...waves.map((w) => w.length));
|
|
1867
1867
|
await runLoop2(config2, {
|