app: return the name of the Go branch in the JSON state of subrepos

We want to pass this down to the coordinator so each
dashboard.BuildConfig can have its own policy on which branches to
build. For example, we'll have NetBSD skip building subrepos for Go
versions that are too old.

Updates golang/go#23102

Change-Id: I40d35c9c5a6d4455772430c169dbea054929545e
Reviewed-on: https://go-review.googlesource.com/83536
Reviewed-by: Andrew Bonventre <andybons@golang.org>
This commit is contained in:
Brad Fitzpatrick 2017-12-12 19:05:47 +00:00
Родитель 9f11edf3be
Коммит f4148b59b4
3 изменённых файлов: 18 добавлений и 0 удалений

Просмотреть файл

@ -7,5 +7,11 @@ gcloud config set project golang-org
gcloud app deploy --no-promote -v {build|build-test} app.yaml
```
or, to not affect your gcloud state, use:
```
gcloud app --account=username@google.com --project=golang-org deploy --no-promote -v build app.yaml
```
Using -v build will run as build.golang.org.
Using -v build-test will run as build-test.golang.org.

Просмотреть файл

@ -244,10 +244,17 @@ func jsonHandler(w http.ResponseWriter, r *http.Request, data *uiTemplateData) {
for _, ts := range data.TagState {
for _, pkgState := range ts.Packages {
goRev := ts.Tag.Hash
goBranch := ts.Name
if goBranch == "tip" {
// Normalize old hg terminology into
// our git branch name.
goBranch = "master"
}
rev := types.BuildRevision{
Repo: pkgState.Package.Name,
GoRevision: goRev,
Results: make([]string, len(data.Builders)),
GoBranch: goBranch,
}
commitToBuildRevision(pkgState.Commit, &rev)
for i, b := range res.Builders {

Просмотреть файл

@ -45,6 +45,11 @@ type BuildRevision struct {
// Branch is the branch of this commit, e.g. "master" or "dev.ssa".
Branch string `json:"branch"`
// GoBranch is the branch of the GoRevision, for subrepos.
// It is empty for the main repo.
// Otherwise it's of the form "master", "release-branch.go1.8", etc.
GoBranch string `json:"goBranch,omitempty"`
// Author is the author of this commit in standard git form
// "Name <email>".
Author string `json:"author"`