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

Side by Side Diff: scheduler/appengine/task/buildbucket/buildbucket.go

Issue 2929703002: [api] Regenerate remote APIs. (Closed)
Patch Set: fix 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 unified diff | Download patch
« no previous file with comments | « milo/appengine/buildbucket/common.go ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The LUCI Authors. All rights reserved. 1 // Copyright 2015 The LUCI Authors. All rights reserved.
2 // Use of this source code is governed under the Apache License, Version 2.0 2 // Use of this source code is governed under the Apache License, Version 2.0
3 // that can be found in the LICENSE file. 3 // that can be found in the LICENSE file.
4 4
5 // Package buildbucket implements tasks that run Buildbucket jobs. 5 // Package buildbucket implements tasks that run Buildbucket jobs.
6 package buildbucket 6 package buildbucket
7 7
8 import ( 8 import (
9 "encoding/json" 9 "encoding/json"
10 "fmt" 10 "fmt"
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 m.handleBuildResult(c, ctl, resp.Build) 346 m.handleBuildResult(c, ctl, resp.Build)
347 if ctl.State().Status.Final() { 347 if ctl.State().Status.Final() {
348 ctl.DebugLog("Buildbucket build:\n%s", blob) 348 ctl.DebugLog("Buildbucket build:\n%s", blob)
349 } 349 }
350 350
351 return nil 351 return nil
352 } 352 }
353 353
354 // handleBuildResult processes buildbucket results message updating the state 354 // handleBuildResult processes buildbucket results message updating the state
355 // of the invocation. 355 // of the invocation.
356 func (m TaskManager) handleBuildResult(c context.Context, ctl task.Controller, r *buildbucket.ApiBuildMessage) { 356 func (m TaskManager) handleBuildResult(c context.Context, ctl task.Controller, r *buildbucket.ApiCommonBuildMessage) {
357 ctl.DebugLog( 357 ctl.DebugLog(
358 "Build %d: status %q, result %q, failure_reason %q, cancelation_ reason %q", 358 "Build %d: status %q, result %q, failure_reason %q, cancelation_ reason %q",
359 r.Id, r.Status, r.Result, r.FailureReason, r.CancelationReason) 359 r.Id, r.Status, r.Result, r.FailureReason, r.CancelationReason)
360 switch { 360 switch {
361 case r.Status == "SCHEDULED" || r.Status == "STARTED": 361 case r.Status == "SCHEDULED" || r.Status == "STARTED":
362 return // do nothing 362 return // do nothing
363 case r.Status == "COMPLETED" && r.Result == "SUCCESS": 363 case r.Status == "COMPLETED" && r.Result == "SUCCESS":
364 ctl.State().Status = task.StatusSucceeded 364 ctl.State().Status = task.StatusSucceeded
365 default: 365 default:
366 ctl.State().Status = task.StatusFailed 366 ctl.State().Status = task.StatusFailed
367 } 367 }
368 } 368 }
OLDNEW
« no previous file with comments | « milo/appengine/buildbucket/common.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698