Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(474)

Unified Diff: common/api/dm/service/v1/walk_graph_normalize.go

Issue 1537883002: Initial distributor implementation (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-go@master
Patch Set: self review Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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
« common/api/dm/service/v1/walk_graph.proto ('K') | « common/api/dm/service/v1/walk_graph.pb.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698