code: func buildFromLogs(c context.Context, taskURL *url.URL, fr *swarmingFetchResult) (*ui.MiloBuildLegacy, error) {
  	var build ui.MiloBuildLegacy
  	var step miloProto.Step
  
  	// Decode the data using annotee. The logdog stream returned here is assumed
  	// to be consistent, which is why the following block of code are not
  	// expected to ever err out.
  	if fr.log != "" {
  		lds, err := streamsFromAnnotatedLog(c, fr.log)
  		if err != nil {
  			comp := infoComponent(model.InfraFailure, "Milo annotation parser", err.Error())
  			comp.SubLink = append(comp.SubLink, ui.LinkSet{
  				ui.NewLink("swarming task", taskURL.String(), ""),
  			})
  			build.Components = append(build.Components, comp)
  		} else if lds.MainStream != nil {
  			step = *lds.MainStream.Data
  		}
  	}
  
  	if err := addTaskToMiloStep(c, taskURL.Host, fr.res, &step); err != nil {
  		return nil, err
  	}
  
  	// Log links are built relative to swarming URLs
  	id := taskURL.Query().Get("id")
  	ub := swarmingURLBuilder(id)
  	rawpresentation.AddLogDogToBuild(c, ub, &step, &build)
  
  	addFailureSummary(&build)
  
  	err := addTaskToBuild(c, taskURL.Host, fr.res, &build)
  	return &build, err
  }
docs: // buildFromLogs returns a milo build from just the swarming log and result data.
  // TODO(hinoka): Remove this once skia moves logging to logdog/kitchen.