MCPcopy Index your code
hub / github.com/kirodotdev/Kiro / generateDuplicateComment

Function generateDuplicateComment

scripts/detect_duplicates.ts:442–471  ·  view source on GitHub ↗
(duplicates: DuplicateMatch[])

Source from the content-addressed store, hash-verified

440 * Generate duplicate comment text
441 */
442export function generateDuplicateComment(duplicates: DuplicateMatch[]): string {
443 if (duplicates.length === 0) {
444 return "";
445 }
446
447 const DUPLICATE_CLOSE_DAYS = 3;
448
449 const duplicateList = duplicates
450 .map(
451 (dup) =>
452 `\n- [#${dup.issue_number}: ${dup.issue_title}](${dup.url}) (${(
453 dup.similarity_score * 100
454 ).toFixed(0)}% similar)`
455 )
456 .join("");
457
458 const comment = `🤖 **Potential Duplicate Detected**
459
460This issue appears to be similar to:${duplicateList}
461
462**What happens next?**
463- ⏰ This issue will be automatically closed in ${DUPLICATE_CLOSE_DAYS} days
464- 🏷️ If this is not a duplicate, you can prevent automatic closure by adding a comment or reacting with 👎 to this message.
465- 💬 Comment on the original issue if you have additional information
466
467**Why is this marked as duplicate?**
468${duplicates[0].reasoning}`;
469
470 return comment;
471}
472
473/**
474 * Post duplicate comment to issue

Callers 3

postDuplicateCommentFunction · 0.85
testDuplicateDetectionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected