Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1843: mlbridge bot bridges emails generated by itself #1485

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -114,7 +114,7 @@ synchronized void inspect(Conversation conversation) {
pr = foundPr.get();
resolvedPullRequests.put(first.id(), pr);
}
var bridgeIdPattern = Pattern.compile("^[^.]+\\.[^.]+@" + pr.repository().url().getHost() + "$");
var bridgeIdPattern = Pattern.compile("^[^.]+\\.[^.]+@" + pr.repository().authenticatedUrl().getHost() + "$");

// Filter out already bridged comments
var bridgeCandidates = newMessages.stream()
Expand Down
Expand Up @@ -296,7 +296,7 @@ private EmailAddress getUniqueMessageId(String identifier) {
digest.update(identifier.getBytes(StandardCharsets.UTF_8));
var encodedCommon = Base64.getUrlEncoder().encodeToString(digest.digest());

return EmailAddress.from(encodedCommon + "." + UUID.randomUUID() + "@" + pr.repository().url().getHost());
return EmailAddress.from(encodedCommon + "." + UUID.randomUUID() + "@" + pr.repository().authenticatedUrl().getHost());
} catch (NoSuchAlgorithmException e) {
throw new RuntimeException("Cannot find SHA-256");
}
Expand Down