aboutsummaryrefslogtreecommitdiffstats
path: root/syz-cluster/pkg/controller/api.go
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2026-02-16 08:48:25 +0000
committerAleksandr Nogikh <nogikh@google.com>2026-03-04 18:19:12 +0000
commit5675edac8a8dd3f3041df8d9ec79f95a42d434fa (patch)
treeeab8686c35dce571b119ddd3468ffc731688ec07 /syz-cluster/pkg/controller/api.go
parent12c7ee42182673f63622aadb91d5da1f2eedb8f1 (diff)
syz-cluster: add ListPreviousFindings API
The API call returns an aggregated list of findings in all previous versions of the specified patch series.
Diffstat (limited to 'syz-cluster/pkg/controller/api.go')
-rw-r--r--syz-cluster/pkg/controller/api.go14
1 files changed, 14 insertions, 0 deletions
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) {