@@ -138,6 +138,8 @@ type Commit struct {
138
138
// For non-Go commits, only the Results for the current Go tip, weekly,
139
139
// and release Tags are stored here. This is purely de-normalized data.
140
140
// The complete data set is stored in Result entities.
141
+ //
142
+ // Each string is formatted as builder|OK|LogHash|GoHash.
141
143
ResultData []string `datastore:",noindex"`
142
144
}
143
145
@@ -225,49 +227,66 @@ func min(a, b int) int {
225
227
//
226
228
// For the main Go repo, goHash is the empty string.
227
229
func (c * Commit ) Result (builder , goHash string ) * Result {
228
- return result (c .ResultData , c .Hash , c .PackagePath , builder , goHash )
230
+ r := result (c .ResultData , c .Hash , c .PackagePath , builder , goHash )
231
+ if r == nil {
232
+ return nil
233
+ }
234
+ return & r .Result
229
235
}
230
236
231
237
// Result returns the build Result for this commit for the given builder/goHash.
232
238
//
233
239
// For the main Go repo, goHash is the empty string.
234
- func (c * CommitInfo ) Result (builder , goHash string ) * Result {
240
+ func (c * CommitInfo ) Result (builder , goHash string ) * DisplayResult {
235
241
if r := result (c .ResultData , c .Hash , c .PackagePath , builder , goHash ); r != nil {
236
242
return r
237
243
}
238
244
if u , ok := c .BuildingURLs [builderAndGoHash {builder , goHash }]; ok {
239
- return & Result {
245
+ return & DisplayResult { Result : Result {
240
246
Builder : builder ,
241
247
BuildingURL : u ,
242
248
Hash : c .Hash ,
243
249
GoHash : goHash ,
244
- }
250
+ }}
245
251
}
246
252
if fakeResults {
247
253
// Create a fake random result.
248
254
switch rand .Intn (3 ) {
249
255
default :
250
256
return nil
251
257
case 1 :
252
- return & Result {
258
+ return & DisplayResult { Result : Result {
253
259
Builder : builder ,
254
260
Hash : c .Hash ,
255
261
GoHash : goHash ,
256
262
OK : true ,
257
- }
263
+ }}
258
264
case 2 :
259
- return & Result {
265
+ return & DisplayResult { Result : Result {
260
266
Builder : builder ,
261
267
Hash : c .Hash ,
262
268
GoHash : goHash ,
263
269
LogHash : "fakefailureurl" ,
264
- }
270
+ }}
265
271
}
266
272
}
267
273
return nil
268
274
}
269
275
270
- func result (resultData []string , hash , packagePath , builder , goHash string ) * Result {
276
+ type DisplayResult struct {
277
+ Result
278
+ Noise bool
279
+ }
280
+
281
+ func (r * DisplayResult ) LogURL () string {
282
+ if strings .HasPrefix (r .LogHash , "https://" ) {
283
+ return r .LogHash
284
+ } else {
285
+ return "/log/" + r .LogHash
286
+ }
287
+ }
288
+
289
+ func result (resultData []string , hash , packagePath , builder , goHash string ) * DisplayResult {
271
290
for _ , r := range resultData {
272
291
if ! strings .HasPrefix (r , builder ) {
273
292
// Avoid strings.SplitN alloc in the common case.
@@ -292,6 +311,14 @@ func result(resultData []string, hash, packagePath, builder, goHash string) *Res
292
311
// As a special case, "tip" is an alias for "master", since this app
293
312
// still uses a bunch of hg terms from when we used hg.
294
313
func isUntested (builder , repo , branch , goBranch string ) bool {
314
+ if strings .HasSuffix (builder , "-🐇" ) {
315
+ // LUCI builders are never considered untested.
316
+ //
317
+ // Note: It would be possible to improve this by reporting
318
+ // whether a given LUCI builder exists for a given x/ repo.
319
+ // That needs more bookkeeping and code, so left for later.
320
+ return false
321
+ }
295
322
if branch == "tip" {
296
323
branch = "master"
297
324
}
@@ -320,8 +347,8 @@ func knownIssue(builder string) int {
320
347
return 0
321
348
}
322
349
323
- // Results returns the build Results for this Commit.
324
- func (c * CommitInfo ) Results () (results []* Result ) {
350
+ // Results returns the build results for this Commit.
351
+ func (c * CommitInfo ) Results () (results []* DisplayResult ) {
325
352
for _ , r := range c .ResultData {
326
353
p := strings .SplitN (r , "|" , 4 )
327
354
if len (p ) != 4 {
@@ -376,15 +403,18 @@ func reverse(s []string) {
376
403
}
377
404
}
378
405
379
- // partsToResult creates a Result from ResultData substrings.
380
- func partsToResult (hash , packagePath string , p []string ) * Result {
381
- return & Result {
382
- Builder : p [0 ],
383
- Hash : hash ,
384
- PackagePath : packagePath ,
385
- GoHash : p [3 ],
386
- OK : p [1 ] == "true" ,
387
- LogHash : p [2 ],
406
+ // partsToResult creates a DisplayResult from ResultData substrings.
407
+ func partsToResult (hash , packagePath string , p []string ) * DisplayResult {
408
+ return & DisplayResult {
409
+ Result : Result {
410
+ Builder : p [0 ],
411
+ Hash : hash ,
412
+ PackagePath : packagePath ,
413
+ GoHash : p [3 ],
414
+ OK : p [1 ] == "true" ,
415
+ LogHash : p [2 ],
416
+ },
417
+ Noise : p [1 ] == "infra_failure" ,
388
418
}
389
419
}
390
420
0 commit comments