aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2018-02-01 15:40:32 +0100
committerDmitry Vyukov <dvyukov@google.com>2018-02-01 15:40:32 +0100
commit9b1e75c0bca1d22b91dbbe645620ffdd7a245a68 (patch)
tree4b7a6a4ecde577012646338fd95a614cdb0b32a2
parent11fa8bb3de599101a2da6c8c0546983c34c34f90 (diff)
dashboard/app: fix patched/missing on numbers
We currently print N/M which does not mean N out of M are patched, instead it means N patched and M are not patched. This is confusing. Print more traditional "N out of M".
-rw-r--r--dashboard/app/main.go8
-rw-r--r--dashboard/app/templates.html2
2 files changed, 7 insertions, 3 deletions
diff --git a/dashboard/app/main.go b/dashboard/app/main.go
index dfbeb18cb..e7cef081b 100644
--- a/dashboard/app/main.go
+++ b/dashboard/app/main.go
@@ -93,6 +93,7 @@ type uiBug struct {
Commits string
PatchedOn []string
MissingOn []string
+ NumManagers int
}
type uiCrash struct {
@@ -389,7 +390,7 @@ func createUIBug(c context.Context, bug *Bug, state *ReportingState, managers []
Status: status,
Link: bugLink(id),
ExternalLink: link,
- PatchedOn: bug.PatchedOn,
+ NumManagers: len(managers),
}
if len(bug.Commits) != 0 {
uiBug.Commits = fmt.Sprintf("%q", bug.Commits)
@@ -401,10 +402,13 @@ func createUIBug(c context.Context, bug *Bug, state *ReportingState, managers []
break
}
}
- if !found {
+ if found {
+ uiBug.PatchedOn = append(uiBug.PatchedOn, mgr)
+ } else {
uiBug.MissingOn = append(uiBug.MissingOn, mgr)
}
}
+ sort.Strings(uiBug.PatchedOn)
sort.Strings(uiBug.MissingOn)
}
return uiBug
diff --git a/dashboard/app/templates.html b/dashboard/app/templates.html
index b026a9970..90c0c1555 100644
--- a/dashboard/app/templates.html
+++ b/dashboard/app/templates.html
@@ -25,7 +25,7 @@ Use of this source code is governed by Apache 2 LICENSE that can be found in the
<td class="stat {{if $b.NumCrashesBad}}bad{{end}}">{{$b.NumCrashes}}</td>
<td class="stat">{{formatReproLevel $b.ReproLevel}}</td>
<td class="stat">{{formatLateness $.Now $b.LastTime}}</td>
- <td class="patched" title="{{$b.Commits}}">{{if $b.Commits}}{{len $b.PatchedOn}}/{{len $b.MissingOn}}{{end}}</td>
+ <td class="patched" title="{{$b.Commits}}">{{if $b.Commits}}{{len $b.PatchedOn}}/{{$b.NumManagers}}{{end}}</td>
<td class="status">{{if $b.ExternalLink}}<a href="{{$b.ExternalLink}}">{{$b.Status}}</a>{{else}}{{$b.Status}}{{end}}</td>
</tr>
{{end}}