Skip to content

Commit 241893c

Browse files
authored
also delete table and summaries (#1961)
1 parent 54bb405 commit 241893c

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

backend/controllers/projects.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1561,6 +1561,21 @@ func DeleteOlderPRCommentsIfEnabled(gh utils.GithubClientProvider, batch *models
15611561
allDeletesSuccessful = false
15621562
}
15631563
}
1564+
// delete previous summary table
1565+
if prBatch.CommentId != nil {
1566+
err = prService.DeleteComment(strconv.FormatInt(*prBatch.CommentId, 10))
1567+
if err != nil {
1568+
slog.Warn("Could not delete summary comment for batch", "batchId", prBatch.ID, "commentID", prBatch.CommentId, "error", err)
1569+
}
1570+
}
1571+
1572+
// delete the summary comment
1573+
if prBatch.AiSummaryCommentId != "" {
1574+
err = prService.DeleteComment(prBatch.AiSummaryCommentId)
1575+
if err != nil {
1576+
slog.Warn("Could not delete AI summary comment for batch", "batchId", prBatch.ID, "commentID", prBatch.AiSummaryCommentId, "error", err)
1577+
}
1578+
}
15641579
}
15651580

15661581
slog.Debug("Deletion of prior comments complete", "allDeletesSuccessful", allDeletesSuccessful)

0 commit comments

Comments
 (0)