Index: common/api/dm/service/v1/walk_graph_normalize.go |
diff --git a/common/api/dm/service/v1/walk_graph_normalize.go b/common/api/dm/service/v1/walk_graph_normalize.go |
index 0a412112ebe2dc06fb6ccf82b12e56e0c596a5a3..c2d5ae55fc08b893016033e1832e82cf34ac0a0d 100644 |
--- a/common/api/dm/service/v1/walk_graph_normalize.go |
+++ b/common/api/dm/service/v1/walk_graph_normalize.go |
@@ -6,6 +6,7 @@ package dm |
import ( |
"github.com/luci/luci-go/common/errors" |
+ "math" |
) |
const ( |
@@ -18,6 +19,12 @@ const ( |
// Normalize returns an error iff the WalkGraphReq is invalid. |
func (w *WalkGraphReq) Normalize() error { |
+ if w.Auth != nil { |
+ if err := w.Auth.Normalize(); err != nil { |
+ return err |
+ } |
+ } |
+ |
if w.Query == nil { |
return errors.New("must specify a Query") |
} |
@@ -49,8 +56,23 @@ func (w *WalkGraphReq) Normalize() error { |
if w.Include == nil { |
w.Include = &WalkGraphReq_Include{} |
} else { |
- if w.Include.AttemptResult { |
+ if w.Include.All { |
+ w.Include.ObjectIds = true |
+ w.Include.QuestData = true |
w.Include.AttemptData = true |
+ w.Include.AttemptResult = true |
+ w.Include.ExpiredAttempts = true |
+ w.Include.NumExecutions = math.MaxUint32 |
+ w.Include.ExecutionInfoUrl = true |
+ w.Include.FwdDeps = true |
+ w.Include.BackDeps = true |
+ } else { |
+ if w.Include.AttemptResult { |
+ w.Include.AttemptData = true |
+ } |
+ if w.Include.NumExecutions == 0 { |
+ w.Include.ExecutionInfoUrl = false |
+ } |
} |
} |
return nil |