Exemplo n.º 1
0
func (arc Arcanist) mirrorStatusesForEachCommit(r review.Review, commitToDiffIDMap map[string]int) {
	for commitHash, diffID := range commitToDiffIDMap {
		ciNotes := r.Repo.GetNotes(ci.Ref, commitHash)
		ciReports := ci.ParseAllValid(ciNotes)
		latestCIReport, err := ci.GetLatestCIReport(ciReports)
		if err != nil {
			log.Println("Failed to load the continuous integration reports: " + err.Error())
		} else if latestCIReport != nil {
			arc.reportUnitResults(diffID, *latestCIReport)
		}

		analysesNotes := r.Repo.GetNotes(analyses.Ref, commitHash)
		analysesReports := analyses.ParseAllValid(analysesNotes)
		latestAnalysesReport, err := analyses.GetLatestAnalysesReport(analysesReports)
		if err != nil {
			log.Println("Failed to load the static analysis reports: " + err.Error())
		} else if latestAnalysesReport != nil {
			lintResults, err := latestAnalysesReport.GetLintReportResult()
			if err != nil {
				log.Println("Failed to load the static analysis reports: " + err.Error())
			} else {
				arc.reportLintResults(diffID, lintResults)
			}
		}
	}
}
Exemplo n.º 2
0
// GetBuildStatusMessage returns a string of the current build-and-test status
// of the review, or "unknown" if the build-and-test status cannot be determined.
func (r *Review) GetBuildStatusMessage() string {
	statusMessage := "unknown"
	ciReport, err := ci.GetLatestCIReport(r.Reports)
	if err != nil {
		return fmt.Sprintf("unknown: %s", err)
	}
	if ciReport != nil {
		statusMessage = fmt.Sprintf("%s (%q)", ciReport.Status, ciReport.URL)
	}
	return statusMessage
}