use of com.yahoo.vespa.hosted.controller.api.integration.github.GitSha in project vespa by vespa-engine.
the class VersionStatus method createVersion.
private static VespaVersion createVersion(DeploymentStatistics statistics, boolean isSystemVersion, Collection<String> configServerHostnames, Controller controller) {
GitSha gitSha = controller.gitHub().getCommit(VESPA_REPO_OWNER, VESPA_REPO, statistics.version().toFullString());
Instant committedAt = Instant.ofEpochMilli(gitSha.commit.author.date.getTime());
VespaVersion.Confidence confidence = controller.curator().readConfidenceOverrides().get(statistics.version());
// Compute confidence if there's no override
if (confidence == null) {
if (isSystemVersion) {
// Always compute confidence for system version
confidence = VespaVersion.confidenceFrom(statistics, controller);
} else {
// Keep existing confidence for non-system versions if already computed
confidence = confidenceFor(statistics.version(), controller).orElse(VespaVersion.confidenceFrom(statistics, controller));
}
}
return new VespaVersion(statistics, gitSha.sha, committedAt, isSystemVersion, configServerHostnames, confidence);
}