Skip to content

Commit cda6dc7

Browse files
committed
x/build/devapp: put performance issues in their own grouping
Separate performance issues (those with the "Performance" label) from the rest of the issues on the release dashboard. Performance issues tend to be those which are not critical to fix for any particular release, so separating them and putting them later in order helps to deprioritize them. Kind of a hack, but it works. Change-Id: I6fa0f85629504c298691b492e50e03c817c62a1b Reviewed-on: https://go-review.googlesource.com/c/145937 Reviewed-by: Brad Fitzpatrick <[email protected]>
1 parent b7e79bd commit cda6dc7

File tree

2 files changed

+25
-5
lines changed

2 files changed

+25
-5
lines changed

devapp/release.go

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,9 @@ type group struct {
8080
}
8181

8282
type item struct {
83-
Issue *maintner.GitHubIssue
84-
CLs []*gerritCL
83+
Issue *maintner.GitHubIssue
84+
CLs []*gerritCL
85+
FirstPerformance bool // set if this item is the first item which is labeled "performance"
8586
}
8687

8788
func (i *item) ReleaseBlocker() bool {
@@ -93,9 +94,18 @@ func (i *item) ReleaseBlocker() bool {
9394

9495
type itemsBySummary []item
9596

96-
func (x itemsBySummary) Len() int { return len(x) }
97-
func (x itemsBySummary) Swap(i, j int) { x[i], x[j] = x[j], x[i] }
98-
func (x itemsBySummary) Less(i, j int) bool { return itemSummary(x[i]) < itemSummary(x[j]) }
97+
func (x itemsBySummary) Len() int { return len(x) }
98+
func (x itemsBySummary) Swap(i, j int) { x[i], x[j] = x[j], x[i] }
99+
func (x itemsBySummary) Less(i, j int) bool {
100+
// Sort performance issues to the end.
101+
pi := x[i].Issue != nil && x[i].Issue.HasLabel("Performance")
102+
pj := x[j].Issue != nil && x[j].Issue.HasLabel("Performance")
103+
if pi != pj {
104+
return !pi
105+
}
106+
// Otherwise sort by the item summary.
107+
return itemSummary(x[i]) < itemSummary(x[j])
108+
}
99109

100110
func itemSummary(it item) string {
101111
if it.Issue != nil {
@@ -265,6 +275,12 @@ func (s *server) appendOpenIssues(dirToIssues map[string][]*maintner.GitHubIssue
265275
continue
266276
}
267277
sort.Sort(itemsBySummary(items))
278+
for idx := range items {
279+
if items[idx].Issue.HasLabel("Performance") {
280+
items[idx].FirstPerformance = true
281+
break
282+
}
283+
}
268284
issueGroups = append(issueGroups, group{
269285
Dir: d,
270286
Items: items,

devapp/templates/release.tmpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ a:visited {
3131
.Section-title {
3232
margin: .5em 0;
3333
}
34+
.Performance-separator {
35+
margin-left:4ch;
36+
}
3437
.Item {
3538
display: flex;
3639
}
@@ -62,6 +65,7 @@ a:visited {
6265
{{range .Groups}}
6366
{{if .Dir}}<h4 class="DirTitle">{{.Dir}}</h4>{{end}}
6467
{{range .Items}}
68+
{{if .FirstPerformance}}<h5 class="Performance-separator">performance</h5>{{end}}
6569
{{$i := .Issue}}
6670
{{if $i}}
6771
<div class="Item{{if .ReleaseBlocker}} Item-blocker{{end}}">

0 commit comments

Comments
 (0)