@blogic-cz/agent-tools 0.14.57 → 0.14.58
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/package.json +1 -1
- package/src/gh-tool/pr/review.ts +8 -1
- package/src/gh-tool/types.ts +2 -0
package/package.json
CHANGED
package/src/gh-tool/pr/review.ts
CHANGED
|
@@ -368,6 +368,7 @@ const enrichThreads = (threads: ThreadNode[], reviewComments: ReviewComment[]):
|
|
|
368
368
|
isVisibleOpen: !node.isResolved || needsHumanReply,
|
|
369
369
|
lastReplyAuthor: lastReply?.author ?? null,
|
|
370
370
|
lastReplyAt: lastReply?.createdAt ?? null,
|
|
371
|
+
duplicateThreadIds: [] as string[],
|
|
371
372
|
};
|
|
372
373
|
})
|
|
373
374
|
.filter((thread): thread is ReviewThread => thread !== null);
|
|
@@ -383,8 +384,14 @@ const enrichThreads = (threads: ThreadNode[], reviewComments: ReviewComment[]):
|
|
|
383
384
|
continue;
|
|
384
385
|
}
|
|
385
386
|
const existing = deduped[existingIndex];
|
|
386
|
-
if (existing
|
|
387
|
+
if (existing === undefined) {
|
|
388
|
+
continue;
|
|
389
|
+
}
|
|
390
|
+
if (existing.isResolved && !thread.isResolved) {
|
|
391
|
+
thread.duplicateThreadIds = [existing.threadId, ...existing.duplicateThreadIds];
|
|
387
392
|
deduped[existingIndex] = thread;
|
|
393
|
+
} else {
|
|
394
|
+
existing.duplicateThreadIds.push(thread.threadId);
|
|
388
395
|
}
|
|
389
396
|
}
|
|
390
397
|
|
package/src/gh-tool/types.ts
CHANGED
|
@@ -37,6 +37,8 @@ export type ReviewThread = {
|
|
|
37
37
|
isVisibleOpen: boolean;
|
|
38
38
|
lastReplyAuthor: string | null;
|
|
39
39
|
lastReplyAt: string | null;
|
|
40
|
+
/** Thread ids of exact duplicates collapsed into this representative (encounter order). */
|
|
41
|
+
duplicateThreadIds: string[];
|
|
40
42
|
};
|
|
41
43
|
|
|
42
44
|
export type ReviewComment = {
|