| OLD | NEW | 
|---|
| (Empty) |  | 
|  | 1 // Copyright 2017 The LUCI Authors. All rights reserved. | 
|  | 2 // Use of this source code is governed under the Apache License, Version 2.0 | 
|  | 3 // that can be found in the LICENSE file. | 
|  | 4 | 
|  | 5 package model | 
|  | 6 | 
|  | 7 import ( | 
|  | 8         "time" | 
|  | 9 | 
|  | 10         "github.com/luci/gae/service/datastore" | 
|  | 11 ) | 
|  | 12 | 
|  | 13 // BuildSummary is a datastore model which is used for displaying | 
|  | 14 // backend-agnostic views (i.e. builders, console). It contains only data that: | 
|  | 15 //   * is necessary to render these simplified views | 
|  | 16 //   * is present in all implementations (buildbot, buildbucket) | 
|  | 17 // | 
|  | 18 // This entity will live as a child of the various implementation's | 
|  | 19 // representations of a build (e.g. buildbotBuild). It has various 'tag' fields | 
|  | 20 // so that it can be queried by the various backend-agnostic views. | 
|  | 21 type BuildSummary struct { | 
|  | 22         // _id for a BuildSummary is always 1 | 
|  | 23         _ int64 `gae:"$id,1"` | 
|  | 24 | 
|  | 25         // BuildKey will always point to the "real" build, i.e. a buildbotBuild 
    or | 
|  | 26         // a buildbucketBuild. It is always the parent key for the BuildSummary. | 
|  | 27         BuildKey *datastore.Key `gae:"$parent"` | 
|  | 28 | 
|  | 29         // Global identifier for the builder that this Build belongs to, i.e.: | 
|  | 30         //   "buildbot/<mastername>/<buildername>" | 
|  | 31         //   "buildbucket/<bucketname>/<buildername>" | 
|  | 32         BuilderID string | 
|  | 33 | 
|  | 34         // KnownConsoleHash is used for backfilling and must always equal | 
|  | 35         //   sha256(sorted(ConsoleEpochs.keys()) | 
|  | 36         KnownConsoleHash []byte | 
|  | 37 | 
|  | 38         // ConsoleEpochs is used for backfilling, and is a series of cmpbin tupl
    es: | 
|  | 39         //   (console_name[str], recorded_epoch[int]) | 
|  | 40         ConsoleEpochs [][]byte | 
|  | 41 | 
|  | 42         // ConsoleTags contains query tags for the console view. These are cmpbi
    n | 
|  | 43         // tuples which look like: | 
|  | 44         //   (console_name[str], sort_criteria[tuple], sort_values[tuple]) | 
|  | 45         ConsoleTags [][]byte | 
|  | 46 | 
|  | 47         // Created is the time when the Build was first created. Due to pending | 
|  | 48         // queues, this may be substantially before Summary.Start. | 
|  | 49         Created time.Time | 
|  | 50 | 
|  | 51         // Summary summarizes relevant bits about the overall build. | 
|  | 52         Summary Summary | 
|  | 53 | 
|  | 54         // CurrentStep summarizes relevant bits about the currently running step
     (if | 
|  | 55         // any). Only expected to be set if !Summary.Status.Terminal(). | 
|  | 56         CurrentStep Summary | 
|  | 57 | 
|  | 58         // Manifests is a list of links to source manifests that this build repo
    rted. | 
|  | 59         Manifests []ManifestLink | 
|  | 60 | 
|  | 61         // Patches is the list of patches which are associated with this build. | 
|  | 62         // We reserve the multi-patch case for advanced (multi-repo) tryjobs... | 
|  | 63         // Typically there will only be one patch associated with a build. | 
|  | 64         Patches []PatchInfo | 
|  | 65 } | 
| OLD | NEW | 
|---|