go.tools/dashboard/app: tweak build column order

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/63590043
This commit is contained in:
Andrew Gerrand 2014-02-14 11:35:50 +11:00
parent 47596b4b81
commit b277773706
1 changed files with 17 additions and 12 deletions

View File

@ -19,9 +19,10 @@ import (
"strconv" "strconv"
"strings" "strings"
"cache"
"appengine" "appengine"
"appengine/datastore" "appengine/datastore"
"cache"
) )
func init() { func init() {
@ -162,24 +163,28 @@ func builderPriority(builder string) int {
if isRace(builder) { if isRace(builder) {
return 1 return 1
} }
// Put supported OSes first. // If the OS has a specified priority, use it.
if supportedOS[builderOS(builder)] { if p, ok := osPriority[builderOS(builder)]; ok {
return 0 return p
} }
// Everyone else. // The rest.
return 2 return 10
} }
func isRace(s string) bool { func isRace(s string) bool {
return strings.Contains(s, "-race-") || strings.HasSuffix(s, "-race") return strings.Contains(s, "-race-") || strings.HasSuffix(s, "-race")
} }
// Operating systems that should appear first on the dashboard. // Priorities for specific operating systems.
var supportedOS = map[string]bool{ var osPriority = map[string]int{
"darwin": true, "darwin": 0,
"freebsd": true, "freebsd": 0,
"linux": true, "linux": 0,
"windows": true, "windows": 0,
// race == 1
"openbsd": 2,
"netbsd": 3,
"dragonfly": 4,
} }
// TagState represents the state of all Packages at a Tag. // TagState represents the state of all Packages at a Tag.