dashboard: do not sunset windows 2008

CL 363474 added a 2012 builder, which is good, but it also took a major
step in sunsetting Windows 7 support by removing all 2008 builders from
trybots and for Go 1.18+. This will surely bitrot Windows 7 support and
force us to remove support for it, which isn't okay. Rather than line up
dominoes to force our hand on policy, such huge policy changes with
sweeping ramifications should be properly decided.

So, this commit keeps the 2008 builders in the running, alongside the
2012 ones.

Updates golang/go#47845.
Updates golang/go#49490.

Change-Id: I574f51ea22f638d2f9b09fcd00fdfc3097631771
Reviewed-on: https://go-review.googlesource.com/c/build/+/366656
Trust: Jason A. Donenfeld <Jason@zx2c4.com>
Trust: Carlos Amedee <carlos@golang.org>
Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
diff --git a/dashboard/builders.go b/dashboard/builders.go
index ad4dda4..f5ab127 100644
--- a/dashboard/builders.go
+++ b/dashboard/builders.go
@@ -95,7 +95,7 @@
 	"solaris-amd64":        "solaris-amd64-oraclerel",
 	"wasm":                 "js-wasm",
 	"windows":              "windows-amd64-2016",
-	"windows-386":          "windows-386-2012",
+	"windows-386":          "windows-386-2008",
 	"windows-amd64":        "windows-amd64-2016",
 	"windows-arm":          "windows-arm-zx2c4",
 	"windows-arm64":        "windows-arm64-10",
@@ -1262,7 +1262,7 @@
 
 	// Build dev.boringcrypto branches only on linux/amd64 and windows/386 (see golang.org/issue/26791).
 	if repo == "go" && (branch == "dev.boringcrypto" || strings.HasPrefix(branch, "dev.boringcrypto.")) {
-		if c.Name != "linux-amd64" && c.Name != "windows-386-2012" {
+		if c.Name != "linux-amd64" && c.Name != "windows-386-2012" && c.Name != "windows-386-2008" {
 			return false
 		}
 	}
@@ -2186,6 +2186,7 @@
 		Name:           "windows-amd64-2008",
 		HostType:       "host-windows-amd64-2008",
 		distTestAdjust: noTestDirAndNoReboot,
+		buildsRepo:     onlyGo,
 		env: []string{
 			"GOARCH=amd64",
 			"GOHOSTARCH=amd64",
@@ -2195,33 +2196,23 @@
 			// up:
 			"GO_TEST_TIMEOUT_SCALE=2",
 		},
-		buildsRepo: func(repo, branch, goBranch string) bool {
-			// This builder bill be used up to Go 1.17.
-			return atMostGo1(goBranch, 17) && onlyGo(repo, branch, goBranch)
-		},
 	})
 	addBuilder(BuildConfig{
-		Name:           "windows-386-2008",
-		HostType:       "host-windows-amd64-2008",
-		distTestAdjust: fasterTrybots,
-		env:            []string{"GOARCH=386", "GOHOSTARCH=386"},
-		tryBot:         defaultTrySet(),
-		buildsRepo: func(repo, branch, goBranch string) bool {
-			// This builder bill be used up to Go 1.17.
-			return atMostGo1(goBranch, 17) && defaultPlusExpBuild(repo, branch, goBranch)
-		},
+		Name:              "windows-386-2008",
+		HostType:          "host-windows-amd64-2008",
+		buildsRepo:        defaultPlusExpBuild,
+		distTestAdjust:    fasterTrybots,
+		env:               []string{"GOARCH=386", "GOHOSTARCH=386"},
+		tryBot:            defaultTrySet(),
 		numTryTestHelpers: 4,
 	})
 	addBuilder(BuildConfig{
-		Name:           "windows-386-2012",
-		HostType:       "host-windows-amd64-2012",
-		distTestAdjust: fasterTrybots,
-		env:            []string{"GOARCH=386", "GOHOSTARCH=386"},
-		tryBot:         defaultTrySet(),
-		buildsRepo: func(repo, branch, goBranch string) bool {
-			// This builder is used by Go 1.18 and forward.
-			return atLeastGo1(goBranch, 18) && defaultPlusExpBuild(repo, branch, goBranch)
-		},
+		Name:              "windows-386-2012",
+		HostType:          "host-windows-amd64-2012",
+		distTestAdjust:    fasterTrybots,
+		buildsRepo:        onlyGo,
+		env:               []string{"GOARCH=386", "GOHOSTARCH=386"},
+		tryBot:            defaultTrySet(),
 		numTryTestHelpers: 4,
 	})
 	addBuilder(BuildConfig{
diff --git a/dashboard/builders_test.go b/dashboard/builders_test.go
index a7bb981..5f8a860 100644
--- a/dashboard/builders_test.go
+++ b/dashboard/builders_test.go
@@ -103,6 +103,7 @@
 				"openbsd-amd64-68",
 				"openbsd-amd64-70",
 				"openbsd-amd64-70-n1",
+				"windows-386-2008",
 				"windows-386-2012",
 				"windows-amd64-2016",
 
@@ -137,6 +138,7 @@
 				"openbsd-amd64-68",
 				"openbsd-amd64-70",
 				"openbsd-amd64-70-n1",
+				"windows-386-2008",
 				"windows-386-2012",
 				"windows-amd64-2016",
 
@@ -169,6 +171,7 @@
 				"linux-arm64-aws",
 				"openbsd-amd64-68",
 				"windows-386-2008",
+				"windows-386-2012",
 				"windows-amd64-2016",
 
 				"misc-compile-darwinarm64", // Starts with Go 1.16.
@@ -205,6 +208,7 @@
 				"linux-arm64-aws",
 				"openbsd-amd64-68",
 				"windows-386-2008",
+				"windows-386-2012",
 				"windows-amd64-2016",
 
 				"misc-compile-freebsd",
@@ -257,7 +261,7 @@
 				"openbsd-amd64-68",
 				"openbsd-amd64-70",
 				"openbsd-amd64-70-n1",
-				"windows-386-2012",
+				"windows-386-2008",
 				"windows-amd64-2016",
 			},
 		},
@@ -267,7 +271,7 @@
 			want: []string{
 				"linux-amd64",
 				"linux-amd64-race",
-				"windows-386-2012",
+				"windows-386-2008",
 				"windows-amd64-2016",
 			},
 		},
@@ -289,12 +293,12 @@
 			}
 			for _, b := range got {
 				if _, ok := m[b]; !ok {
-					t.Errorf("got unexpected %q", b)
+					t.Errorf("got unexpected %q for %s/%s", b, tt.repo, tt.branch)
 				}
 				delete(m, b)
 			}
 			for b := range m {
-				t.Errorf("missing expected %q", b)
+				t.Errorf("missing expected %q for %s/%s", b, tt.repo, tt.branch)
 			}
 		})
 	}
@@ -547,8 +551,7 @@
 		{b("linux-amd64", "exp"), both},
 		{b("linux-amd64-race", "exp"), both},
 		{b("linux-amd64-longtest", "exp"), onlyPost},
-		{b("windows-386-2008", "exp"), none},
-		{b("windows-386-2012", "exp"), both},
+		{b("windows-386-2008", "exp"), both},
 		{b("windows-amd64-2016", "exp"), both},
 		{b("darwin-amd64-10_14", "exp"), onlyPost},
 		{b("darwin-amd64-10_15", "exp"), onlyPost},