Skip to content

Commit 6898df3

Browse files
committed
feat(issue-553): improve draft PR body with issue context and Fixes keyword
- Make PRManager.issuePrefix public for LoomManager access - Draft PR body now includes issue title, body, and uses Fixes keyword - Uses configured issue prefix instead of hardcoded # - Update tests for new draft PR body format
1 parent 807fbf3 commit 6898df3

4 files changed

Lines changed: 11 additions & 6 deletions

File tree

.iloom/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"agents": {
1313
"iloom-issue-analyzer": { "model": "opus" },
1414
"iloom-issue-planner": { "model": "opus", "review": true },
15-
"iloom-issue-analyze-and-plan": { "model": "opus" },
15+
"iloom-issue-analyze-and-plan": { "model": "opus", "review": true },
1616
"iloom-issue-implementer": { "model": "opus" },
1717
"iloom-code-reviewer": { "providers": { "gemini": "gemini-3-pro-preview" } },
1818
"iloom-artifact-reviewer": { "enabled": true, "providers": { "gemini": "gemini-3-pro-preview" } }

src/lib/LoomManager.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ vi.mock('./PRManager.js', () => {
125125
PRManager: class MockPRManager {
126126
createDraftPR = mockCreateDraftPR
127127
checkForExistingPR = mockCheckForExistingPR
128+
issuePrefix = '#'
128129
},
129130
}
130131
})
@@ -530,7 +531,7 @@ describe('LoomManager', () => {
530531
expect(mockCreateDraftPR).toHaveBeenCalledWith(
531532
expect.any(String), // branch name
532533
'Test Linear Issue', // PR title from issue
533-
expect.stringContaining('PR for issue'), // PR body
534+
expect.stringContaining('Fixes #123'), // PR body with Fixes keyword and issue prefix
534535
expectedPath // worktree path
535536
)
536537

src/lib/LoomManager.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -276,9 +276,13 @@ export class LoomManager {
276276
// For issue mode: use issue title and reference issue number
277277
// For branch mode: use branch name and generic description
278278
const prTitle = issueData?.title ?? `Work on ${branchName}`
279-
const prBody = input.type === 'issue'
280-
? `PR for issue #${input.identifier}\n\nThis PR was created automatically by iloom.`
281-
: `Branch: ${branchName}\n\nThis PR was created automatically by iloom.`
279+
let prBody: string
280+
if (input.type === 'issue') {
281+
const issueBody = issueData?.body ? `\n\n## ${issueData.title}\n\n${issueData.body}` : ''
282+
prBody = `Fixes ${prManager.issuePrefix}${input.identifier}${issueBody}\n\n---\n*This PR was created automatically by iloom.*`
283+
} else {
284+
prBody = `Branch: ${branchName}\n\n---\n*This PR was created automatically by iloom.*`
285+
}
282286

283287
// Create draft PR
284288
getLogger().info('Creating draft PR...')

src/lib/PRManager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export class PRManager {
2525
/**
2626
* Get the issue prefix from the configured provider
2727
*/
28-
private get issuePrefix(): string {
28+
public get issuePrefix(): string {
2929
const providerType = this.settings.issueManagement?.provider ?? 'github'
3030
const provider = IssueManagementProviderFactory.create(providerType)
3131
return provider.issuePrefix

0 commit comments

Comments
 (0)