dashboard: disable more builders

Make exp off by default, as it barely passes anywhere. Lock in the
places where it does pass.

Also disable x/net master combined with Go 1.11 on FreeBSD 32-bit. It
doesn't work on our builders and it'll never be fixed (we're not going
to make changes to Go 1.11) and there's resistance to skipping those
tests (my CL 170777), so I'm just turning off the builder. That's not
ideal, but it's better than people getting used to red on the
dashboard.

Fixes golang/go#31221

Change-Id: Id0228e4b0ee73715a0c2da84f68dcfc989a48aaf
Reviewed-on: https://go-review.googlesource.com/c/build/+/170782
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
diff --git a/dashboard/builders.go b/dashboard/builders.go
index 63bd416..5a19ab1 100644
--- a/dashboard/builders.go
+++ b/dashboard/builders.go
@@ -1013,29 +1013,36 @@
 			return false
 		}
 	}
-
+	if repo != "go" && !c.SplitMakeRun() {
+		return false
+	}
 	if p := c.buildsRepo; p != nil {
 		return p(repo, branch, goBranch)
 	}
-	if repo == "go" {
-		return true
-	}
-	if !c.SplitMakeRun() {
-		return false
-	}
+	return defaultBuildsRepoPolicy(repo, branch, goBranch)
+}
+
+func defaultBuildsRepoPolicy(repo, branch, goBranch string) bool {
 	switch repo {
 	case "go":
 		return true
 	case "term":
 		// no code yet in repo
 		return false
-	case "mobile":
-		// Mobile is opt-in.
+	case "mobile", "exp":
+		// mobile and exp are opt-in.
 		return false
 	}
 	return true
 }
 
+func defaultPlusExp(repo, branch, goBranch string) bool {
+	if repo == "exp" {
+		return true
+	}
+	return defaultBuildsRepoPolicy(repo, branch, goBranch)
+}
+
 // AllScriptArgs returns the set of arguments that should be passed to the
 // all.bash-equivalent script. Usually empty.
 func (c *BuildConfig) AllScriptArgs() []string {
@@ -1256,6 +1263,12 @@
 		HostType:          "host-freebsd-12_0",
 		env:               []string{"GOARCH=386", "GOHOSTARCH=386"},
 		shouldRunDistTest: fasterTrybots,
+		buildsRepo: func(repo, branch, goBranch string) bool {
+			if repo == "net" && branch == "master" && goBranch == "release-branch.go1.11" {
+				return false
+			}
+			return defaultBuildsRepoPolicy(repo, branch, goBranch)
+		},
 		numTryTestHelpers: 4,
 		MaxAtOnce:         2,
 	})
@@ -1296,9 +1309,15 @@
 		Name:              "freebsd-386-11_2",
 		HostType:          "host-freebsd-11_2",
 		shouldRunDistTest: noTestDir,
