cherry/testtiming: update for some LUCI changes Apply CL 615515 and CL 623995 to the LUCI fetching code. Change-Id: I90f8cccdf80831319204f6fa038c81143228b6e7 Reviewed-on: https://go-review.googlesource.com/c/scratch/+/684735 Reviewed-by: Cherry Mui <cherryyz@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
diff --git a/cherry/testtiming/luci.go b/cherry/testtiming/luci.go index a399a49..09da1c7 100644 --- a/cherry/testtiming/luci.go +++ b/cherry/testtiming/luci.go
@@ -285,7 +285,12 @@ var commit, goCommit string prop := b.GetOutput().GetProperties().GetFields() for _, s := range prop["sources"].GetListValue().GetValues() { - x := s.GetStructValue().GetFields()["gitilesCommit"].GetStructValue().GetFields() + fm := s.GetStructValue().GetFields() + gc := fm["gitilesCommit"] + if gc == nil { + gc = fm["gitiles_commit"] + } + x := gc.GetStructValue().GetFields() c := x["id"].GetStringValue() switch repo := x["project"].GetStringValue(); repo { case dash.Repo: @@ -293,13 +298,14 @@ case "go": goCommit = c default: - log.Fatalf("repo mismatch: %s %s %s", repo, dash.Repo, buildURL(id)) + log.Printf("repo mismatch: %s %s %s", repo, dash.Repo, buildURL(id)) } } if commit == "" { switch b.GetStatus() { case bbpb.Status_SUCCESS: - log.Fatalf("empty commit: %s", buildURL(id)) + log.Printf("empty commit: %s", buildURL(id)) + fallthrough default: // unfinished build, or infra failure, ignore continue