diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2025-02-06 19:35:29 +0100 |
|---|---|---|
| committer | Aleksandr Nogikh <nogikh@google.com> | 2025-02-14 13:40:12 +0000 |
| commit | 5b082ecabf223d8f52f6bb9e4acd8ace0bffc902 (patch) | |
| tree | fec57f8b12bd6a583c68c87da9ef66d5c8e4de04 /syz-cluster/dashboard/handler.go | |
| parent | 1022af749615bfc4e3a305b891449d95d5fc050a (diff) | |
syz-cluster: report series/sessions via API
In the previous version of the code, series-tracker was directly pushing
patch series into the DB and the controller auto-created fuzzing
sessions.
Mediate these via the controller API instead.
Instead of creating Session objects on the fly, pre-create them and
let processor take them one by one.
The approach has multiple
benefits:
1) The same API might be used for the patch series sources other than
LKML.
2) If the existence of Session objects is not a sign that we have
started working on it, it allows for a more precise status display
(not created/waiting/running/finished).
3) We could manually push older patch series and manually trigger
fuzzing sessions to experimentally measure the bug detection rates.
4) The controller tests could be organized only by relying on the API
offered by the component.
Diffstat (limited to 'syz-cluster/dashboard/handler.go')
| -rw-r--r-- | syz-cluster/dashboard/handler.go | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/syz-cluster/dashboard/handler.go b/syz-cluster/dashboard/handler.go index aac18b22f..38ea527ee 100644 --- a/syz-cluster/dashboard/handler.go +++ b/syz-cluster/dashboard/handler.go @@ -73,6 +73,8 @@ var ( errBadRequest = errors.New("bad request") ) +// TODO: export a common method to get Series' status. + func (h *dashboardHandler) seriesList(w http.ResponseWriter, r *http.Request) error { type MainPageData struct { // It's probably not the best idea to expose db entities here, @@ -108,27 +110,27 @@ func (h *dashboardHandler) seriesInfo(w http.ResponseWriter, r *http.Request) er ctx := r.Context() data.Series, err = h.seriesRepo.GetByID(ctx, r.PathValue("id")) if err != nil { - return err + return fmt.Errorf("failed to query series: %w", err) } else if data.Series == nil { return fmt.Errorf("%w: series", errNotFound) } data.Patches, err = h.seriesRepo.ListPatches(ctx, data.Series) if err != nil { - return err + return fmt.Errorf("failed to query patches: %w", err) } data.TotalPatches = len(data.Patches) sessions, err := h.sessionRepo.ListForSeries(ctx, data.Series) if err != nil { - return err + return fmt.Errorf("failed to query sessions: %w", err) } for _, session := range sessions { rawTests, err := h.sessionTestRepo.BySession(ctx, session.ID) if err != nil { - return err + return fmt.Errorf("failed to query session tests: %w", err) } findings, err := h.findingRepo.ListForSession(ctx, session) if err != nil { - return err + return fmt.Errorf("failed to query session findings: %w", err) } perName := groupFindings(findings) sessionData := SessionData{ |
