From 5675edac8a8dd3f3041df8d9ec79f95a42d434fa Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Mon, 16 Feb 2026 08:48:25 +0000 Subject: syz-cluster: add ListPreviousFindings API The API call returns an aggregated list of findings in all previous versions of the specified patch series. --- syz-cluster/pkg/controller/api.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'syz-cluster/pkg/controller/api.go') diff --git a/syz-cluster/pkg/controller/api.go b/syz-cluster/pkg/controller/api.go index a9e3058f4..5d6ed247d 100644 --- a/syz-cluster/pkg/controller/api.go +++ b/syz-cluster/pkg/controller/api.go @@ -40,6 +40,7 @@ func (c APIServer) Mux() *http.ServeMux { mux.HandleFunc("/builds/last", c.getLastBuild) mux.HandleFunc("/builds/upload", c.uploadBuild) mux.HandleFunc("/findings/upload", c.uploadFinding) + mux.HandleFunc("/findings/previous", c.getPreviousFindings) mux.HandleFunc("/findings/{finding_id}", c.getFinding) mux.HandleFunc("/series/upload", c.uploadSeries) mux.HandleFunc("/series/{series_id}", c.getSeries) @@ -166,6 +167,19 @@ func (c APIServer) uploadFinding(w http.ResponseWriter, r *http.Request) { api.ReplyJSON[any](w, nil) } +func (c APIServer) getPreviousFindings(w http.ResponseWriter, r *http.Request) { + req := api.ParseJSON[api.ListPreviousFindingsReq](w, r) + if req == nil { + return + } + findings, err := c.findingService.ListPreviousFindings(r.Context(), req) + if err != nil { + http.Error(w, fmt.Sprint(err), http.StatusInternalServerError) + return + } + api.ReplyJSON(w, findings) +} + func (c APIServer) getFinding(w http.ResponseWriter, r *http.Request) { finding, err := c.findingService.Get(r.Context(), r.PathValue("finding_id")) if errors.Is(err, service.ErrFindingNotFound) { -- cgit mrf-deployment