#53 - Polishing.

Use warn log level if git cherry pick fails.
This commit is contained in:
Mark Paluch
2017-05-09 14:57:13 +02:00
parent 280e3c4728
commit b8f15cebd4
2 changed files with 19 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014-2016 the original author or authors.
* Copyright 2014-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -598,7 +598,7 @@ public class GitOperations {
if (result.getStatus().equals(CherryPickStatus.OK)) {
logger.log(project, "Successfully cherry-picked commit %s to branch %s.", id.getName(), branch);
} else {
logger.log(project, "Cherry pick failed. aborting…");
logger.warn(project, "Cherry pick failed. aborting…");
logger.log(project, "git reset --hard");
git.reset().setMode(ResetType.HARD).call();
}
@@ -674,7 +674,7 @@ public class GitOperations {
Project project = module.getProject();
Ticket releaseTicket = issueTracker
.getRequiredPluginFor(project, () -> String.format("No issue tracker found for project %!", project))//
.getRequiredPluginFor(project, () -> String.format("No issue tracker found for project %s!", project))//
.getReleaseTicketFor(module);
return String.format("%s - %s", releaseTicket.getId(), summary);

View File

@@ -53,6 +53,22 @@ public class Logger {
LOGGER.info(String.format(PREFIX_TEMPLATE, context, String.format(template.toString(), args)));
}
public void warn(ModuleIteration module, Object template, Object... args) {
log(module.getProject(), template, args);
}
public void warn(Project project, Object template, Object... args) {
log(project.getName(), template, args);
}
public void warn(TrainIteration iteration, Object template, Object... args) {
log(iteration.toString(), template, args);
}
public void warn(Train train, Object template, Object... args) {
log(train.getName(), template, args);
}
public void warn(String context, Object template, Object... args) {
LOGGER.warning(String.format(PREFIX_TEMPLATE, context, String.format(template.toString(), args)));
}