Skip to content

Commit a736df4

Browse files
committed
Add comment splitting feature
Signed-off-by: Mmadu Manasseh <manasseh.mmadu@zapier.com>
1 parent 0b97c9e commit a736df4

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

pkg/msg/message.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ func (m *Message) BuildComment(
227227
sb.Reset()
228228
sb.WriteString(header)
229229
contentLength = len(continuedHeader)
230+
230231
}
231232
}
232233

@@ -317,6 +318,7 @@ func (m *Message) BuildComment(
317318
sb.WriteString(splitCommentFooter)
318319
comments = append(comments, sb.String())
319320
sb.Reset()
321+
sb.WriteString(header)
320322
contentLength = len(continuedHeader)
321323
msg = secondPart
322324
} else {

pkg/msg/message_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,7 @@ func TestBuildComment_Deep(t *testing.T) {
409409
// Check that split warnings are present in middle comments
410410
foundSplitWarnings := 0
411411
for i := 0; i < len(comments)-1; i++ {
412+
assert.Contains(t, comments[i], "## Kubechecks id Report")
412413
if strings.Contains(comments[i], "> **Warning**: Output length greater than maximum allowed comment size. Continued in next comment") {
413414
foundSplitWarnings++
414415
}

0 commit comments

Comments
 (0)