Skip to content

Commit 906dcfd

Browse files
committed
maintner/maintnerd/maintapi: add supported Go releases to subrepo trybots
This change computes the supported Go release branches, and adds them to the GerritTryWorkItem for trybots that run on subrepos. This should help significantly with trybots catching regressions in subrepos that affect older, but supported Go releases. Fixes golang/go#17626 Change-Id: I4d88f6510c34d0c28266d44c341d5831a8514fce Reviewed-on: https://go-review.googlesource.com/c/147198 Reviewed-by: Brad Fitzpatrick <[email protected]>
1 parent 9187b9e commit 906dcfd

File tree

1 file changed

+10
-5
lines changed
  • maintner/maintnerd/maintapi

1 file changed

+10
-5
lines changed

maintner/maintnerd/maintapi/api.go

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,11 @@ func (s apiService) GoFindTryWork(ctx context.Context, req *apipb.GoFindTryWorkR
172172
res := new(apipb.GoFindTryWorkResponse)
173173
goProj := s.c.Gerrit().Project("go.googlesource.com", "go")
174174

175+
supportedReleases, err := supportedGoReleases(goProj)
176+
if err != nil {
177+
return nil, err
178+
}
179+
175180
for _, ci := range cis {
176181
cl := s.c.Gerrit().Project("go.googlesource.com", ci.Project).CL(int32(ci.ChangeNumber))
177182
if cl == nil {
@@ -184,13 +189,13 @@ func (s apiService) GoFindTryWork(ctx context.Context, req *apipb.GoFindTryWorkR
184189
work.Commit = ci.CurrentRevision
185190
}
186191
if work.Project != "go" {
187-
// Trybot on a subrepo.
188-
//
189-
// TODO: for Issue 17626, we need to append
190-
// master and the past two releases, but for
191-
// now we'll just do master.
192+
// Trybot on a subrepo. Append master and the supported releases.
192193
work.GoBranch = append(work.GoBranch, "master")
193194
work.GoCommit = append(work.GoCommit, goProj.Ref("refs/heads/master").String())
195+
for _, r := range supportedReleases {
196+
work.GoBranch = append(work.GoBranch, r.BranchName)
197+
work.GoCommit = append(work.GoCommit, r.BranchCommit)
198+
}
194199
}
195200
res.Waiting = append(res.Waiting, work)
196201
}

0 commit comments

Comments
 (0)