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

149: Improve formatting of bridged emails #236

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
@@ -197,7 +197,7 @@ void simpleArchive(TestInfo testInfo) throws IOException {
assertEquals("RFR: 1234: This is a pull request", mail.subject());
assertEquals(pr.author().fullName(), mail.author().fullName().orElseThrow());
assertEquals(noreplyAddress(archive), mail.author().address());
assertEquals(from, mail.sender());
assertEquals(listAddress, mail.sender());
assertEquals("val1", mail.headerValue("Extra1"));
assertEquals("val2", mail.headerValue("Extra2"));

@@ -250,7 +250,7 @@ void simpleArchive(TestInfo testInfo) throws IOException {
assertEquals(3, conversations.get(0).allMessages().size());
for (var newMail : conversations.get(0).allMessages()) {
assertEquals(noreplyAddress(archive), newMail.author().address());
assertEquals(from, newMail.sender());
assertEquals(listAddress, newMail.sender());
}
assertTrue(conversations.get(0).allMessages().get(2).body().contains("This is a comment 😄"));
}
@@ -340,7 +340,7 @@ void reviewComment(TestInfo testInfo) throws IOException {
assertEquals(3, conversations.get(0).allMessages().size());
for (var newMail : conversations.get(0).allMessages()) {
assertEquals(noreplyAddress(archive), newMail.author().address());
assertEquals(from, newMail.sender());
assertEquals(listAddress, newMail.sender());
}
}
}
@@ -813,7 +813,7 @@ void incrementalChanges(TestInfo testInfo) throws IOException {
assertEquals(1, conversations.size());
for (var newMail : conversations.get(0).allMessages()) {
assertEquals(noreplyAddress(archive), newMail.author().address());
assertEquals(from, newMail.sender());
assertEquals(listAddress, newMail.sender());
}

// Add a comment
@@ -933,7 +933,7 @@ void rebased(TestInfo testInfo) throws IOException {
assertEquals(1, conversations.size());
for (var newMail : conversations.get(0).allMessages()) {
assertEquals(noreplyAddress(archive), newMail.author().address());
assertEquals(sender, newMail.sender());
assertEquals(listAddress, newMail.sender());
assertFalse(newMail.hasHeader("PR-Head-Hash"));
}
assertEquals("Re: [Rev 01] RFR: This is a pull request", conversations.get(0).allMessages().get(1).subject());
@@ -200,7 +200,7 @@ void testMailingList(TestInfo testInfo) throws IOException {

var conversations = mailmanList.conversations(Duration.ofDays(1));
var email = conversations.get(0).first();
assertEquals(sender, email.sender());
assertEquals(listAddress, email.sender());
assertEquals(sender, email.author());
assertEquals(email.recipients(), List.of(listAddress));
assertTrue(email.subject().contains(": 23456789: More fixes"));
@@ -256,7 +256,7 @@ void testMailingListMultiple(TestInfo testInfo) throws IOException {

var conversations = mailmanList.conversations(Duration.ofDays(1));
var email = conversations.get(0).first();
assertEquals(sender, email.sender());
assertEquals(listAddress, email.sender());
assertEquals(EmailAddress.from("another_author", "another@author.example.com"), email.author());
assertEquals(email.recipients(), List.of(listAddress));
assertTrue(email.subject().contains(": 2 new changesets"));
@@ -306,7 +306,7 @@ void testMailingListSponsored(TestInfo testInfo) throws IOException {

var conversations = mailmanList.conversations(Duration.ofDays(1));
var email = conversations.get(0).first();
assertEquals(sender, email.sender());
assertEquals(listAddress, email.sender());
assertEquals(EmailAddress.from("committer", "committer@test.test"), email.author());
assertEquals(email.recipients(), List.of(listAddress));
assertTrue(email.body().contains("Changeset: " + editHash.abbreviate()));
@@ -357,7 +357,7 @@ void testMailingListMultipleBranches(TestInfo testInfo) throws IOException {

var conversations = mailmanList.conversations(Duration.ofDays(1));
var email = conversations.get(0).first();
assertEquals(sender, email.sender());
assertEquals(listAddress, email.sender());
assertEquals(author, email.author());
assertEquals(email.recipients(), List.of(listAddress));
assertFalse(email.subject().contains("another"));
@@ -379,7 +379,8 @@ void testMailingListMultipleBranches(TestInfo testInfo) throws IOException {
conversations = mailmanList.conversations(Duration.ofDays(1));
conversations.sort(Comparator.comparing(conversation -> conversation.first().subject()));
email = conversations.get(0).first();
assertEquals(email.sender(), sender);
assertEquals(author, email.author());
assertEquals(listAddress, email.sender());
assertEquals(email.recipients(), List.of(listAddress));
assertTrue(email.subject().contains(": another: 456789AB: Yet more fixes"));
assertFalse(email.subject().contains("master"));
@@ -450,7 +451,7 @@ void testMailingListPROnly(TestInfo testInfo) throws IOException {
assertEquals(1, conversations.size());
var first = conversations.get(0).first();
var email = conversations.get(0).replies(first).get(0);
assertEquals(sender, email.sender());
assertEquals(listAddress, email.sender());
assertEquals(author, email.author());
assertEquals(email.recipients(), List.of(listAddress));
assertEquals("Re: [Integrated] RFR: My PR", email.subject());
@@ -537,7 +538,7 @@ void testMailingListPR(TestInfo testInfo) throws IOException {
var pushConversation = conversations.get(1);

var prEmail = prConversation.replies(prConversation.first()).get(0);
assertEquals(sender, prEmail.sender());
assertEquals(listAddress, prEmail.sender());
assertEquals(EmailAddress.from("testauthor", "ta@none.none"), prEmail.author());
assertEquals(prEmail.recipients(), List.of(listAddress));
assertEquals("Re: [Integrated] RFR: My PR", prEmail.subject());
@@ -548,7 +549,7 @@ void testMailingListPR(TestInfo testInfo) throws IOException {
assertFalse(prEmail.body().contains(masterHash.abbreviate()));

var pushEmail = pushConversation.first();
assertEquals(sender, pushEmail.sender());
assertEquals(listAddress, pushEmail.sender());
assertEquals(EmailAddress.from("testauthor", "ta@none.none"), pushEmail.author());
assertEquals(pushEmail.recipients(), List.of(listAddress));
assertTrue(pushEmail.subject().contains("23456789: More fixes"));
@@ -686,7 +687,7 @@ void testMailingListBranch(TestInfo testInfo) throws IOException {

var conversations = mailmanList.conversations(Duration.ofDays(1));
var email = conversations.get(0).first();
assertEquals(sender, email.sender());
assertEquals(listAddress, email.sender());
assertEquals(EmailAddress.from("testauthor", "ta@none.none"), email.author());
assertEquals(email.recipients(), List.of(listAddress));
assertEquals("git: test: created branch newbranch1 based on the branch master containing 2 unique commits", email.subject());
@@ -707,7 +708,7 @@ void testMailingListBranch(TestInfo testInfo) throws IOException {
.filter(c -> !c.equals(conversations.get(0)))
.findFirst().orElseThrow();
email = newConversation.first();
assertEquals(sender, email.sender());
assertEquals(listAddress, email.sender());
assertEquals(sender, email.author());
assertEquals(email.recipients(), List.of(listAddress));
assertEquals("git: test: created branch newbranch2 based on the branch newbranch1 containing 0 unique commits", email.subject());