@kody-ade/kody-engine-lite 0.1.36 → 0.1.38
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/bin/cli.js +35 -29
- package/package.json +1 -1
- package/templates/kody.yml +6 -1
package/dist/bin/cli.js
CHANGED
|
@@ -2193,13 +2193,13 @@ async function runPipelineInner(ctx) {
|
|
|
2193
2193
|
outputFile: result.outputFile
|
|
2194
2194
|
};
|
|
2195
2195
|
logger.info(`[${def.name}] \u2713 completed`);
|
|
2196
|
-
const paused = checkQuestionsAfterStage(ctx, def, state);
|
|
2197
|
-
if (paused) return paused;
|
|
2198
2196
|
const detected = autoDetectComplexity(ctx, def);
|
|
2199
2197
|
if (detected) {
|
|
2200
2198
|
complexity = detected.complexity;
|
|
2201
2199
|
activeStages = detected.activeStages;
|
|
2202
2200
|
}
|
|
2201
|
+
const paused = checkQuestionsAfterStage(ctx, def, state);
|
|
2202
|
+
if (paused) return paused;
|
|
2203
2203
|
const gated = checkRiskGate(ctx, def, state, complexity);
|
|
2204
2204
|
if (gated) return gated;
|
|
2205
2205
|
commitAfterStage(ctx, def);
|
|
@@ -2573,6 +2573,9 @@ function resolveForIssue(issueNumber, projectDir) {
|
|
|
2573
2573
|
if (labels.includes("kody:done")) {
|
|
2574
2574
|
return { action: "already-completed", taskId: `${issueNumber}-unknown` };
|
|
2575
2575
|
}
|
|
2576
|
+
if (labels.includes("kody:waiting")) {
|
|
2577
|
+
return { action: "resume", taskId: `${issueNumber}-${generateTaskId()}`, fromStage: "build" };
|
|
2578
|
+
}
|
|
2576
2579
|
} catch {
|
|
2577
2580
|
}
|
|
2578
2581
|
return resolveTaskAction(issueNumber, null, null);
|
|
@@ -2603,37 +2606,40 @@ async function main() {
|
|
|
2603
2606
|
setGhCwd(projectDir);
|
|
2604
2607
|
logger.info(`Working directory: ${projectDir}`);
|
|
2605
2608
|
}
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
logger.info(`
|
|
2611
|
-
if (
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
postComment(input.issueNumber, `\u2705 Issue #${input.issueNumber} already completed (task \`${taskAction.taskId}\`)`);
|
|
2616
|
-
} catch {
|
|
2617
|
-
}
|
|
2609
|
+
if (input.issueNumber) {
|
|
2610
|
+
const taskAction = resolveForIssue(input.issueNumber, projectDir);
|
|
2611
|
+
logger.info(`Task action: ${taskAction.action}`);
|
|
2612
|
+
if (taskAction.action === "already-completed") {
|
|
2613
|
+
logger.info(`Issue #${input.issueNumber} already completed (task ${taskAction.taskId})`);
|
|
2614
|
+
if (!input.local) {
|
|
2615
|
+
try {
|
|
2616
|
+
postComment(input.issueNumber, `\u2705 Issue #${input.issueNumber} already completed (task \`${taskAction.taskId}\`)`);
|
|
2617
|
+
} catch {
|
|
2618
2618
|
}
|
|
2619
|
-
process.exit(0);
|
|
2620
2619
|
}
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
}
|
|
2620
|
+
process.exit(0);
|
|
2621
|
+
}
|
|
2622
|
+
if (taskAction.action === "already-running") {
|
|
2623
|
+
logger.info(`Issue #${input.issueNumber} already running (task ${taskAction.taskId})`);
|
|
2624
|
+
if (!input.local) {
|
|
2625
|
+
try {
|
|
2626
|
+
postComment(input.issueNumber, `\u23F3 Pipeline already running for issue #${input.issueNumber} (task \`${taskAction.taskId}\`)`);
|
|
2627
|
+
} catch {
|
|
2628
2628
|
}
|
|
2629
|
-
process.exit(0);
|
|
2630
|
-
}
|
|
2631
|
-
taskId = taskAction.taskId;
|
|
2632
|
-
if (taskAction.action === "resume") {
|
|
2633
|
-
input.fromStage = taskAction.fromStage;
|
|
2634
|
-
input.command = "rerun";
|
|
2635
|
-
logger.info(`Resuming task ${taskId} from ${taskAction.fromStage}`);
|
|
2636
2629
|
}
|
|
2630
|
+
process.exit(0);
|
|
2631
|
+
}
|
|
2632
|
+
if (taskAction.action === "resume") {
|
|
2633
|
+
input.taskId = taskAction.taskId;
|
|
2634
|
+
input.fromStage = taskAction.fromStage;
|
|
2635
|
+
input.command = "rerun";
|
|
2636
|
+
logger.info(`Resuming task ${taskAction.taskId} from ${taskAction.fromStage}`);
|
|
2637
|
+
}
|
|
2638
|
+
}
|
|
2639
|
+
let taskId = input.taskId;
|
|
2640
|
+
if (!taskId) {
|
|
2641
|
+
if (input.issueNumber) {
|
|
2642
|
+
taskId = `${input.issueNumber}-${generateTaskId()}`;
|
|
2637
2643
|
} else if (input.command === "run" && input.task) {
|
|
2638
2644
|
taskId = generateTaskId();
|
|
2639
2645
|
} else {
|
package/package.json
CHANGED
package/templates/kody.yml
CHANGED
|
@@ -97,7 +97,12 @@ jobs:
|
|
|
97
97
|
# Extract: @kody [mode] [task-id] [--from stage]
|
|
98
98
|
KODY_ARGS=$(echo "$BODY" | grep -oP '(?:@kody|/kody)\s+\K.*' || echo "")
|
|
99
99
|
MODE=$(echo "$KODY_ARGS" | awk '{print $1}')
|
|
100
|
-
|
|
100
|
+
RAW_TASK_ID=$(echo "$KODY_ARGS" | awk '{print $2}')
|
|
101
|
+
# Don't treat flags (--from, --feedback) as task IDs
|
|
102
|
+
case "$RAW_TASK_ID" in
|
|
103
|
+
--*) TASK_ID="" ;;
|
|
104
|
+
*) TASK_ID="$RAW_TASK_ID" ;;
|
|
105
|
+
esac
|
|
101
106
|
FROM_STAGE=$(echo "$KODY_ARGS" | grep -oP '(?<=--from )\S+' || echo "")
|
|
102
107
|
FEEDBACK=$(echo "$KODY_ARGS" | grep -oP '(?<=--feedback ")[^"]*' || echo "")
|
|
103
108
|
|