From patchwork Tue Apr 10 14:30:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Veronika Kabatova X-Patchwork-Id: 896734 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40L8jv6YWZz9s1P for ; Wed, 11 Apr 2018 00:31:15 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 40L8jt6qn4zF2Jb for ; Wed, 11 Apr 2018 00:31:14 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=redhat.com X-Original-To: patchwork@lists.ozlabs.org Delivered-To: patchwork@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=redhat.com (client-ip=66.187.233.73; helo=mx1.redhat.com; envelope-from=vkabatov@redhat.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=redhat.com Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 40L8jn0T0YzF2JB for ; Wed, 11 Apr 2018 00:31:07 +1000 (AEST) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 927A440201A3; Tue, 10 Apr 2018 14:31:04 +0000 (UTC) Received: from vkabatova.usersys.redhat.com (unknown [10.40.205.142]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1DFE611701C5; Tue, 10 Apr 2018 14:31:03 +0000 (UTC) From: vkabatov@redhat.com To: patchwork@lists.ozlabs.org Subject: [PATCH] Fix stuff around mbox header changes Date: Tue, 10 Apr 2018 16:30:44 +0200 Message-Id: <20180410143044.12503-1-vkabatov@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Tue, 10 Apr 2018 14:31:04 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Tue, 10 Apr 2018 14:31:04 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'vkabatov@redhat.com' RCPT:'' X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Patchwork" From: Veronika Kabatova Bundle tests got broken after the subject in mbox was changed from the parsed version to the original one because the tests checked for the presence of patch's name in the response. Fixing this turned out to be a bit tricky since the tests check the mbox attachment and HTML responses separately, so we need a string that would be present in both (the intuitive idea of checking X-Patchwork-Id won't work well). Add the patch's name to the content of the test patch so we can continue testing things the same way, checking for the presence of patch's name. Also add a releasenote notifying about the inclusion of the original headers. Reverts: b2a25342 ("Use parsed subject for mboxes") Fixes: 01b9cbb9 ("Include all email headers in mboxes") Signed-off-by: Veronika Kabatova Reviewed-by: Stephen Finucane --- patchwork/tests/utils.py | 2 +- patchwork/views/utils.py | 3 --- releasenotes/notes/mbox-headers-27e1f1bde9570e9f.yaml | 6 ++++++ 3 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 releasenotes/notes/mbox-headers-27e1f1bde9570e9f.yaml diff --git a/patchwork/tests/utils.py b/patchwork/tests/utils.py index eb14a7d..00eb6c2 100644 --- a/patchwork/tests/utils.py +++ b/patchwork/tests/utils.py @@ -172,7 +172,7 @@ def create_patch(**kwargs): 'state': create_state() if 'state' not in kwargs else None, 'name': 'testpatch%d' % num, 'headers': '', - 'content': '', + 'content': 'Patch testpatch%d' % num, 'diff': SAMPLE_DIFF, } values.update(kwargs) diff --git a/patchwork/views/utils.py b/patchwork/views/utils.py index 7f89004..f5ff43c 100644 --- a/patchwork/views/utils.py +++ b/patchwork/views/utils.py @@ -101,9 +101,6 @@ def _submission_to_mbox(submission): for key, val in orig_headers.items(): mail[key] = val - # specifically overwrite the subject with our own nicely formatted name - mail['Subject'] = submission.name - if 'Date' not in mail: mail['Date'] = email.utils.formatdate(utc_timestamp) diff --git a/releasenotes/notes/mbox-headers-27e1f1bde9570e9f.yaml b/releasenotes/notes/mbox-headers-27e1f1bde9570e9f.yaml new file mode 100644 index 0000000..7564118 --- /dev/null +++ b/releasenotes/notes/mbox-headers-27e1f1bde9570e9f.yaml @@ -0,0 +1,6 @@ +--- +other: + - | + mbox files now contain all headers from the original email. This also means + the ``Subject: `` header included will contain the original subject and not + the parsed Patchwork's version.