Skip to content

Commit 54bb405

Browse files
authored
add more debug logs in deletes (#1960)
1 parent 14ebf8f commit 54bb405

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

backend/controllers/projects.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1522,13 +1522,19 @@ func DeleteOlderPRCommentsIfEnabled(gh utils.GithubClientProvider, batch *models
15221522
return fmt.Errorf("error getting github service: %v", err)
15231523
}
15241524

1525+
slog.Debug("Found previous PR batches",
1526+
"len(prBatches)", len(prBatches),
1527+
)
1528+
15251529
for _, prBatch := range prBatches {
15261530
if prBatch.BatchType == orchestrator_scheduler.DiggerCommandApply {
15271531
slog.Info("found previous apply job for PR therefore not deleting earlier comments")
15281532
return nil
15291533
}
15301534
}
15311535

1536+
slog.Debug("Deleting prior comments for batch", "batchId", batch.ID)
1537+
15321538
allDeletesSuccessful := true
15331539
for _, prBatch := range prBatches {
15341540
if prBatch.ID == batch.ID {
@@ -1557,6 +1563,7 @@ func DeleteOlderPRCommentsIfEnabled(gh utils.GithubClientProvider, batch *models
15571563
}
15581564
}
15591565

1566+
slog.Debug("Deletion of prior comments complete", "allDeletesSuccessful", allDeletesSuccessful)
15601567
if !allDeletesSuccessful {
15611568
slog.Warn("some of the previous comments failed to delete")
15621569
}

0 commit comments

Comments
 (0)