Skip to content

Commit fd70641

Browse files
committed
fix newlines
Signed-off-by: Mmadu Manasseh <manasseh.mmadu@zapier.com>
1 parent 643743a commit fd70641

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

localdev/kubechecks/values.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,7 @@ configMap:
3131
deployment:
3232
annotations:
3333
reloader.stakater.com/auto: "true"
34-
resources:
35-
limits:
36-
memory: 4Gi
37-
34+
3835
image:
3936
pullPolicy: IfNotPresent
4037
name: "kubechecks"

pkg/msg/message.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import (
1212
"golang.org/x/exp/constraints"
1313
"golang.org/x/exp/slices"
1414

15-
"github.com/rs/zerolog/log"
1615
"github.com/zapier/kubechecks/pkg"
1716
)
1817

@@ -266,7 +265,7 @@ func (m *Message) BuildComment(
266265
} else {
267266
appHeader += fmt.Sprintf("## ArgoCD Application Checks: `%s` %s\n", appName, m.vcs.ToEmoji(appState))
268267
}
269-
appHeader += "</summary>\n\n"
268+
appHeader += "\n</summary>\n\n"
270269

271270
// Only split if adding the app header would exceed the chunk limit
272271
if contentLength+len(appHeader) > maxContentLength {
@@ -299,7 +298,7 @@ func (m *Message) BuildComment(
299298
summary = fmt.Sprintf("%s %s %s", check.Summary, check.State.BareString(), m.vcs.ToEmoji(check.State))
300299
}
301300
}
302-
summaryHeader := fmt.Sprintf("<details>\n<summary>%s</summary>\n", summary)
301+
summaryHeader := fmt.Sprintf("<details>\n\n<summary>%s</summary>\n\n", summary)
303302

304303
// Only split if adding the summary would exceed the chunk limit (not if it equals)
305304
if contentLength+len(summaryHeader) > maxContentLength {
@@ -372,9 +371,6 @@ func (m *Message) BuildComment(
372371
comments = append(comments, sb.String())
373372
}
374373

375-
for _, comment := range comments {
376-
log.Debug().Msgf("Comment length: %d", len(comment))
377-
}
378374
return comments
379375
}
380376

pkg/msg/message_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,13 @@ func TestBuildComment(t *testing.T) {
4141
<summary>
4242
4343
## ArgoCD Application Checks: ` + "`myapp`" + ` :test:
44+
4445
</summary>
4546
4647
<details>
48+
4749
<summary>this failed bigly Error :test:</summary>
50+
4851
should add some important details here
4952
</details>
5053
</details>
@@ -1324,7 +1327,7 @@ func TestBuildComment_ContentLengthLimits(t *testing.T) {
13241327

13251328
// Test case 5: Edge case with very small maxCommentLength
13261329
// This tests the minimum viable comment size
1327-
smallMaxCommentLength := len(continuedHeader) + 50 // Just enough for continuedHeader + minimal content
1330+
smallMaxCommentLength := len(continuedHeader) + 100 // Increased buffer to account for message structure overhead
13281331
appResults5 := map[string]*AppResults{
13291332
"testapp": {
13301333
results: []Result{

0 commit comments

Comments
 (0)