Added more logging to the release needed task.
It will make it easier to debug issues such as:
@@ -102,13 +102,19 @@ public class ReleaseNeededTask extends DefaultTask {
@TaskAction public void releaseNeeded() {
boolean skipEnvVariable = System.getenv(SKIP_RELEASE_ENV) != null;
- boolean skippedByCommitMessage = commitMessage != null && commitMessage.contains(SKIP_RELEASE_KEYWORD);
+ LOG.lifecycle(" Environment variable {} present: {}", SKIP_RELEASE_ENV, skipEnvVariable);
+
+ boolean commitMessageEmpty = commitMessage == null || commitMessage.trim().isEmpty();
+ boolean skippedByCommitMessage = !commitMessageEmpty && commitMessage.contains(SKIP_RELEASE_KEYWORD);
+ LOG.lifecycle(" Commit message to inspect for keyword '{}': {}",
+ SKIP_RELEASE_KEYWORD,
+ commitMessageEmpty? "<unknown commit message>" : "\n" + commitMessage);
+
boolean releasableBranch = branch != null && branch.matches(releasableBranchRegex);
+ LOG.lifecycle(" Current branch '{}' matches '{}': {}", branch, releasableBranchRegex, releasableBranch);
+
boolean notNeeded = skipEnvVariable || skippedByCommitMessage || pullRequest || !releasableBranch;
- //TODO add more color to the message
- //add env variable names, what is the current branch, what is the regexp, etc.
- //This way it is easier to understand how stuff works by reading the log
String message = " Release is needed: " + !notNeeded +
"\n - skip by env variable: " + skipEnvVariable +
"\n - skip by commit message: " + skippedByCommitMessage +
