Skip to content

Commit

Permalink
app/appengine: hide release-branch-only builders when viewing master …
Browse files Browse the repository at this point in the history
…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]>
  • Loading branch information
dmitshur committed Oct 8, 2019
1 parent 76fd6b5 commit 817d966
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion app/appengine/ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,12 @@ func uiHandler(w http.ResponseWriter, r *http.Request) {
return
}

// In the UI, when viewing the master branch of the main
// Go repository, hide builders that aren't active on it.
if repo == "" && branch == "master" {
data.Builders = onlyGoMasterBuilders(data.Builders)
}

// Populate building URLs for the HTML UI only.
data.populateBuildingURLs(c)

Expand Down Expand Up @@ -206,7 +212,7 @@ func listBranches(c context.Context) (branches []string) {
return
}

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

// onlyGoMasterBuilders returns a subset of all builders that are
// configured to do post-submit builds on master branch of Go repo.
func onlyGoMasterBuilders(all []string) []string {
var goMaster []string
for _, name := range all {
bc, ok := dashboard.Builders[name]
if !ok || !bc.BuildsRepoPostSubmit("go", "master", "master") {
continue
}
goMaster = append(goMaster, name)
}
return goMaster
}

// builderOrder implements sort.Interface, sorting builder names
// ("darwin-amd64", etc) first by builderPriority and then alphabetically.
type builderOrder []string
Expand Down

0 comments on commit 817d966

Please sign in to comment.