prow/initupload/run.go
func specToStarted(spec *downwardapi.JobSpec, mainRefSHA string) gcs.Started {
	started := gcs.Started{
		Timestamp:   time.Now().Unix(),
		RepoVersion: downwardapi.GetRevisionFromSpec(spec),
	}

	if mainRefSHA != "" {
		started.RepoVersion = mainRefSHA
	}

	// TODO(fejta): VM name

	if spec.Refs != nil && len(spec.Refs.Pulls) > 0 {
		started.Pull = strconv.Itoa(spec.Refs.Pulls[0].Number)
	}

	started.Repos = map[string]string{}

	if spec.Refs != nil {
		started.Repos[spec.Refs.Org+"/"+spec.Refs.Repo] = spec.Refs.String()
	}
	for _, ref := range spec.ExtraRefs {
		started.Repos[ref.Org+"/"+ref.Repo] = ref.String()
	}

	return started
}
func specToStarted(spec *downwardapi.JobSpec, mainRefSHA string) gcs.Started {
	started := gcs.Started{
		Timestamp:   time.Now().Unix(),
		RepoVersion: downwardapi.GetRevisionFromSpec(spec),
	}

	if mainRefSHA != "" {
		started.RepoVersion = mainRefSHA
	}

	// TODO(fejta): VM name

	if spec.Refs != nil && len(spec.Refs.Pulls) > 0 {
		started.Pull = strconv.Itoa(spec.Refs.Pulls[0].Number)
	}

	started.Repos = map[string]string{}

	if spec.Refs != nil {
		started.Repos[spec.Refs.Org+"/"+spec.Refs.Repo] = spec.Refs.String()
	}
	for _, ref := range spec.ExtraRefs {
		started.Repos[ref.Org+"/"+ref.Repo] = ref.String()
	}

	return started
}
// specToStarted translate a jobspec into a started struct
// optionally overwrite RepoVersion with provided mainRefSHA