Skip to content

Commit 44b9702

Browse files
committed
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.
1 parent ceb1f4d commit 44b9702

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

syz-cluster/dashboard/handler.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ func (h *dashboardHandler) seriesInfo(w http.ResponseWriter, r *http.Request) er
173173
*db.Series
174174
Patches []*db.Patch
175175
Sessions []SessionData
176+
Versions []*db.Series
176177
TotalPatches int
177178
}
178179
var data SeriesData
@@ -189,6 +190,23 @@ func (h *dashboardHandler) seriesInfo(w http.ResponseWriter, r *http.Request) er
189190
return fmt.Errorf("failed to query patches: %w", err)
190191
}
191192
data.TotalPatches = len(data.Patches)
193+
// Fetch all series with the same title to find other versions.
194+
// NOTE: In some cases we might have multiple unrelated series with the same exact name.
195+
// I suspect it wouldn't be a problem, but it's worth noting.
196+
seriesFilter := db.SeriesFilter{
197+
SeriesName: data.Series.Title,
198+
Limit: 50, // A large enough number to get all versions.
199+
Offset: 0,
200+
}
201+
allVersions, err := h.seriesRepo.ListLatest(ctx, seriesFilter, time.Time{})
202+
if err != nil {
203+
return fmt.Errorf("failed to query all series versions: %w", err)
204+
}
205+
for _, v := range allVersions {
206+
if v.Series.ID != data.Series.ID && v.Series.Version != data.Series.Version {
207+
data.Versions = append(data.Versions, v.Series)
208+
}
209+
}
192210
sessions, err := h.sessionRepo.ListForSeries(ctx, data.Series)
193211
if err != nil {
194212
return fmt.Errorf("failed to query sessions: %w", err)

syz-cluster/dashboard/templates/series.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,5 +171,23 @@ <h3>Session {{.CreatedAt.Format "2006-01-02"}}</h3>
171171
</tbody>
172172
</table>
173173
{{end}}
174+
175+
<h3>Series Versions</h3>
176+
<table class="table table-striped">
177+
<thead>
178+
<tr>
179+
<th>Version</th>
180+
<th>Date</th>
181+
</tr>
182+
</thead>
183+
<tbody>
184+
{{range .Versions}}
185+
<tr>
186+
<td><a href="/series/{{.ID}}">{{.Version}}</a></td>
187+
<td>{{.PublishedAt}}</td>
188+
</tr>
189+
{{end}}
190+
</tbody>
191+
</table>
174192
</div>
175193
{{end}}

0 commit comments

Comments
 (0)