cmd/coordinator: fix bug where try build status would never go away

If the Gerrit query reported no CLs needed trybot runs, we returned
too early and didn't clear our state. Remove that 'if len(cis) == 0'
early return. The optimization was buggy and not even worth much if
correct.

Also rename some confusing variables.

Change-Id: I485d303c36cc477e3ac651ec25b2c777f512b658
Reviewed-on: https://go-review.googlesource.com/36808
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Brad Fitzpatrick 2017-02-11 22:10:24 +00:00
Родитель f65b532dab
Коммит b6845bdb45
1 изменённых файлов: 7 добавлений и 10 удалений

Просмотреть файл

@ -96,7 +96,7 @@ var (
) )
func initTryBuilders() { func initTryBuilders() {
tryList := []string{ names := []string{
"darwin-amd64-10_11", "darwin-amd64-10_11",
"linux-386", "linux-386",
"linux-amd64", "linux-amd64",
@ -110,15 +110,15 @@ func initTryBuilders() {
"nacl-amd64p32", "nacl-amd64p32",
"linux-arm", "linux-arm",
} }
for bname := range dashboard.Builders { for name := range dashboard.Builders {
if strings.HasPrefix(bname, "misc-compile") { if strings.HasPrefix(name, "misc-compile") {
tryList = append(tryList, bname) names = append(names, name)
} }
} }
for _, bname := range tryList { for _, name := range names {
conf, ok := dashboard.Builders[bname] conf, ok := dashboard.Builders[name]
if !ok { if !ok {
log.Printf("ignoring invalid try builder config %q", bname) log.Printf("ignoring invalid try builder config %q", name)
continue continue
} }
tryBuilders = append(tryBuilders, conf) tryBuilders = append(tryBuilders, conf)
@ -819,9 +819,6 @@ func findTryWork() error {
if err != nil { if err != nil {
return err return err
} }
if len(cis) == 0 {
return nil
}
statusMu.Lock() statusMu.Lock()
defer statusMu.Unlock() defer statusMu.Unlock()