Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(154)

Unified Diff: milo/appengine/buildbucket/builder.go

Issue 2944633003: [milo] Add BuildSummary and common models. (Closed)
Patch Set: add comments Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « milo/appengine/buildbucket/buckets.go ('k') | milo/appengine/buildbucket/common.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: milo/appengine/buildbucket/builder.go
diff --git a/milo/appengine/buildbucket/builder.go b/milo/appengine/buildbucket/builder.go
index 30a3b9b510084541609e57c616e6095675439e75..99b8ab441628d68212572bdbc539da2f2c905d7b 100644
--- a/milo/appengine/buildbucket/builder.go
+++ b/milo/appengine/buildbucket/builder.go
@@ -28,6 +28,7 @@ import (
"github.com/luci/luci-go/milo/api/resp"
"github.com/luci/luci-go/milo/appengine/common"
+ "github.com/luci/luci-go/milo/appengine/common/model"
)
// search executes the search request with retries and exponential back-off.
@@ -118,7 +119,7 @@ func toMiloBuild(c context.Context, build *buildbucket.ApiCommonBuildMessage) *r
if err != nil {
// almost never happens
logging.WithError(err).Errorf(c, "could not convert status of build %d", build.Id)
- result.Status = resp.InfraFailure
+ result.Status = model.InfraFailure
result.Text = append(result.Text, fmt.Sprintf("invalid build: %s", err))
}
@@ -159,10 +160,7 @@ func toMiloBuild(c context.Context, build *buildbucket.ApiCommonBuildMessage) *r
u = parsed.String()
}
- result.Link = &resp.Link{
- URL: u,
- Label: strconv.FormatInt(build.Id, 10),
- }
+ result.Link = resp.NewLink(strconv.FormatInt(build.Id, 10), u)
// compute the best link label
if taskID := tags["swarming_task_id"]; taskID != "" {
@@ -204,13 +202,13 @@ func getDebugBuilds(c context.Context, bucket, builder string, maxCompletedBuild
for _, bb := range res.Builds {
mb := toMiloBuild(c, bb)
switch mb.Status {
- case resp.NotRun:
+ case model.NotRun:
target.PendingBuilds = append(target.PendingBuilds, mb)
- case resp.Running:
+ case model.Running:
target.CurrentBuilds = append(target.CurrentBuilds, mb)
- case resp.Success, resp.Failure, resp.InfraFailure, resp.Warning:
+ case model.Success, model.Failure, model.InfraFailure, model.Warning:
if len(target.FinishedBuilds) < maxCompletedBuilds {
target.FinishedBuilds = append(target.FinishedBuilds, mb)
}
« no previous file with comments | « milo/appengine/buildbucket/buckets.go ('k') | milo/appengine/buildbucket/common.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698