| Index: milo/appengine/common/model/build_summary.go
|
| diff --git a/milo/appengine/common/model/build_summary.go b/milo/appengine/common/model/build_summary.go
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..c394155a7efe638c992f08dfbf1517e7b2301106
|
| --- /dev/null
|
| +++ b/milo/appengine/common/model/build_summary.go
|
| @@ -0,0 +1,65 @@
|
| +// Copyright 2017 The LUCI Authors. All rights reserved.
|
| +// Use of this source code is governed under the Apache License, Version 2.0
|
| +// that can be found in the LICENSE file.
|
| +
|
| +package model
|
| +
|
| +import (
|
| + "time"
|
| +
|
| + "github.com/luci/gae/service/datastore"
|
| +)
|
| +
|
| +// BuildSummary is a datastore model which is used for displaying
|
| +// backend-agnostic views (i.e. builders, console). It contains only data that:
|
| +// * is necessary to render these simplified views
|
| +// * is present in all implementations (buildbot, buildbucket)
|
| +//
|
| +// This entity will live as a child of the various implementation's
|
| +// representations of a build (e.g. buildbotBuild). It has various 'tag' fields
|
| +// so that it can be queried by the various backend-agnostic views.
|
| +type BuildSummary struct {
|
| + // _id for a BuildSummary is always 1
|
| + _ int64 `gae:"$id,1"`
|
| +
|
| + // BuildKey will always point to the "real" build, i.e. a buildbotBuild or
|
| + // a buildbucketBuild. It is always the parent key for the BuildSummary.
|
| + BuildKey *datastore.Key `gae:"$parent"`
|
| +
|
| + // Global identifier for the builder that this Build belongs to, i.e.:
|
| + // "buildbot/<mastername>/<buildername>"
|
| + // "buildbucket/<bucketname>/<buildername>"
|
| + BuilderID string
|
| +
|
| + // KnownConsoleHash is used for backfilling and must always equal
|
| + // sha256(sorted(ConsoleEpochs.keys())
|
| + KnownConsoleHash []byte
|
| +
|
| + // ConsoleEpochs is used for backfilling, and is a series of cmpbin tuples:
|
| + // (console_name[str], recorded_epoch[int])
|
| + ConsoleEpochs [][]byte
|
| +
|
| + // ConsoleTags contains query tags for the console view. These are cmpbin
|
| + // tuples which look like:
|
| + // (console_name[str], sort_criteria[tuple], sort_values[tuple])
|
| + ConsoleTags [][]byte
|
| +
|
| + // Created is the time when the Build was first created. Due to pending
|
| + // queues, this may be substantially before Summary.Start.
|
| + Created time.Time
|
| +
|
| + // Summary summarizes relevant bits about the overall build.
|
| + Summary Summary
|
| +
|
| + // CurrentStep summarizes relevant bits about the currently running step (if
|
| + // any). Only expected to be set if !Summary.Status.Terminal().
|
| + CurrentStep Summary
|
| +
|
| + // Manifests is a list of links to source manifests that this build reported.
|
| + Manifests []ManifestLink
|
| +
|
| + // Patches is the list of patches which are associated with this build.
|
| + // We reserve the multi-patch case for advanced (multi-repo) tryjobs...
|
| + // Typically there will only be one patch associated with a build.
|
| + Patches []PatchInfo
|
| +}
|
|
|