Skip to content

Commit 313e611

Browse files
committed
minor fixes
1 parent 94aaace commit 313e611

3 files changed

Lines changed: 18 additions & 16 deletions

File tree

scripts/eternity-loop/workflows/ci-fix.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,6 @@ export class CiFixWorkflow implements Workflow {
127127
`🤖 **eternity-loop bot:** CI fix applied.\n\n<details><summary>Progress log</summary>\n\n${progress}\n\n</details>`,
128128
);
129129

130-
logWorkflow("ci-fix", `[ci-fix] Finalized CI fix for ${issue.identifier}`);
130+
logWorkflow("ci-fix", `[ci-fix] Finalized CI fix for ${issue.identifier} — https://github.com/${owner}/${repo}/pull/${issue.prNumber}`);
131131
}
132132
}

scripts/eternity-loop/workflows/new-feature.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import type { Workflow } from "./types";
22
import type { IssueProvider } from "../providers/types";
33
import type { Issue, WorkflowContext } from "../types";
4-
import { log, logDebug, logWorkflow, logPrdEntryCount } from "../logger";
4+
import { logDebug, logWorkflow, logPrdEntryCount } from "../logger";
55
import { ensureMainBranch, checkoutBranch, pushBranch } from "../git";
66
import { createGitHubClient, getRepoInfo } from "../github/client";
7-
import { createPr, postPrComment } from "../github/pr";
7+
import { createPr, postPrComment, findPrByBranch } from "../github/pr";
88
import { readPrompt } from "../prompts";
99
import { ClaudeCliRunner } from "../ai-runner";
1010
import { join } from "node:path";
@@ -29,13 +29,13 @@ export class NewFeatureWorkflow implements Workflow {
2929
return null;
3030
}
3131

32-
log(`[new-feature] Found ${count} Todo issues to implement`);
33-
log(`[new-feature] Found Todo issue: ${issues[0].identifier}`);
32+
logWorkflow("new-feature", `[new-feature] Found ${count} Todo issues to implement`);
33+
logWorkflow("new-feature", `[new-feature] Found Todo issue: ${issues[0].identifier}`);
3434
return issues[0];
3535
}
3636

3737
async prepare(ctx: WorkflowContext, issue: Issue): Promise<void> {
38-
log(`[new-feature] Preparing new feature workflow for ${issue.identifier}`);
38+
logWorkflow("new-feature", `[new-feature] Preparing new feature workflow for ${issue.identifier}`);
3939

4040
// Reset to main branch
4141
await ensureMainBranch(ctx.workDir);
@@ -66,11 +66,11 @@ export class NewFeatureWorkflow implements Workflow {
6666
const claudeMdContent = await readPrompt("ralph-claude-md.md");
6767
await Bun.write(join(ctx.ralphDir, "CLAUDE.md"), claudeMdContent);
6868

69-
log(`[new-feature] Prepared feature PRD for ${issue.identifier}`);
69+
logWorkflow("new-feature", `[new-feature] Prepared feature PRD for ${issue.identifier}`);
7070
}
7171

7272
async finalize(ctx: WorkflowContext, issue: Issue, ralphExitCode: number): Promise<void> {
73-
log(`[new-feature] Finalizing new feature for ${issue.identifier} (exit: ${ralphExitCode})`);
73+
logWorkflow("new-feature", `[new-feature] Finalizing new feature for ${issue.identifier} (exit: ${ralphExitCode})`);
7474

7575
const octokit = createGitHubClient();
7676
const { owner, repo } = await getRepoInfo(ctx.workDir);
@@ -95,7 +95,7 @@ export class NewFeatureWorkflow implements Workflow {
9595
`🤖 **eternity-loop bot:** Feature implementation complete.\n\n<details><summary>Progress log</summary>\n\n${progress}\n\n</details>`,
9696
);
9797

98-
log(`[new-feature] Created PR ${pr.url}`);
98+
logWorkflow("new-feature", `[new-feature] Created PR ${pr.url}`);
9999
} else {
100100
// Create draft PR via AI runner
101101
const runner = new ClaudeCliRunner();
@@ -108,7 +108,9 @@ export class NewFeatureWorkflow implements Workflow {
108108

109109
await runner.run(fullPrompt, ctx.workDir);
110110

111-
log(`[new-feature] Created draft PR for ${issue.identifier}`);
111+
const draftPr = await findPrByBranch(octokit, owner, repo, issue.branchName);
112+
const draftUrl = draftPr ? draftPr.url : `https://github.com/${owner}/${repo}`;
113+
logWorkflow("new-feature", `[new-feature] Created draft PR for ${issue.identifier}${draftUrl}`);
112114
}
113115
}
114116
}

