src/server/pkg/ppsutil/util.go
func GetPipelineInfo(pachClient *client.APIClient, ptr *pps.EtcdPipelineInfo, full bool) (*pps.PipelineInfo, error) {
	result := &pps.PipelineInfo{}
	if full {
		buf := bytes.Buffer{}
		if err := pachClient.GetFile(ppsconsts.SpecRepo, ptr.SpecCommit.ID, ppsconsts.SpecFile, 0, 0, &buf); err != nil {
			return nil, fmt.Errorf("could not read existing PipelineInfo from PFS: %v", err)
		}
		if err := result.Unmarshal(buf.Bytes()); err != nil {
			return nil, fmt.Errorf("could not unmarshal PipelineInfo bytes from PFS: %v", err)
		}
	}
	result.State = ptr.State
	result.Reason = ptr.Reason
	result.JobCounts = ptr.JobCounts
	result.LastJobState = ptr.LastJobState
	result.SpecCommit = ptr.SpecCommit
	return result, nil
}
func GetPipelineInfo(pachClient *client.APIClient, ptr *pps.EtcdPipelineInfo, full bool) (*pps.PipelineInfo, error) {
	result := &pps.PipelineInfo{}
	if full {
		buf := bytes.Buffer{}
		if err := pachClient.GetFile(ppsconsts.SpecRepo, ptr.SpecCommit.ID, ppsconsts.SpecFile, 0, 0, &buf); err != nil {
			return nil, fmt.Errorf("could not read existing PipelineInfo from PFS: %v", err)
		}
		if err := result.Unmarshal(buf.Bytes()); err != nil {
			return nil, fmt.Errorf("could not unmarshal PipelineInfo bytes from PFS: %v", err)
		}
	}
	result.State = ptr.State
	result.Reason = ptr.Reason
	result.JobCounts = ptr.JobCounts
	result.LastJobState = ptr.LastJobState
	result.SpecCommit = ptr.SpecCommit
	return result, nil
}
// GetPipelineInfo retrieves and returns a valid PipelineInfo from PFS. It does
// the PFS read/unmarshalling of bytes as well as filling in missing fields