Polishing.

Refine commit message keywords, fall back to main as the changelog lower bound.

See #194
This commit is contained in:
Mark Paluch
2022-01-13 15:51:09 +01:00
parent 0487029e7a
commit db45b4247c
2 changed files with 9 additions and 2 deletions

View File

@@ -488,7 +488,14 @@ public class GitOperations {
Optional<Tag> fromTag = tags.filter(iteration.getTrain()).findTag(iteration.getIteration());
Tag tag = fromTag.get();
if (!fromTag.isPresent()) {
// fall back to main
return repo.parseCommit(repo.resolve(Branch.MAIN.toString()));
}
Tag tag = fromTag.orElseThrow(() -> new IllegalStateException(
String.format("Cannot determine from tag for %s %s", project.getName(), iteration)));
return repo.parseCommit(repo.resolve(tag.getName()));
}

View File

@@ -45,7 +45,7 @@ class ParsedCommitMessage {
private static final Pattern GITHUB_TICKET = Pattern.compile("((?>#|gh-)\\d+)");
private static final Pattern GITHUB_CLOSE_SYNTAX = Pattern.compile(
"(?>closes|closed|close|fixes|fixed|fix|resolves|resolved|resolve|see)[\\s:]*((?>#|gh-)\\d+)",
"(?>closes|closed|close|fixes|fixed|fix|resolves|resolved|resolve|see|related to)[\\s:]*((?>#|gh-)\\d+)",
Pattern.CASE_INSENSITIVE | Pattern.MULTILINE);
private static final Pattern GITHUB_PREFIX_SYNTAX = Pattern.compile("^(#\\d+)");