Add list of branches to log-message for failed to find SCS warning
This to make it easier to see for which branches we have searched
with.
Change-Id: Ice79566d357849e53aa9c2e498b64daf0f705684
diff --git a/src/main/java/com/googlesource/gerrit/plugins/eventseiffel/parsing/EiffelEventParserImpl.java b/src/main/java/com/googlesource/gerrit/plugins/eventseiffel/parsing/EiffelEventParserImpl.java
index b2320b5..64a370b 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/eventseiffel/parsing/EiffelEventParserImpl.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/eventseiffel/parsing/EiffelEventParserImpl.java
@@ -301,17 +301,17 @@
throw new EventParsingException(
e, "Unable to get branches for: %s:%s", projectName, tagName);
}
+ List<String> branches =
+ refs.stream()
+ .map(Ref::getName)
+ .filter(branch -> !branch.equals(RefNames.REFS_HEADS + "master"))
+ .collect(Collectors.toList());
try {
- List<String> branches =
- refs.stream()
- .map(Ref::getName)
- .filter(branch -> !branch.equals(RefNames.REFS_HEADS + "master"))
- .collect(Collectors.toList());
scsId = retryer.call(() -> findSourceChangeEventKey(projectName, commitId, branches));
} catch (RetryException | ExecutionException e) {
logger.atWarning().withCause(e).log(
- "Failed to find SCS for %s in %s when trying to create CD for tag %s",
- commitId, projectName, tagName);
+ "Failed to find SCS for %s in %s for one of the branches (%s) when trying to create CD for tag %s",
+ commitId, projectName, String.join(", ", branches), tagName);
}
}