Skip to content

Commit 4834867

Browse files
dmitshurcodebien
authored andcommitted
app/appengine: hide release-branch-only builders when viewing master branch
This is a follow-up to CL 199800. That change started to consider more builders as active to allow release-branch-only builders to run. However, it also made those builders show up as new empty columns when viewing builds for the master branch. There are quite a few old FreeBSD builders that only run on release-branch.go1.12, and it's too disruptive to have them appear everywhere. So, hide them when viewing the master branch of Go repo in the UI. There can be more UI improvements to be made, and this can become too much of a whack-a-mole to address them one by one. The scope of this CL is to fix the most disruptive high priority problem for now. Further improvements will happen later, with merging of app/appengine and cmd/coordinator codebases in mind. Updates golang/go#34738 Updates golang/go#34744 Change-Id: I3df75f8b2bbd5f6fe8097c181ee8a1b1b4354dc9 Reviewed-on: https://go-review.googlesource.com/c/build/+/199878 Run-TryBot: Dmitri Shuralyov <[email protected]> Reviewed-by: Bryan C. Mills <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
1 parent 43235f5 commit 4834867

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

app/appengine/ui.go

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,12 @@ func uiHandler(w http.ResponseWriter, r *http.Request) {
178178
return
179179
}
180180

181+
// In the UI, when viewing the master branch of the main
182+
// Go repository, hide builders that aren't active on it.
183+
if repo == "" && branch == "master" {
184+
data.Builders = onlyGoMasterBuilders(data.Builders)
185+
}
186+
181187
// Populate building URLs for the HTML UI only.
182188
data.populateBuildingURLs(c)
183189

@@ -206,7 +212,7 @@ func listBranches(c context.Context) (branches []string) {
206212
return
207213
}
208214

209-
// failuresHandler is https://build.golang.org/?mode=failures , where it outputs
215+
// failuresHandler is https://build.golang.org/?mode=failures, where it outputs
210216
// one line per failure on the front page, in the form:
211217
// hash builder failure-url
212218
func failuresHandler(w http.ResponseWriter, r *http.Request, data *uiTemplateData) {
@@ -400,6 +406,20 @@ func keys(m map[string]bool) (s []string) {
400406
return
401407
}
402408

409+
// onlyGoMasterBuilders returns a subset of all builders that are
410+
// configured to do post-submit builds on master branch of Go repo.
411+
func onlyGoMasterBuilders(all []string) []string {
412+
var goMaster []string
413+
for _, name := range all {
414+
bc, ok := dashboard.Builders[name]
415+
if !ok || !bc.BuildsRepoPostSubmit("go", "master", "master") {
416+
continue
417+
}
418+
goMaster = append(goMaster, name)
419+
}
420+
return goMaster
421+
}
422+
403423
// builderOrder implements sort.Interface, sorting builder names
404424
// ("darwin-amd64", etc) first by builderPriority and then alphabetically.
405425
type builderOrder []string

0 commit comments

Comments
 (0)