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

Side by Side Diff: milo/appengine/logdog/logDogBuild.go

Issue 2254993002: Milo: Add task expired as a failure status (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-go@master
Patch Set: Use proto instead Created 4 years, 3 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 | « milo/appengine/logdog/internal/stream.pb.go ('k') | milo/appengine/swarming/build.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 2016 The LUCI Authors. All rights reserved. 1 // Copyright 2016 The LUCI Authors. All rights reserved.
2 // Use of this source code is governed under the Apache License, Version 2.0 2 // Use of this source code is governed under the Apache License, Version 2.0
3 // that can be found in the LICENSE file. 3 // that can be found in the LICENSE file.
4 4
5 package logdog 5 package logdog
6 6
7 import ( 7 import (
8 "fmt" 8 "fmt"
9 "time" 9 "time"
10 10
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 case miloProto.Status_SUCCESS: 43 case miloProto.Status_SUCCESS:
44 comp.Status = resp.Success 44 comp.Status = resp.Success
45 45
46 case miloProto.Status_FAILURE: 46 case miloProto.Status_FAILURE:
47 if fd := anno.GetFailureDetails(); fd != nil { 47 if fd := anno.GetFailureDetails(); fd != nil {
48 switch fd.Type { 48 switch fd.Type {
49 case miloProto.FailureDetails_EXCEPTION, miloProto.Failu reDetails_INFRA: 49 case miloProto.FailureDetails_EXCEPTION, miloProto.Failu reDetails_INFRA:
50 comp.Status = resp.InfraFailure 50 comp.Status = resp.InfraFailure
51 51
52 case miloProto.FailureDetails_EXPIRED:
53 comp.Status = resp.Expired
54
52 case miloProto.FailureDetails_DM_DEPENDENCY_FAILED: 55 case miloProto.FailureDetails_DM_DEPENDENCY_FAILED:
53 comp.Status = resp.DependencyFailure 56 comp.Status = resp.DependencyFailure
54 57
55 default: 58 default:
56 comp.Status = resp.Failure 59 comp.Status = resp.Failure
57 } 60 }
58 61
59 if fd.Text != "" { 62 if fd.Text != "" {
60 comp.Text = append(comp.Text, fd.Text) 63 comp.Text = append(comp.Text, fd.Text)
61 } 64 }
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 } 143 }
141 144
142 // This should be the exact same thing. 145 // This should be the exact same thing.
143 comp.Text = append(comp.Text, anno.Text...) 146 comp.Text = append(comp.Text, anno.Text...)
144 147
145 return comp 148 return comp
146 } 149 }
147 150
148 // AddLogDogToBuild takes a set of logdog streams and populate a milo build. 151 // AddLogDogToBuild takes a set of logdog streams and populate a milo build.
149 // build.Summary.Finished must be set. 152 // build.Summary.Finished must be set.
150 func AddLogDogToBuild(c context.Context, ub URLBuilder, s *Streams, build *resp. MiloBuild) { 153 func AddLogDogToBuild(
151 » if s.MainStream == nil { 154 » c context.Context, ub URLBuilder, mainAnno *miloProto.Step, build *resp. MiloBuild) {
152 » » panic("missing main stream") 155 » now := clock.Now(c)
153 » }
154 » // Now Fetch the main annotation of the build.
155 » var (
156 » » mainAnno = s.MainStream.Data
157 » » now = clock.Now(c)
158 » )
159 156
160 // Now fill in each of the step components. 157 // Now fill in each of the step components.
161 // TODO(hinoka): This is totes cachable. 158 // TODO(hinoka): This is totes cachable.
162 buildCompletedTime := mainAnno.Ended.Time() 159 buildCompletedTime := mainAnno.Ended.Time()
163 build.Summary = *(miloBuildStep(ub, mainAnno, buildCompletedTime, now)) 160 build.Summary = *(miloBuildStep(ub, mainAnno, buildCompletedTime, now))
164 for _, substepContainer := range mainAnno.Substep { 161 for _, substepContainer := range mainAnno.Substep {
165 anno := substepContainer.GetStep() 162 anno := substepContainer.GetStep()
166 if anno == nil { 163 if anno == nil {
167 // TODO: We ignore non-embedded substeps for now. 164 // TODO: We ignore non-embedded substeps for now.
168 continue 165 continue
(...skipping 20 matching lines...) Expand all
189 for _, prop := range mainAnno.Property { 186 for _, prop := range mainAnno.Property {
190 propGroup.Property = append(propGroup.Property, &resp.Property{ 187 propGroup.Property = append(propGroup.Property, &resp.Property{
191 Key: prop.Name, 188 Key: prop.Name,
192 Value: prop.Value, 189 Value: prop.Value,
193 }) 190 })
194 } 191 }
195 build.PropertyGroup = append(build.PropertyGroup, propGroup) 192 build.PropertyGroup = append(build.PropertyGroup, propGroup)
196 193
197 return 194 return
198 } 195 }
OLDNEW
« no previous file with comments | « milo/appengine/logdog/internal/stream.pb.go ('k') | milo/appengine/swarming/build.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698