aboutsummaryrefslogtreecommitdiffstats
path: root/syz-cluster
diff options
context:
space:
mode:
authorPimyn Girgis <pimyn@google.com>2025-12-16 11:09:32 +0100
committerAleksandr Nogikh <nogikh@google.com>2026-01-08 08:55:35 +0000
commitf7cfc6225a3f2876676a89d1d0486a4c08f0aefc (patch)
tree724fff22501cc8a1a2fc325d466c2861e8e71f5f /syz-cluster
parent06ac10d7e8f3efdc1393e5a7dda65f405d93afd4 (diff)
syz-cluster: show series versions in the dashboard
Display a list of other versions of the same series on the series details page. Fetch all series sharing the same title and render them in a new "Series Versions" table, allowing navigation between different versions of a patch series.
Diffstat (limited to 'syz-cluster')
-rw-r--r--syz-cluster/dashboard/handler.go6
-rw-r--r--syz-cluster/dashboard/templates/series.html11
-rw-r--r--syz-cluster/pkg/db/series_repo.go11
3 files changed, 27 insertions, 1 deletions
diff --git a/syz-cluster/dashboard/handler.go b/syz-cluster/dashboard/handler.go
index 381efcfcd..e9d949f7c 100644
--- a/syz-cluster/dashboard/handler.go
+++ b/syz-cluster/dashboard/handler.go
@@ -172,6 +172,7 @@ func (h *dashboardHandler) seriesInfo(w http.ResponseWriter, r *http.Request) er
*db.Series
Patches []*db.Patch
Sessions []SessionData
+ Versions []*db.Series
TotalPatches int
}
var data SeriesData
@@ -188,6 +189,11 @@ func (h *dashboardHandler) seriesInfo(w http.ResponseWriter, r *http.Request) er
return fmt.Errorf("failed to query patches: %w", err)
}
data.TotalPatches = len(data.Patches)
+ // Note: There may be some false positives, but there's no straightforward way to filter them out.
+ data.Versions, err = h.seriesRepo.ListAllVersions(ctx, data.Series.Title)
+ if err != nil {
+ return fmt.Errorf("failed to query all series versions: %w", err)
+ }
sessions, err := h.sessionRepo.ListForSeries(ctx, data.Series)
if err != nil {
return fmt.Errorf("failed to query sessions: %w", err)
diff --git a/syz-cluster/dashboard/templates/series.html b/syz-cluster/dashboard/templates/series.html
index 3f349435d..504d059eb 100644
--- a/syz-cluster/dashboard/templates/series.html
+++ b/syz-cluster/dashboard/templates/series.html
@@ -53,7 +53,16 @@
</tr>
<tr>
<th>Version</th>
- <td>{{.Version}}</td>
+ <td>
+ <select class="form-select" onchange="window.location.href=this.value;">
+ {{$currentSeriesVersion := .Version}}
+ {{range .Versions}}
+ <option value="/series/{{.ID}}" {{if eq .Version $currentSeriesVersion}}selected{{end}}>
+ Version {{.Version}}
+ </option>
+ {{end}}
+ </select>
+ </td>
</tr>
<tr>
<th>Cc</th>
diff --git a/syz-cluster/pkg/db/series_repo.go b/syz-cluster/pkg/db/series_repo.go
index fdb452f72..aa8c687ca 100644
--- a/syz-cluster/pkg/db/series_repo.go
+++ b/syz-cluster/pkg/db/series_repo.go
@@ -226,6 +226,17 @@ WHERE SEARCH(Patches.TitleTokens, @name)
return ret, nil
}
+func (repo *SeriesRepository) ListAllVersions(ctx context.Context, title string) ([]*Series, error) {
+ ro := repo.client.ReadOnlyTransaction()
+ defer ro.Close()
+ return readEntities[Series](ctx, ro, spanner.Statement{
+ SQL: "SELECT ID, Version FROM SERIES where Title = @title ORDER BY Version",
+ Params: map[string]any{
+ "title": title,
+ },
+ })
+}
+
func (repo *SeriesRepository) querySessions(ctx context.Context, ro *spanner.ReadOnlyTransaction,
seriesList []*SeriesWithSession) error {
idToSeries := map[string]*SeriesWithSession{}