This commit is contained in:
Marcin Grzejszczak
2020-10-05 08:54:19 +02:00
parent f24dba4201
commit 7583838a2a
2 changed files with 12 additions and 8 deletions

View File

@@ -65,24 +65,27 @@ public class SaganUpdater {
if (updateReleaseException == null) {
log.info("Updating Sagan releases with \n\n{}", update);
try {
Project project = this.saganClient.updateRelease(currentVersion.projectName,
Collections.singletonList(update));
Project project = this.saganClient.updateRelease(
currentVersion.projectName, Collections.singletonList(update));
Optional<ProjectVersion> projectVersion = latestVersion(currentVersion,
project);
log.info("Found the following latest project version [{}]", projectVersion);
log.info("Found the following latest project version [{}]",
projectVersion);
boolean present = projectVersion.isPresent();
if (present && currentVersionNewerOrEqual(currentVersion, projectVersion)) {
if (present
&& currentVersionNewerOrEqual(currentVersion, projectVersion)) {
updateDocumentationIfNecessary(projectFile, project);
}
else {
log.info(present
? "Latest version [" + projectVersion.get() + "] present and "
+ "the current version [" + currentVersion
+ "] is older than that one. " + "Will do nothing."
+ "the current version [" + currentVersion
+ "] is older than that one. " + "Will do nothing."
: "No latest version found. Will do nothing.");
return ExecutionResult.skipped();
}
} catch (Exception ex) {
}
catch (Exception ex) {
log.warn("Exception occurred while trying to update sagan release", ex);
updateReleaseException = ex;
}

View File

@@ -70,7 +70,8 @@ public class ExecutionResult implements Serializable {
}
private static Exception breakReferenceChain(Exception cause) {
if (cause instanceof HttpServerErrorException || cause instanceof HttpClientErrorException) {
if (cause instanceof HttpServerErrorException
|| cause instanceof HttpClientErrorException) {
System.out.println("Breaking the reference chain. . . i think");
return new RuntimeException(
"[Breaking self reference chain] " + cause.toString());