Skip to content

Commit

Permalink
app/appengine: don't exclude release-branch-only builders
Browse files Browse the repository at this point in the history
The filtering of builders in commitBuilders was too strict,
causing post-submit builders that are configured to run on
release-branches only to not get included in the list of
builders.

This change makes the following builders no longer skipped:

	darwin-amd64-10_10
	freebsd-386-10_3
	freebsd-386-10_4
	freebsd-386-11_1
	freebsd-amd64-10_3
	freebsd-amd64-10_4
	freebsd-amd64-11_1
	nacl-386
	nacl-amd64p32

We may need to adjust the build.golang.org UI after to avoid
including unhelpful columns, but this is a first step to get
nacl builders to run on release branches again.

Updates golang/go#34738
Updates golang/go#34744

Change-Id: Iaf2b93aedd5f44b48b9a63b57f12549fe50b1637
Reviewed-on: https://go-review.googlesource.com/c/build/+/199800
Reviewed-by: Brad Fitzpatrick <[email protected]>
  • Loading branch information
dmitshur authored and codebien committed Nov 13, 2019
1 parent c608f07 commit 10e9c6d
Showing 1 changed file with 23 additions and 6 deletions.
29 changes: 23 additions & 6 deletions app/appengine/ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ func uiHandler(w http.ResponseWriter, r *http.Request) {
logErr(w, r, err)
return
}
builders := commitBuilders(commits)

branches := listBranches(c)
releaseBranches := supportedReleaseBranches(branches)
builders := commitBuilders(commits, releaseBranches)

var tagState []*TagState
// Only show sub-repo state on first page of normal repo view.
Expand All @@ -112,7 +112,7 @@ func uiHandler(w http.ResponseWriter, r *http.Request) {
return
}
tagState = []*TagState{s}
for _, b := range supportedReleaseBranches(branches) {
for _, b := range releaseBranches {
s, err := GetTagState(c, "release", b)
if err == datastore.ErrNoSuchEntity {
continue
Expand Down Expand Up @@ -351,9 +351,9 @@ func fetchCommits(c context.Context, pkg *Package, hashes []string) ([]*Commit,
return out, err
}

// commitBuilders returns the names of the builders that provided
// commitBuilders returns the names of active builders that provided
// Results for the provided commits.
func commitBuilders(commits []*Commit) []string {
func commitBuilders(commits []*Commit, releaseBranches []string) []string {
builders := make(map[string]bool)
for _, commit := range commits {
for _, r := range commit.Results() {
Expand All @@ -364,7 +364,7 @@ func commitBuilders(commits []*Commit) []string {
// We want to see columns even if there are no results so we
// can identify missing builders. (Issue 19930)
for name, bc := range dashboard.Builders {
if !bc.BuildsRepoPostSubmit("go", "master", "master") {
if !activePostSubmitBuilder(bc, releaseBranches) {
continue
}
builders[name] = true
Expand All @@ -374,6 +374,23 @@ func commitBuilders(commits []*Commit) []string {
return k
}

// activePostSubmitBuilder reports whether the builder bc
// is considered to be "active", meaning it's configured
// to test the Go repository on master branch or at least
// one of the supported release branches.
func activePostSubmitBuilder(bc *dashboard.BuildConfig, releaseBranches []string) bool {
if bc.BuildsRepoPostSubmit("go", "master", "master") {
return true
}
for _, rb := range releaseBranches {
if bc.BuildsRepoPostSubmit("go", rb, rb) {
return true
}
}
// TODO(golang.org/issue/34744): This doesn't catch x-repo-only builders yet; adjust further as needed.
return false
}

func keys(m map[string]bool) (s []string) {
s = make([]string, 0, len(m))
for k := range m {
Expand Down

0 comments on commit 10e9c6d

Please sign in to comment.