Skip to content

Commit

Permalink
dashboard: add a map for hiding builders that migrated to LUCI
Browse files Browse the repository at this point in the history
This sets a path forward for hiding builders that have migrated.
Outright deleting their configuration is left for a later phase.

For golang/go#65913.
Updates golang/go#63471.

Change-Id: Icaa40cbaf5e9395ef6f82fc70a6febc2ec8bc838
Reviewed-on: https://go-review.googlesource.com/c/build/+/568196
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
  • Loading branch information
dmitshur authored and gopherbot committed Feb 29, 2024
1 parent 253aa5b commit 09eab47
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/coordinator/internal/dashboard/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@ func (d *Handler) getBuilders(conf map[string]*dashboard.BuildConfig, luci lucip
if !b.BuildsRepoPostSubmit("go", "master", "master") {
continue
}
if dashboard.BuildersPortedToLUCI[b.Name] && len(luci.Builders) > 0 {
// Don't display old builders that have been ported
// to LUCI if willing to show LUCI builders as well.
continue
}
db := bm[b.GOOS()]
db.OS = b.GOOS()
db.Archs = append(db.Archs, &arch{
Expand Down
18 changes: 18 additions & 0 deletions cmd/coordinator/internal/legacydash/ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,15 @@ func (tb *uiTemplateDataBuilder) buildTemplateData(ctx context.Context, datastor
for _, pkg := range ts.Packages {
addBuilders(builders, pkg.Package.Name, ts.Branch())
}
if len(luci.Builders) > 0 {
for name := range builders {
if dashboard.BuildersPortedToLUCI[name] {
// Don't display old builders that have been ported
// to LUCI if willing to show LUCI builders as well.
delete(builders, name)
}
}
}
addLUCIBuilders(luci, builders, ts.Packages, gorel.BranchName)
ts.Builders = builderKeys(builders)

Expand Down Expand Up @@ -510,6 +519,15 @@ func (tb *uiTemplateDataBuilder) buildTemplateData(ctx context.Context, datastor
} else {
addBuilders(builders, tb.repoGerritProj(), tb.branch())
}
if len(luci.Builders) > 0 {
for name := range builders {
if dashboard.BuildersPortedToLUCI[name] {
// Don't display old builders that have been ported
// to LUCI if willing to show LUCI builders as well.
delete(builders, name)
}
}
}
data.Builders = builderKeys(builders)

if tb.res.CommitsTruncated {
Expand Down
22 changes: 22 additions & 0 deletions dashboard/builders.go
Original file line number Diff line number Diff line change
Expand Up @@ -2863,6 +2863,24 @@ func init() {
})
}

// BuildersPortedToLUCI lists coordinator builders that have been ported
// over to LUCI and don't need to continue to run. Their results will be
// hidden from the build.golang.org page and new builds won't be started
// if stopPortedBuilders (below) is true.
//
// See go.dev/issue/65913
// and go.dev/issue/63471.
var BuildersPortedToLUCI = map[string]bool{
"wasip1-wasm-wasmedge": true, // Would be 'wasip1-wasm_wasmedge' but put off until go.dev/issue/60097 picks up activity.

// TODO(go.dev/issue/63471): Add more here. For example:
//"wasip1-wasm-wazero": true, // Available as https://ci.chromium.org/p/golang/builders/ci/gotip-wasip1-wasm_wazero.
}

// stopPortedBuilders controls whether ported builders should be stopped,
// instead of just made invisible in the web UI.
const stopPortedBuilders = false

// addBuilder adds c to the Builders map after doing some checks.
func addBuilder(c BuildConfig) {
if c.Name == "" {
Expand Down Expand Up @@ -2899,6 +2917,10 @@ func addBuilder(c BuildConfig) {
panic(fmt.Sprintf("build config %q host type inconsistent (must be Reverse, Image, or VM)", c.Name))
}

if BuildersPortedToLUCI[c.Name] && stopPortedBuilders {
return
}

Builders[c.Name] = &c
}

Expand Down

0 comments on commit 09eab47

Please sign in to comment.