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

Side by Side Diff: milo/buildsource/console.go

Issue 2984673002: [milo] get console in working shape. (Closed)
Patch Set: fix build Created 3 years, 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | milo/common/config.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The LUCI Authors. 1 // Copyright 2017 The LUCI Authors.
2 // 2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 54
55 ret := make([]*ConsoleRow, len(commits)) 55 ret := make([]*ConsoleRow, len(commits))
56 url := console.RepoURL 56 url := console.RepoURL
57 // HACK(iannucci): This little hack should be removed when console defin itions 57 // HACK(iannucci): This little hack should be removed when console defin itions
58 // no longer use a manifest name of "REVISION". REVISION was used to ind ex the 58 // no longer use a manifest name of "REVISION". REVISION was used to ind ex the
59 // 'got_revision' value before manifests were implemented. 59 // 'got_revision' value before manifests were implemented.
60 if console.ManifestName == "REVISION" { 60 if console.ManifestName == "REVISION" {
61 url = "" 61 url = ""
62 } 62 }
63 partialKey := model.NewPartialManifestKey(project, console.ID, console.M anifestName, url) 63 partialKey := model.NewPartialManifestKey(project, console.ID, console.M anifestName, url)
64 » q := datastore.NewQuery("BuildSummary").KeysOnly(true) 64 » q := datastore.NewQuery("BuildSummary")
65 err := parallel.WorkPool(4, func(ch chan<- func() error) { 65 err := parallel.WorkPool(4, func(ch chan<- func() error) {
66 for i := range rawCommits { 66 for i := range rawCommits {
67 i := i 67 i := i
68 r := &ConsoleRow{Commit: commits[i]} 68 r := &ConsoleRow{Commit: commits[i]}
69 ret[i] = r 69 ret[i] = r
70 ch <- func() error { 70 ch <- func() error {
71 » » » » fullQ := q.Eq("ManifestKey", partialKey.AddRevis ion(rawCommits[i])) 71 » » » » fullQ := q.Eq("ManifestKeys", partialKey.AddRevi sion(rawCommits[i]))
72 return datastore.Run(c, fullQ, func(bs *model.Bu ildSummary) { 72 return datastore.Run(c, fullQ, func(bs *model.Bu ildSummary) {
73 if builderSet.Has(bs.BuilderID) { 73 if builderSet.Has(bs.BuilderID) {
74 bid := BuilderID(bs.BuilderID) 74 bid := BuilderID(bs.BuilderID)
75 if r.Builds == nil { 75 if r.Builds == nil {
76 r.Builds = map[BuilderID ][]*model.BuildSummary{} 76 r.Builds = map[BuilderID ][]*model.BuildSummary{}
77 } 77 }
78 r.Builds[bid] = append(r.Builds[ bid], bs) 78 r.Builds[bid] = append(r.Builds[ bid], bs)
79 } 79 }
80 }) 80 })
81 } 81 }
82 } 82 }
83 }) 83 })
84 84
85 return ret, err 85 return ret, err
86 } 86 }
OLDNEW
« no previous file with comments | « no previous file | milo/common/config.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698