code: func (m TaskManager) handleBuildResult(c context.Context, ctl task.Controller, r *bbv1.ApiCommonBuildMessage) {
  	ctl.DebugLog(
  		"Build %d: status %q, result %q, failure_reason %q, cancelation_reason %q",
  		r.Id, r.Status, r.Result, r.FailureReason, r.CancelationReason)
  	switch {
  	case r.Status == "SCHEDULED" || r.Status == "STARTED":
  		return // do nothing
  	case r.Status == "COMPLETED" && r.Result == "SUCCESS":
  		ctl.State().Status = task.StatusSucceeded
  	default:
  		ctl.State().Status = task.StatusFailed
  	}
  }
docs: // handleBuildResult processes buildbucket results message updating the state
  // of the invocation.