scripts/eternity-loop/workflows/review.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { Workflow } from "./types";
22
import type { IssueProvider } from "../providers/types";
33
import type { Issue, WorkflowContext } from "../types";
4-
import { log, logDebug, logPrdEntryCount } from "../logger";
4+
import { logDebug, logWorkflow, logPrdEntryCount } from "../logger";
55
import { checkoutBranch, pushBranch, getLatestCommitDate } from "../git";
66
import { createGitHubClient, getRepoInfo } from "../github/client";
77
import { findPrByBranch, getPrComments, postPrComment, checkForNewHumanComments, countWorkflowRunsSinceLastHumanInteraction } from "../github/pr";
@@ -57,7 +57,7 @@ export class ReviewWorkflow implements Workflow {
5757
}
5858

5959
commentCount++;
60-
log(`[review] Found issue ${issue.identifier} with new PR comments`);
60+
logWorkflow("review", `[review] Found issue ${issue.identifier} with new PR comments`);
6161
issue.prNumber = pr.number;
6262
return issue;
6363
}
@@ -71,7 +71,7 @@ export class ReviewWorkflow implements Workflow {
7171
}
7272

7373
async prepare(ctx: WorkflowContext, issue: Issue): Promise<void> {
74-
log(`[review] Preparing review workflow for ${issue.identifier}`);
74+
logWorkflow("review", `[review] Preparing review workflow for ${issue.identifier}`);
7575

7676
const octokit = createGitHubClient();
7777
const { owner, repo } = await getRepoInfo(ctx.workDir);
@@ -113,11 +113,11 @@ export class ReviewWorkflow implements Workflow {
113113
const claudeMdContent = await readPrompt("ralph-claude-md.md");
114114
await Bun.write(join(ctx.ralphDir, "CLAUDE.md"), claudeMdContent);
115115

116-
log(`[review] Prepared review PRD for ${issue.identifier}`);
116+
logWorkflow("review", `[review] Prepared review PRD for ${issue.identifier}`);
117117
}
118118

119119
async finalize(ctx: WorkflowContext, issue: Issue, ralphExitCode: number): Promise<void> {
120-
log(`[review] Finalizing review workflow for ${issue.identifier} (exit: ${ralphExitCode})`);
120+
logWorkflow("review", `[review] Finalizing review workflow for ${issue.identifier} (exit: ${ralphExitCode})`);
121121

122122
const octokit = createGitHubClient();
123123
const { owner, repo } = await getRepoInfo(ctx.workDir);
@@ -143,6 +143,6 @@ export class ReviewWorkflow implements Workflow {
143143
`🤖 **eternity-loop bot:** Review changes applied.\n\n<details><summary>Progress log</summary>\n\n${progress}\n\n</details>`,
144144
);
145145

146-
log(`[review] Finalized review for ${issue.identifier}`);
146+
logWorkflow("review", `[review] Finalized review for ${issue.identifier} — https://github.com/${owner}/${repo}/pull/${issue.prNumber}`);
147147
}
148148
}

0 commit comments

Comments
 (0)