RFR: Assign unassigned issues when resolving them
Erik Helin
ehelin at openjdk.java.net
Thu Jan 16 09:17:00 UTC 2020
On Thu, 16 Jan 2020 08:55:24 GMT, Robin Westberg <rwestberg at openjdk.org> wrote:
> Hi all,
>
> Please review this change that sets the assignee of unassigned issues when resolving them.
>
> Best regards,
> Robin
bots/notify/src/main/java/org/openjdk/skara/bots/notify/IssueUpdater.java line 233:
> 232: }
> 233: }
> 234:
Instead of repeating `Optional.of(issueProject.issueTracker().user(...))`, you might want to code this like:
String username = null;
var authorEmail = EmailAddress.from(commit.author().email());
if (authorEmail.domain().equals("openjdk.org")) {
username = authorEmail.localPart();
} else {
var committerEmail = EmailAddress.from(commit.committer().email());
if (!committerEmail.domain().equals("openjdk.org")) {
log.severe("Cannot determine issue tracker user name from committer email: " + committerEmail);
}
username = committerEmail.localPart();
}
return username == null ? Optional.empty() : Optional.of(issueProject.issueTracker().user(username));
-------------
PR: https://git.openjdk.java.net/skara/pull/357
More information about the skara-dev
mailing list