Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <!-- | 1 <!-- |
| 2 Copyright 2014 The Chromium Authors. All rights reserved. | 2 Copyright 2014 The Chromium Authors. All rights reserved. |
| 3 Use of this source code is governed by a BSD-style license that can be | 3 Use of this source code is governed by a BSD-style license that can be |
| 4 found in the LICENSE file. | 4 found in the LICENSE file. |
| 5 --> | 5 --> |
| 6 | 6 |
| 7 <link rel="import" href="ct-builder.html"> | 7 <link rel="import" href="ct-builder.html"> |
| 8 | 8 |
| 9 <!-- Table of failure types, listing the failing builders for each type. --> | 9 <!-- Table of failure types, listing the failing builders for each type. --> |
| 10 <polymer-element name="ct-builder-grid" attributes="failures builderLatestRevisi ons"> | 10 <polymer-element name="ct-builder-grid" attributes="failures"> |
| 11 <template> | 11 <template> |
| 12 <style> | 12 <style> |
| 13 table { | 13 table { |
| 14 border-collapse: collapse; | 14 border-collapse: collapse; |
| 15 font-size: 11px; | 15 font-size: 11px; |
| 16 table-layout: fixed; | 16 table-layout: fixed; |
| 17 width: 350px; | 17 width: 350px; |
| 18 } | 18 } |
| 19 | 19 |
| 20 tbody td:first-child { | 20 tbody td:first-child { |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 57 | 57 |
| 58 .MISSING span { | 58 .MISSING span { |
| 59 padding-left: 0px; | 59 padding-left: 0px; |
| 60 } | 60 } |
| 61 | 61 |
| 62 .BUILDING, .BUILDING ~ td { | 62 .BUILDING, .BUILDING ~ td { |
| 63 opacity: 0.5; | 63 opacity: 0.5; |
| 64 } | 64 } |
| 65 </style> | 65 </style> |
| 66 <table> | 66 <table> |
| 67 <thead> | |
| 68 <tr> | |
| 69 <td>type</td> | |
| 70 <td>release</td> | |
| 71 <td>debug</td> | |
| 72 </tr> | |
| 73 </thead> | |
| 74 <tbody> | 67 <tbody> |
| 75 <template repeat="{{ type in resultTypes|resultTypeKeys }}"> | 68 <template repeat="{{ type in _resultTypes | _keys }}"> |
| 76 <tr> | 69 <tr> |
| 77 <td class="{{ type }}"> | 70 <td class="{{ type }}"> |
| 78 <span>{{ type }}</span> | 71 <span>{{ type }}</span> |
| 79 </td> | 72 </td> |
| 80 <td> | 73 <td> |
| 81 <template repeat="{{ builder in resultTypes[type]|keys }}"> | 74 <template repeat="{{ builder in _resultTypes[type] | _keys }}"> |
| 82 <template if="{{ !resultTypes[type][builder].debug }}"> | 75 <ct-builder builder="{{ builder }}"></ct-builder> |
| 83 <ct-builder builderName="{{ builder }}"></ct-builder> | |
| 84 </template> | |
| 85 </template> | |
| 86 </td> | |
| 87 <td> | |
| 88 <template repeat="{{ builder in resultTypes[type]|keys }}"> | |
| 89 <template if="{{ resultTypes[type][builder].debug }}"> | |
| 90 <ct-builder builderName="{{ builder }}"></ct-builder> | |
| 91 </template> | |
| 92 </template> | 76 </template> |
| 93 </td> | 77 </td> |
| 94 </tr> | 78 </tr> |
| 95 </template> | 79 </template> |
| 96 </tbody> | 80 </tbody> |
| 97 </table> | 81 </table> |
| 98 </template> | 82 </template> |
| 99 <script> | 83 <script> |
| 100 Polymer({ | 84 Polymer({ |
| 101 failures: [], | 85 failures: [], |
| 102 builderLatestRevisions: {}, | 86 _resultTypes: {}, |
| 103 resultTypes: {}, | |
| 104 | 87 |
| 105 keys: function(obj) { | 88 _keys: function(obj) { |
| 106 return Object.keys(obj).sort(); | 89 return Object.keys(obj).sort(); |
| 107 }, | 90 }, |
| 108 | 91 |
| 109 resultTypeKeys: function(obj) { | |
| 110 // Get the keys, but the BUILDING type should be last. | |
| 111 var keys = this.keys(obj); | |
| 112 var index = keys.indexOf('BUILDING'); | |
| 113 if (index != -1) { | |
| 114 var buildingResult = keys.splice(index, 1); | |
| 115 keys.push(buildingResult[0]); | |
| 116 } | |
| 117 return keys; | |
| 118 }, | |
| 119 | |
| 120 failuresChanged: function() { | 92 failuresChanged: function() { |
| 121 // Create a set of builders for each result type (e.g., text, crash). | 93 // Create a set of builders for each result type (e.g., text, crash). |
| 122 this.resultTypes = {}; | 94 this._resultTypes = {}; |
| 123 var passingRevisions = []; | |
| 124 this.failures.forEach(function(failure) { | 95 this.failures.forEach(function(failure) { |
| 125 passingRevisions.push(failure.newestPassingRevision); | |
| 126 var results = failure.resultNodesByBuilder; | 96 var results = failure.resultNodesByBuilder; |
| 127 Object.keys(results, (function(builder) { | 97 Object.keys(results, (function(builder) { |
| 128 var result = results[builder].actual; | 98 var result = results[builder].actual; |
| 129 if (!Object.has(this.resultTypes, result)) | 99 if (!this._resultTypes[result]) |
| 130 this.resultTypes[result] = {}; | 100 this._resultTypes[result] = {}; |
| 131 this.resultTypes[result][builder] = | 101 this._resultTypes[result][builder] = 1; |
|
michaelpg
2014/07/22 05:58:23
So can we just make this an array, then, instead o
ojan
2014/07/22 06:08:50
We need to dedupe the builders, so we'd need to do
| |
| 132 config.builders[builder]; | |
| 133 }).bind(this)); | 102 }).bind(this)); |
| 134 }, this); | 103 }, this); |
| 135 | |
| 136 var buildingType = this._getBuilding(passingRevisions); | |
| 137 if (!Object.isEmpty(buildingType)) | |
| 138 this.resultTypes['BUILDING'] = buildingType; | |
| 139 }, | |
| 140 | |
| 141 _buildersInFlightForRevision: function(revision) { | |
| 142 return Object.keys(this.builderLatestRevisions).filter(function(builder) { | |
| 143 // FIXME: This should look at all chromium/v8/etc revisions as well. | |
| 144 // Is this concept of "building" builders even useful as is? | |
| 145 return parseInt(this.builderLatestRevisions[builder].blink, 10) < revi sion; | |
| 146 }.bind(this)); | |
| 147 }, | |
| 148 | |
| 149 _getBuilding: function(revisions) { | |
| 150 var building = {}; | |
| 151 var builders = []; | |
| 152 revisions.unique().forEach(function(revision) { | |
| 153 builders.push.apply(builders, this._buildersInFlightForRevision(revisi on + 1)); | |
| 154 }.bind(this)); | |
| 155 | |
| 156 builders.unique().forEach(function(builder) { | |
| 157 if (!config.builders[builder]) | |
| 158 return; | |
| 159 building[builder] = {'debug': config.builders[builder].debug}; | |
| 160 }); | |
| 161 | |
| 162 return building; | |
| 163 }, | 104 }, |
| 164 }); | 105 }); |
| 165 </script> | 106 </script> |
| 166 </polymer-element> | 107 </polymer-element> |
| OLD | NEW |