in commit-status-publisher-server/src/main/java/jetbrains/buildServer/commitPublisher/CommitStatusPublisherListener.java [1101:1129]
protected RetryInfo runTask(@NotNull Event event,
@NotNull BuildPromotion promotion,
@NotNull String buildDescription,
@NotNull T publishTask,
@NotNull CommitStatusPublisher publisher,
@NotNull BuildRevision revision,
@Nullable AdditionalTaskInfo additionalTaskInfo,
@Nullable Long lastDelay) {
RetryInfo retryInfo = new RetryInfo();
try {
LOG.info(String.format("Publishing status to %s: build id %d, revision %s, event %s", publisher.getSettings().getName(), promotion.getId(), revision.getRevision(), event.getName()));
doRunTask(publishTask, publisher, revision, additionalTaskInfo);
myBuildTypeToFirstPublishFailure.remove(promotion.getBuildTypeId());
} catch (Throwable t) {
retryInfo = getRetryInfo(t, promotion, event, lastDelay);
String problemMessage = String.format("Commit Status Publisher has failed to publish %s status", event.getName());
if (!retryInfo.message.isEmpty()) {
problemMessage = problemMessage + ". " + retryInfo.message;
}
myProblems.reportProblem(problemMessage, publisher, buildDescription, null, t, LOG);
if (shouldFailBuild(publisher.getBuildType())) {
String problemId = "commitStatusPublisher." + publisher.getId() + "." + revision.getRoot().getId();
String problemDescription = t instanceof PublisherException ? t.getMessage() : t.toString();
BuildProblemData buildProblem = BuildProblemData.createBuildProblem(problemId, "commitStatusPublisherProblem", problemDescription);
((BuildPromotionEx)promotion).addBuildProblem(buildProblem);
}
}
return retryInfo;
}