From 63d5313664c96cdfcee345f5c880f9973a3ee1da Mon Sep 17 00:00:00 2001 From: Konstantin Ryabitsev Date: Wed, 31 Aug 2022 15:09:47 -0400 Subject: Refactor how we handle trailers With the addition of b4 trailers it became pretty obvious that the way we originally implemented trailers didn't age well. This refactor does the following: - introduces LoreTrailer class to replace passing trailers as tuples - reimplements trailer-order with strict adherence to chain-of-custody rules - adds tests to most common trailer follow-up/ordering cases Signed-off-by: Konstantin Ryabitsev --- tests/samples/trailers-followup-single.mbox | 78 +++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 tests/samples/trailers-followup-single.mbox (limited to 'tests/samples/trailers-followup-single.mbox') diff --git a/tests/samples/trailers-followup-single.mbox b/tests/samples/trailers-followup-single.mbox new file mode 100644 index 0000000..b12f6ba --- /dev/null +++ b/tests/samples/trailers-followup-single.mbox @@ -0,0 +1,78 @@ +From foo@z Thu Jan 1 00:00:00 1970 +From: Test Test +Subject: [PATCH] Simple test +To: Some List +Cc: Dev Eloper1 , + Dev Eloper2 +Date: Tue, 30 Aug 2022 11:19:07 -0400 +Message-Id: + +Follow-up trailer collating test. + +Fixes: abcdef01234567890 +Reviewed-by: Original Reviewer +Link: https://msgid.link/some@msgid.here +Signed-off-by: Original Submitter +--- + +diff --git a/b4/junk.py b/b4/junk.py +index 12345678..23456789 100644 +--- a/b4/junk.py +--- b/b4/junk.py +@@@ -1,1 +1,1 @@ def junk(): + + +-junk1 ++junk2 + + +-- +2.wong.fu + +From foo@z Thu Jan 1 00:00:00 1970 +From: Followup Reviewer1 +Subject: Re: [PATCH] Simple test +Date: Tue, 30 Aug 2022 11:19:07 -0400 +Message-Id: +In-Reply-To: +References: + +> This is a simple trailer parsing test. + +Reviewed-by: Followup Reviewer1 + +-- +My sig + +From foo@z Thu Jan 1 00:00:00 1970 +From: Followup Reviewer2 +Subject: Re: [PATCH] Simple test +Date: Tue, 30 Aug 2022 11:19:07 -0400 +Message-Id: +In-Reply-To: +References: + +>> This is a simple trailer parsing test. +> +> Reviewed-by: Followup Reviewer1 + +Tested-by: Followup Reviewer2 + +-- +My sig + +From foo@z Thu Jan 1 00:00:00 1970 +From: Mismatched Reviewer +Subject: Re: [PATCH] Simple test +Date: Tue, 30 Aug 2022 11:19:07 -0400 +Message-Id: +In-Reply-To: +References: + +> This is a simple trailer parsing test. + +Reviewed-by: Mismatched Reviewer1 + +-- +My sig + -- cgit v1.2.3