fix the ingester
0
k1.patch
26 lines 868 B view raw
1commit 645f0175dfb59df39480cd171647875a91faec3b 2Author: oppiliappan <me@oppi.li> 3Date: Tue Apr 21 16:21:57 2026 +0100 4 5 knotserver: fix ingesting empty pulls 6 7 Signed-off-by: oppiliappan <me@oppi.li> 8 9diff --git a/flake.lock b/flake.lock 10index 6570b0b3e..ea4a23613 100644 11Binary files a/flake.lock and b/flake.lock differ 12diff --git a/knotserver/ingester.go b/knotserver/ingester.go 13index 41fdc27bb..daa041667 100644 14--- a/knotserver/ingester.go 15+++ b/knotserver/ingester.go 16@@ -181,6 +181,10 @@ func (h *Knot) fetchLatestSubmission(ctx context.Context, did, rkey string, reco 17 return nil, fmt.Errorf("failed to resolve PR owner handle: %w", err) 18 } 19 20+ if len(record.Rounds) == 0 { 21+ return nil, fmt.Errorf("failed to fetch latest submission, no rounds in record") 22+ } 23+ 24 roundNumber := len(record.Rounds) - 1 25 round := record.Rounds[roundNumber] 26