dashboard: treat dev branches as current

If a dev branch is active, it will be current. If it is not
active, it is probably not current, but we don't build on the
branch so it doesn't matter anyway.

Specifically, the dev.link branch is currently under active
development, and it would be good to have a large set of builders
run on the branch to catch problems. (E.g., AIX build was broken
but not noticed.)

Fixes golang/go#37953.

Change-Id: Idd7e3edaaff1b4d2cee17da552a96df2b00716e9
Reviewed-on: https://go-review.googlesource.com/c/build/+/223381
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
diff --git a/dashboard/builders.go b/dashboard/builders.go
index 05bd22b..df927f8 100644
--- a/dashboard/builders.go
+++ b/dashboard/builders.go
@@ -2526,11 +2526,23 @@
 	return confs
 }
 
-// atLeastGo1 reports whether branch is either "master" or "release-branch.go1.N" where N >= min.
+// atLeastGo1 reports whether branch is "release-branch.go1.N" where N >= min.
+// It assumes "master" and "dev.*" branches are already greater than min, and
+// always includes them.
 func atLeastGo1(branch string, min int) bool {
 	if branch == "master" {
 		return true
 	}
+	if strings.HasPrefix(branch, "dev.") {
+		// Treat dev branches current.
+		// If a dev branch is active, it will be current.
+		// If it is not active, it doesn't matter anyway.
+		// TODO: dev.boringcrypto.go1.N branches may be the
+		// exception. Currently we only build boringcrypto
+		// on linux/amd64 and windows/386, which support all
+		// versions of Go, so it doesn't actually matter.
+		return true
+	}
 	major, minor, ok := version.ParseReleaseBranch(branch)
 	return ok && major == 1 && minor >= min
 }
diff --git a/dashboard/builders_test.go b/dashboard/builders_test.go
index 38b4d5d..5f67bfd 100644
--- a/dashboard/builders_test.go
+++ b/dashboard/builders_test.go
@@ -114,6 +114,7 @@
 			repo:   "go",
 			branch: "dev.link",
 			want: []string{
+				"android-amd64-emu",
 				"freebsd-amd64-12_0",
 				"js-wasm",
 				"linux-386",
@@ -397,6 +398,7 @@
 		{b("aix-ppc64@go1.12", "mobile"), none},
 		{b("aix-ppc64@go1.13", "net"), onlyPost},
 		{b("aix-ppc64@go1.13", "mobile"), none},
+		{b("aix-ppc64@dev.link", "go"), onlyPost},
 
 		{b("linux-amd64-nocgo", "mobile"), none},