From a4940338e5e0028e3645499beaf921d148d8b2ce Mon Sep 17 00:00:00 2001 From: Pravus Date: Tue, 5 May 2026 17:44:04 +0200 Subject: [PATCH 1/5] chore: PR claude bot comments deduplication Added cleanup logic for previous Claude comments in the review process. Signed-off-by: Pravus --- .github/workflows/claude-pr-review.yml | 34 ++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/.github/workflows/claude-pr-review.yml b/.github/workflows/claude-pr-review.yml index 9842028d831..4c5ab8a829f 100644 --- a/.github/workflows/claude-pr-review.yml +++ b/.github/workflows/claude-pr-review.yml @@ -105,6 +105,23 @@ jobs: const output = claudeComment?.body ?? ''; console.log('Claude comment preview:', output.slice(0, 300)); + + // Previous Claude comments cleanup + const allClaudeComments = comments.data.filter(c => c.user?.login === 'claude[bot]'); + for (const c of allClaudeComments) { + if (claudeComment && c.id !== claudeComment.id) { + try { + await github.rest.issues.deleteComment({ + owner: context.repo.owner, + repo: context.repo.repo, + comment_id: c.id + }); + console.log(`Removed previous Claude review comment ${c.id}`); + } catch (e) { + console.log(`Failed to remove comment ${c.id}: ${e.message}`); + } + } + } const failed = output.includes('REVIEW_RESULT: FAIL'); const errored = '${{ steps.claude.outcome }}' === 'failure'; @@ -302,6 +319,23 @@ jobs: const output = claudeComment?.body ?? ''; console.log('Claude comment preview:', output.slice(0, 200)); + // Previous Claude comments cleanup + const allClaudeComments = comments.data.filter(c => c.user?.login === 'claude[bot]'); + for (const c of allClaudeComments) { + if (claudeComment && c.id !== claudeComment.id) { + try { + await github.rest.issues.deleteComment({ + owner: context.repo.owner, + repo: context.repo.repo, + comment_id: c.id + }); + console.log(`Removed previous Claude review comment ${c.id}`); + } catch (e) { + console.log(`Failed to remove comment ${c.id}: ${e.message}`); + } + } + } + const failed = output.includes('REVIEW_RESULT: FAIL'); const errored = '${{ steps.claude.outcome }}' === 'failure'; const hasReviewResult = output.includes('REVIEW_RESULT:'); From 91362240feeddbe18a47789cb50b1184bda7c8a2 Mon Sep 17 00:00:00 2001 From: Pravus Date: Wed, 6 May 2026 14:07:54 +0200 Subject: [PATCH 2/5] Update .github/workflows/claude-pr-review.yml Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> Signed-off-by: Pravus --- .github/workflows/claude-pr-review.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/claude-pr-review.yml b/.github/workflows/claude-pr-review.yml index 4c5ab8a829f..63ef4b722c5 100644 --- a/.github/workflows/claude-pr-review.yml +++ b/.github/workflows/claude-pr-review.yml @@ -107,7 +107,7 @@ jobs: console.log('Claude comment preview:', output.slice(0, 300)); // Previous Claude comments cleanup - const allClaudeComments = comments.data.filter(c => c.user?.login === 'claude[bot]'); + const allClaudeComments = [...comments.data].filter(c => c.user?.login === 'claude[bot]'); for (const c of allClaudeComments) { if (claudeComment && c.id !== claudeComment.id) { try { From 441d15dfeb7c3861ea1efbfa69b1d6cdf7f2a8bf Mon Sep 17 00:00:00 2001 From: Pravus Date: Wed, 6 May 2026 14:08:03 +0200 Subject: [PATCH 3/5] Update .github/workflows/claude-pr-review.yml Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> Signed-off-by: Pravus --- .github/workflows/claude-pr-review.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/claude-pr-review.yml b/.github/workflows/claude-pr-review.yml index 63ef4b722c5..6f88bd3ca27 100644 --- a/.github/workflows/claude-pr-review.yml +++ b/.github/workflows/claude-pr-review.yml @@ -109,7 +109,7 @@ jobs: // Previous Claude comments cleanup const allClaudeComments = [...comments.data].filter(c => c.user?.login === 'claude[bot]'); for (const c of allClaudeComments) { - if (claudeComment && c.id !== claudeComment.id) { + if (claudeComment && c.id !== claudeComment.id && c.body?.includes('REVIEW_RESULT:')) { try { await github.rest.issues.deleteComment({ owner: context.repo.owner, From 82789001ec428a05292903fb073c92f64032bf3e Mon Sep 17 00:00:00 2001 From: Pravus Date: Wed, 6 May 2026 14:08:24 +0200 Subject: [PATCH 4/5] Update .github/workflows/claude-pr-review.yml Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> Signed-off-by: Pravus --- .github/workflows/claude-pr-review.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/claude-pr-review.yml b/.github/workflows/claude-pr-review.yml index 6f88bd3ca27..62b2bdb2c50 100644 --- a/.github/workflows/claude-pr-review.yml +++ b/.github/workflows/claude-pr-review.yml @@ -320,7 +320,7 @@ jobs: console.log('Claude comment preview:', output.slice(0, 200)); // Previous Claude comments cleanup - const allClaudeComments = comments.data.filter(c => c.user?.login === 'claude[bot]'); + const allClaudeComments = [...comments.data].filter(c => c.user?.login === 'claude[bot]'); for (const c of allClaudeComments) { if (claudeComment && c.id !== claudeComment.id) { try { From 0786e9f230df4083001172319f1fbce33e66f457 Mon Sep 17 00:00:00 2001 From: Pravus Date: Wed, 6 May 2026 14:08:34 +0200 Subject: [PATCH 5/5] Update .github/workflows/claude-pr-review.yml Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> Signed-off-by: Pravus --- .github/workflows/claude-pr-review.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/claude-pr-review.yml b/.github/workflows/claude-pr-review.yml index 62b2bdb2c50..09e70cefd3d 100644 --- a/.github/workflows/claude-pr-review.yml +++ b/.github/workflows/claude-pr-review.yml @@ -322,7 +322,7 @@ jobs: // Previous Claude comments cleanup const allClaudeComments = [...comments.data].filter(c => c.user?.login === 'claude[bot]'); for (const c of allClaudeComments) { - if (claudeComment && c.id !== claudeComment.id) { + if (claudeComment && c.id !== claudeComment.id && c.body?.includes('REVIEW_RESULT:')) { try { await github.rest.issues.deleteComment({ owner: context.repo.owner,