-		tryBot:            explicitTrySet("sys"),
-		env:               []string{"GOARCH=386", "GOHOSTARCH=386"},
-		MaxAtOnce:         2,
+		buildsRepo: func(repo, branch, goBranch string) bool {
+			if repo == "net" && branch == "master" && goBranch == "release-branch.go1.11" {
+				return false
+			}
+			return defaultBuildsRepoPolicy(repo, branch, goBranch)
+		},
+		tryBot:    explicitTrySet("sys"),
+		env:       []string{"GOARCH=386", "GOHOSTARCH=386"},
+		MaxAtOnce: 2,
 	})
 	addBuilder(BuildConfig{
 		Name:              "linux-386",
@@ -1323,9 +1342,10 @@
 		env:      []string{"GOARCH=386", "GOHOSTARCH=386", "GO386=387"},
 	})
 	addBuilder(BuildConfig{
-		Name:     "linux-amd64",
-		HostType: "host-linux-stretch",
-		tryBot:   defaultTrySet(),
+		Name:       "linux-amd64",
+		HostType:   "host-linux-stretch",
+		tryBot:     defaultTrySet(),
+		buildsRepo: defaultPlusExp,
 		env: []string{
 			"GO_DISABLE_OUTBOUND_NETWORK=1",
 		},
@@ -1465,6 +1485,7 @@
 		Name:              "linux-amd64-race",
 		HostType:          "host-linux-jessie",
 		tryBot:            defaultTrySet(),
+		buildsRepo:        defaultPlusExp,
 		MaxAtOnce:         1,
 		shouldRunDistTest: fasterTrybots,
 		numTestHelpers:    1,
@@ -1610,7 +1631,7 @@
 			switch repo {
 			case "go":
 				return true
-			case "mobile", "benchmarks", "debug", "perf", "talks", "tools", "tour", "website":
+			case "mobile", "exp", "benchmarks", "debug", "perf", "talks", "tools", "tour", "website":
 				return false
 			default:
 				return branch == "master" && goBranch == "master"
@@ -1775,6 +1796,7 @@
 	addBuilder(BuildConfig{
 		Name:              "windows-386-2008",
 		HostType:          "host-windows-amd64-2008",
+		buildsRepo:        defaultPlusExp,
 		shouldRunDistTest: fasterTrybots,
 		env:               []string{"GOARCH=386", "GOHOSTARCH=386"},
 		MaxAtOnce:         2,
@@ -1800,6 +1822,7 @@
 	addBuilder(BuildConfig{
 		Name:              "windows-amd64-2016",
 		HostType:          "host-windows-amd64-2016",
+		buildsRepo:        defaultPlusExp,
 		shouldRunDistTest: fasterTrybots,
 		env: []string{
 			"GOARCH=amd64",
@@ -1872,11 +1895,13 @@
 		Name:              "darwin-amd64-10_12",
 		HostType:          "host-darwin-10_12",
 		shouldRunDistTest: macTestPolicy,
+		buildsRepo:        defaultPlusExp,
 	})
 	addBuilder(BuildConfig{
 		Name:              "darwin-amd64-10_14",
 		HostType:          "host-darwin-10_14",
 		shouldRunDistTest: macTestPolicy,
+		buildsRepo:        defaultPlusExp,
 	})
 	addBuilder(BuildConfig{
 		Name:              "darwin-amd64-race",
diff --git a/dashboard/builders_test.go b/dashboard/builders_test.go
index cf571ea..be73a3f 100644
--- a/dashboard/builders_test.go
+++ b/dashboard/builders_test.go
@@ -158,11 +158,8 @@
 			repo:   "exp",
 			branch: "master",
 			want: []string{
-				"freebsd-amd64-12_0",
-				"linux-386",
 				"linux-amd64",
 				"linux-amd64-race",
-				"openbsd-amd64-64",
 				"windows-386-2008",
 				"windows-amd64-2016",
 			},
@@ -415,9 +412,26 @@
 		{b("linux-amd64-longtest@go1.12", "go"), onlyPost},
 		{b("linux-amd64-longtest@go1.12", "net"), none},
 
-		// Experimental exp repo.
+		// Experimental exp repo runs in very few places.
 		{b("linux-amd64", "exp"), both},
+		{b("linux-amd64-race", "exp"), both},
+		{b("linux-amd64-longtest", "exp"), onlyPost},
 		{b("windows-386-2008", "exp"), both},
+		{b("windows-amd64-2016", "exp"), both},
+		{b("darwin-amd64-10_12", "exp"), onlyPost},
+		{b("darwin-amd64-10_14", "exp"), onlyPost},
+		// ... but not on most others:
+		{b("freebsd-386-11_2", "exp"), none},
+		{b("freebsd-386-12_0", "exp"), none},
+		{b("freebsd-amd64-11_2", "exp"), none},
+		{b("freebsd-amd64-12_0", "exp"), none},
+		{b("openbsd-amd64-62", "exp"), none},
+		{b("openbsd-amd64-64", "exp"), none},
+		{b("js-wasm", "exp"), none},
+
+		// exp is experimental; it doesn't test against release branches.
+		{b("linux-amd64@go1.11", "exp"), none},
+		{b("linux-amd64@go1.12", "exp"), none},
 
 		// Only use latest macOS for subrepos, and only amd64:
 		{b("darwin-amd64-10_12", "net"), onlyPost},
@@ -437,11 +451,6 @@
 		{b("darwin-386-10_11@go1.12", "go"), onlyPost},
 		{b("darwin-386-10_11@go1.11", "go"), onlyPost},
 
-		// exp is experimental; it only tests against master.
-		{b("linux-amd64", "exp"), both},
-		{b("linux-amd64@go1.11", "exp"), none},
-		{b("linux-amd64@go1.12", "exp"), none},
-
 		// plan9 only lives at master. We don't support any past releases.
 		{b("plan9-386", "go"), onlyPost},
 		{b("plan9-386@go1.11", "go"), none},
@@ -461,6 +470,12 @@
 		{b("plan9-arm", "net"), onlyPost},
 		{b("plan9-arm@go1.11", "net"), none},
 		{b("plan9-arm@go1.12", "net"), none},
+
+		// x/net master with Go 1.11 doesn't work on our builders
+		// on 32-bit FreeBSD. Remove distracting red from the dashboard
+		// that'll never be fixed.
+		{b("freebsd-386-11_2@go1.11", "net"), none},
+		{b("freebsd-386-12_0@go1.11", "net"), none},
 	}
 	for _, tt := range tests {
 		t.Run(tt.br.testName, func(t *testing.T) {