Add canary roll CL link to canary task driver
https://screenshot.googleplex.com/yo6aL7mtsY3 Bug: skia:10477 Change-Id: I5b7cc1a5f72583b0e62e627b5258ec1436bf3a0c Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303260 Commit-Queue: Ravi Mistry <rmistry@google.com> Reviewed-by: Eric Boren <borenet@google.com>
This commit is contained in:
parent
6514832226
commit
21522e846e
3
go.mod
3
go.mod
@ -4,6 +4,7 @@ go 1.12
|
||||
|
||||
require (
|
||||
cloud.google.com/go v0.61.0 // indirect
|
||||
cloud.google.com/go/datastore v1.2.0
|
||||
cloud.google.com/go/pubsub v1.5.0 // indirect
|
||||
cloud.google.com/go/storage v1.10.0
|
||||
github.com/99designs/goodies v0.0.0-20140916053233-ec7f410f2ff2 // indirect
|
||||
@ -26,7 +27,7 @@ require (
|
||||
github.com/stretchr/testify v1.6.1
|
||||
github.com/vektra/mockery v1.1.2 // indirect
|
||||
go.chromium.org/luci v0.0.0-20200714005733-7a755727d74d // indirect
|
||||
go.skia.org/infra v0.0.0-20200713190753-d1daff06b038
|
||||
go.skia.org/infra v0.0.0-20200716131439-4244d8caa80b
|
||||
golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899 // indirect
|
||||
golang.org/x/exp v0.0.0-20200228211341-fcea875c7e85 // indirect
|
||||
golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8 // indirect
|
||||
|
3
go.sum
3
go.sum
@ -773,6 +773,7 @@ github.com/skia-dev/go2ts v1.3.1 h1:3uw+9eCAaXjQE646bOccvBDDCw6R+PHwXUZAhhXXQzg=
|
||||
github.com/skia-dev/go2ts v1.3.1/go.mod h1:pE59J8wf5IHSMtPhH8PmWq5ZTLt6p1Ih+4ODd9fkGXk=
|
||||
github.com/skia-dev/go2ts v1.3.2 h1:ilwpMf2M8xxZCmElFf5x7WI7pokKqZiYxQkQ2oqYHWE=
|
||||
github.com/skia-dev/go2ts v1.3.2/go.mod h1:pE59J8wf5IHSMtPhH8PmWq5ZTLt6p1Ih+4ODd9fkGXk=
|
||||
github.com/skia-dev/go2ts v1.3.3/go.mod h1:pE59J8wf5IHSMtPhH8PmWq5ZTLt6p1Ih+4ODd9fkGXk=
|
||||
github.com/skia-dev/google-api-go-client v0.10.1-0.20200109184256-16c3d6f408b2 h1:Id5JdSD66PKQQiiVFG1VXDVCT5U3DcDzJSReXRxKRLk=
|
||||
github.com/skia-dev/google-api-go-client v0.10.1-0.20200109184256-16c3d6f408b2/go.mod h1:N0iTzjbw95ZVfOL7wVngmVXE2kG0NP+LYlq3QMwf9Qo=
|
||||
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
|
||||
@ -1101,6 +1102,8 @@ go.skia.org/infra v0.0.0-20200709211939-9acc96b0753c h1:sgK3KuxLu6JJVmUZIAdMUi5U
|
||||
go.skia.org/infra v0.0.0-20200709211939-9acc96b0753c/go.mod h1:dNfsYphZk1yD3L700jW76XyiMwiPLq9ZJkJtAz5jkGU=
|
||||
go.skia.org/infra v0.0.0-20200713190753-d1daff06b038 h1:GkHR6qeSY1r8hSSglcJqabyUBlaGsKQWZQeGbwVlMwM=
|
||||
go.skia.org/infra v0.0.0-20200713190753-d1daff06b038/go.mod h1:zfu28RupR3UvPnglFAlYuzRZmGay+YZkOhGaNYj5gXw=
|
||||
go.skia.org/infra v0.0.0-20200716131439-4244d8caa80b h1:fll+xjSjHku+Cw3L/d2S27Hx1wZENQKm8pU+ZdNJjWU=
|
||||
go.skia.org/infra v0.0.0-20200716131439-4244d8caa80b/go.mod h1:9W+GA25bm1ATJJudXnD5w5Eef8H5ZOMeyvoMvpDO+pM=
|
||||
go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
|
||||
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
|
||||
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
|
||||
|
@ -80,24 +80,30 @@ func main() {
|
||||
}
|
||||
}
|
||||
|
||||
func waitForCanaryRoll(ctx context.Context, manualRollDB manual.DB, rollId string) error {
|
||||
ctx = td.StartStep(ctx, td.Props("Wait for canary roll"))
|
||||
func waitForCanaryRoll(parentCtx context.Context, manualRollDB manual.DB, rollId string) error {
|
||||
ctx := td.StartStep(parentCtx, td.Props("Wait for canary roll"))
|
||||
defer td.EndStep(ctx)
|
||||
|
||||
// For writing to the step's log stream.
|
||||
stdout := td.NewLogStream(ctx, "stdout", td.Info)
|
||||
|
||||
// Lets add the roll link only once to step data.
|
||||
addedRollLinkStepData := false
|
||||
for {
|
||||
roll, err := manualRollDB.Get(ctx, rollId)
|
||||
if err != nil {
|
||||
return td.FailStep(ctx, fmt.Errorf("Could not find canary roll with ID: %s", rollId))
|
||||
}
|
||||
cl := roll.Url
|
||||
// TODO(rmistry): Figure out how to display the CL number in task driver.
|
||||
var rollStatus string
|
||||
if cl == "" {
|
||||
rollStatus = fmt.Sprintf("Canary roll has status %s", roll.Status)
|
||||
} else {
|
||||
if !addedRollLinkStepData {
|
||||
// Add the roll link to both the current step and it's parent.
|
||||
td.StepText(ctx, "Canary roll CL", cl)
|
||||
td.StepText(parentCtx, "Canary roll CL", cl)
|
||||
addedRollLinkStepData = true
|
||||
}
|
||||
rollStatus = fmt.Sprintf("Canary roll [ %s ] has status %s", roll.Url, roll.Status)
|
||||
}
|
||||
if _, err := stdout.Write([]byte(rollStatus)); err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user