Skip to content

Commit ccd3923

Browse files
committed
cmd/watchflakes: look for both gitilesCommit and gitiles_commit
The JSON describing a build changed, slightly. Old convention was camel case, new convention is snake case. I don't know for sure, but allegedly Fixes golang/go#69609. Change-Id: Ic998e0aa3922749f36528d1f7c4fe4cbe6fc690f Reviewed-on: https://go-review.googlesource.com/c/build/+/615515 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Carlos Amedee <[email protected]>
1 parent fa5685c commit ccd3923

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

cmd/watchflakes/luci.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,12 @@ func (c *LUCIClient) GetBuildResult(ctx context.Context, repo string, builder Bu
355355
var commit, goCommit string
356356
prop := b.GetOutput().GetProperties().GetFields()
357357
for _, s := range prop["sources"].GetListValue().GetValues() {
358-
x := s.GetStructValue().GetFields()["gitilesCommit"].GetStructValue().GetFields()
358+
fm := s.GetStructValue().GetFields()
359+
gc := fm["gitilesCommit"]
360+
if gc == nil {
361+
gc = fm["gitiles_commit"]
362+
}
363+
x := gc.GetStructValue().GetFields()
359364
c := x["id"].GetStringValue()
360365
switch bRepo := x["project"].GetStringValue(); bRepo {
361366
case repo:

0 commit comments

Comments
 (0)