Skip to content

Commit 151068c

Browse files
committed
fix lines logic
1 parent e340b53 commit 151068c

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

backend/migrations/20241204194016.sql

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-- Modify "digger_batches" table
2+
ALTER TABLE "public"."digger_batches" ADD COLUMN "placeholder_comment_id_for_report" text NULL;

backend/migrations/atlas.sum

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
h1:fW4YtFhVfirvwGtHxnGXjFwChYhoj/5pW/XaA6rViHw=
1+
h1:SB1sRi1zY0IoKioJ+Y0FtuIjHQv6XCvcsAJg0AEJNs4=
22
20231227132525.sql h1:43xn7XC0GoJsCnXIMczGXWis9d504FAWi4F1gViTIcw=
33
20240115170600.sql h1:IW8fF/8vc40+eWqP/xDK+R4K9jHJ9QBSGO6rN9LtfSA=
44
20240116123649.sql h1:R1JlUIgxxF6Cyob9HdtMqiKmx/BfnsctTl5rvOqssQw=
@@ -34,3 +34,4 @@ h1:fW4YtFhVfirvwGtHxnGXjFwChYhoj/5pW/XaA6rViHw=
3434
20241107163722.sql h1:tk28AgXggvpEigTkWMYMxIVDPNdEUFGijaFWBqvlZhA=
3535
20241107172343.sql h1:wtM1+uJZY6NiiDYabuzj/LAANAV7+xyUCL5U23v3e+c=
3636
20241114202249.sql h1:LCRf42VUYB/uugR4gwp+fGPUomT0KhFA3eLjBK9JlZo=
37+
20241204194016.sql h1:RgiJkZlAJSJjNCRD5RHmRr+65O9UDCRwGohQwdIMhGg=

libs/comment_utils/reporting/reporting.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,9 @@ func appendToExistingComment(ciService ci.PullRequestService, prNumber int, exis
205205

206206
// strip first and last lines
207207
lines := strings.Split(existingCommentBody, "\n")
208-
lines = lines[1 : len(lines)-1]
208+
if len(lines) > 1 {
209+
lines = lines[1 : len(lines)-1]
210+
}
209211
existingCommentBody = strings.Join(lines, "\n")
210212

211213
existingCommentBody = existingCommentBody + "\n\n" + reportToAppend + "\n"

0 commit comments

Comments
 (0)