| OLD | NEW |
| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 default: | 70 default: |
| 71 comp.Status = resp.NotRun | 71 comp.Status = resp.NotRun |
| 72 } | 72 } |
| 73 | 73 |
| 74 if !(buildCompletedTime.IsZero() || comp.Status.Terminal()) { | 74 if !(buildCompletedTime.IsZero() || comp.Status.Terminal()) { |
| 75 // The build has completed, but this step has not. Mark it as an | 75 // The build has completed, but this step has not. Mark it as an |
| 76 // infrastructure failure. | 76 // infrastructure failure. |
| 77 comp.Status = resp.InfraFailure | 77 comp.Status = resp.InfraFailure |
| 78 } | 78 } |
| 79 | 79 |
| 80 » // Hide the unimportant steps. | 80 » // Hide the unimportant steps, highlight the interesting ones. |
| 81 » if comp.Status == resp.Success { | 81 » switch comp.Status { |
| 82 » case resp.Success: |
| 82 if _, ok := builtIn[anno.Name]; ok { | 83 if _, ok := builtIn[anno.Name]; ok { |
| 83 comp.Verbosity = resp.Hidden | 84 comp.Verbosity = resp.Hidden |
| 84 } | 85 } |
| 86 case resp.InfraFailure, resp.Failure: |
| 87 comp.Verbosity = resp.Interesting |
| 85 } | 88 } |
| 86 | 89 |
| 87 // Main link is a link to the stdout. | 90 // Main link is a link to the stdout. |
| 88 var stdoutLink *miloProto.Link | 91 var stdoutLink *miloProto.Link |
| 89 if anno.StdoutStream != nil { | 92 if anno.StdoutStream != nil { |
| 90 stdoutLink = &miloProto.Link{ | 93 stdoutLink = &miloProto.Link{ |
| 91 Label: "stdout", | 94 Label: "stdout", |
| 92 Value: &miloProto.Link_LogdogStream{ | 95 Value: &miloProto.Link_LogdogStream{ |
| 93 LogdogStream: anno.StdoutStream, | 96 LogdogStream: anno.StdoutStream, |
| 94 }, | 97 }, |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 for _, prop := range mainAnno.Property { | 189 for _, prop := range mainAnno.Property { |
| 187 propGroup.Property = append(propGroup.Property, &resp.Property{ | 190 propGroup.Property = append(propGroup.Property, &resp.Property{ |
| 188 Key: prop.Name, | 191 Key: prop.Name, |
| 189 Value: prop.Value, | 192 Value: prop.Value, |
| 190 }) | 193 }) |
| 191 } | 194 } |
| 192 build.PropertyGroup = append(build.PropertyGroup, propGroup) | 195 build.PropertyGroup = append(build.PropertyGroup, propGroup) |
| 193 | 196 |
| 194 return | 197 return |
| 195 } | 198 } |
| OLD | NEW |