From nobody Sat Apr 20 01:14:18 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=patchew-devel-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579187361; cv=none; d=zohomail.com; s=zohoarc; b=BU6Ssj1Aq4MRBrZzTC2Gg1M0LQUnq5BYZfo8HBGjnbNd3gYQ7L5ika6uPEriL1+3SC7m69upwfBgRDTUEQpcW41eOPN1qxZGBNNr4x+ef/HAmnPLdQTSDMlpNQpuwLdZQytg2SOvP2osJ2Mg32rbXx56b9jMWIdsSAMTM84qgKU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579187361; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=t7NNDrKyw/07xSs5cWI2+Ns9ye954YNLGNcZhs6Xj4M=; b=Kxgxyy8bBS4MdqgyoxCdFdSN9OLDqPbU2pSjIg3x5mcIyg/nTuiI4B/32lSykYWOZQd+42f7lACTNa/my148R9qecR9KM0Jh4yvUq01NQEPUfXXsWLAnQy+1KrbIoQphXIG8RI8pwiWk4L/2lNMgYKW6FTEDGYLuNeDm1kIdFOI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 15791873617451005.8296053926538; Thu, 16 Jan 2020 07:09:21 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-404-HbYpr9X6PyquRPNN3PTzww-1; Thu, 16 Jan 2020 10:09:17 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5C706800EBF; Thu, 16 Jan 2020 15:09:16 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5483381200; Thu, 16 Jan 2020 15:09:16 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 48EFA18034EA; Thu, 16 Jan 2020 15:09:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00GF9EZc024576 for ; Thu, 16 Jan 2020 10:09:14 -0500 Received: by smtp.corp.redhat.com (Postfix) id B6909842BA; Thu, 16 Jan 2020 15:09:14 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-112-61.ams2.redhat.com [10.36.112.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1D07E80890 for ; Thu, 16 Jan 2020 15:09:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579187360; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=t7NNDrKyw/07xSs5cWI2+Ns9ye954YNLGNcZhs6Xj4M=; b=WWDU6uK/tczUwvrZn94SlgpvzXzaht+RtwMHtX8i4hgTZgaR5Y+L8X3U170qpMFMP7D7O8 UzjemWeK8rmdPkejk9yFwcwHWbjZLYbePOqony1Fsxn8xh4rYXamW6onZUIysWPWWSLjJ/ WLMpqZin8veNTa/H/Y+5QCuseQVpsT4= From: Paolo Bonzini To: patchew-devel@redhat.com Date: Thu, 16 Jan 2020 16:09:01 +0100 Message-Id: <20200116150909.21388-2-pbonzini@redhat.com> In-Reply-To: <20200116150909.21388-1-pbonzini@redhat.com> References: <20200116150909.21388-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: patchew-devel@redhat.com Subject: [Patchew-devel] [PATCH 1/9] apply black to mods/tags.py X-BeenThere: patchew-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Patchew development and discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: patchew-devel-bounces@redhat.com Errors-To: patchew-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: HbYpr9X6PyquRPNN3PTzww-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Paolo Bonzini Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- mods/tags.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mods/tags.py b/mods/tags.py index 59a367e..55cc9a6 100644 --- a/mods/tags.py +++ b/mods/tags.py @@ -52,7 +52,10 @@ series cover letter, patch mail body and their replies. def __init__(self): register_handler("MessageAdded", self.on_message_added) declare_event("TagsUpdate", series=3D"message object that is updat= ed") - declare_event("SeriesReviewed", series=3D"message object that got = Reviewed-by tags for all patches") + declare_event( + "SeriesReviewed", + series=3D"message object that got Reviewed-by tags for all pat= ches", + ) =20 # XXX: get this list through module config? =20 --=20 2.21.0 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel From nobody Sat Apr 20 01:14:18 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=patchew-devel-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579187361; cv=none; d=zohomail.com; s=zohoarc; b=mmxbVfNpa/xFfk248EOvRFYokOqld1AzEyRSa2mmccNBcINndGFbn5VrIrDrypm/EN9bZOAq9ycaN6zcjR0/3ztksv5VctTMa/2fzulLWLF8D0LI9I5Yk3Y6rvj1YEeP0RCER+WssSpRipkD4AgUtxe3PXXcai9ayo3M4hrwIIE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579187361; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Yx1RXU+Fcq+ak/CPjdnsi1huHbYn6l6YUsGt3WH0mtQ=; b=f/biZhQTE0xJ9/dOkQ1Uj10+aNmpm35vcyxYb8b/xJ2JGckrzfbMZWZ/8/SF1sFa365NLcLoD+GGjW0DgTIX4QCicfg4IFjdYbktFFVghemIFw/4xUD/Aca8WH5tpdObzgvujXzu/4O3JJ+1O+7ahga2Fo1OI2miCTlyjfV+R7A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 157918736130013.117039701737326; Thu, 16 Jan 2020 07:09:21 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-430-DOqq6ylPOh-796iIbVoKfA-1; Thu, 16 Jan 2020 10:09:18 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A1CE4477; Thu, 16 Jan 2020 15:09:17 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 961AE19C5B; Thu, 16 Jan 2020 15:09:17 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 8C3CF18034EA; Thu, 16 Jan 2020 15:09:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00GF9FWm024588 for ; Thu, 16 Jan 2020 10:09:15 -0500 Received: by smtp.corp.redhat.com (Postfix) id D5C75842BA; Thu, 16 Jan 2020 15:09:15 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-112-61.ams2.redhat.com [10.36.112.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id 32F2780890 for ; Thu, 16 Jan 2020 15:09:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579187359; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Yx1RXU+Fcq+ak/CPjdnsi1huHbYn6l6YUsGt3WH0mtQ=; b=dNh2I/DvXzcHuqvi29gPnmcLS2xNHM7eRRju7R6bPk3B7RlUhJp6G/cEPzIpMcUaHsic2Y yPuYGj3yV+opSAXttdkCOGUfC/uEM8xWJPDxdg4ITeD7o6RFzK8xSVamrwVE+jS6AxlQJd tGmqSs9BaW9P5mwx+z4201B4MtnKN40= From: Paolo Bonzini To: patchew-devel@redhat.com Date: Thu, 16 Jan 2020 16:09:02 +0100 Message-Id: <20200116150909.21388-3-pbonzini@redhat.com> In-Reply-To: <20200116150909.21388-1-pbonzini@redhat.com> References: <20200116150909.21388-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: patchew-devel@redhat.com Subject: [Patchew-devel] [PATCH 2/9] test_message: just use a single from X-BeenThere: patchew-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Patchew development and discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: patchew-devel-bounces@redhat.com Errors-To: patchew-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MC-Unique: DOqq6ylPOh-796iIbVoKfA-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Paolo Bonzini Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- tests/test_message.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/tests/test_message.py b/tests/test_message.py index 69dcde8..bc0a98d 100755 --- a/tests/test_message.py +++ b/tests/test_message.py @@ -8,27 +8,26 @@ # This work is licensed under the MIT License. Please see the LICENSE fil= e or # http://opensource.org/licenses/MIT. =20 +import json import time import datetime =20 from .patchewtest import PatchewTestCase, main =20 +from api.models import Message =20 -class ProjectTest(PatchewTestCase): + +class MessageTest(PatchewTestCase): def setUp(self): self.create_superuser() =20 def test_0_second(self): - from api.models import Message - message =3D Message() message.date =3D datetime.datetime.utcnow() age =3D message.get_age() self.assertEqual(age, "0 second") =20 def test_now(self): - from api.models import Message - message =3D Message() dt =3D datetime.datetime.fromtimestamp(time.time() + 100) message.date =3D dt @@ -36,8 +35,6 @@ class ProjectTest(PatchewTestCase): self.assertEqual(age, "now") =20 def test_1_day(self): - from api.models import Message - message =3D Message() dt =3D datetime.datetime.fromtimestamp(time.time() - 3600 * 25) message.date =3D dt @@ -45,8 +42,6 @@ class ProjectTest(PatchewTestCase): self.assertEqual(age, "1 day") =20 def test_asctime(self): - from api.models import Message - message =3D Message() dt =3D datetime.datetime(2016, 10, 22, 10, 16, 40) message.date =3D dt --=20 2.21.0 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel From nobody Sat Apr 20 01:14:18 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=patchew-devel-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579187362; cv=none; d=zohomail.com; s=zohoarc; b=I9VkuvtvyfnKUiFzhaWJMvDdUMBHRY3fStrvB6i3As8FnldTX3mkJmfpAWPxW8jngpTRcwjlGCTNZ/HQGztsSQeIVvwgdbq8KHYb4YOwmXmMmxyhydOPYYQGqmUL53RFYn7Ng2UfMle9XHhwNYuF2QVvqmpK/VV+RlFcpD6l4RM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579187362; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ONX87NW5GsjNnn3eIv4U3wFn4ZNp2hSfszTEHEXewig=; b=Xmi/bb2Fadv4jrWtY3GJ4VPVJQ00HzQmb5HxzEGFTZZxbTunhYdd7o1iaty48FRPTmldsl7zhF8iNgEaXR+PSQJy+Lltg0jvLbSjLilxNCapLOaCfhLshbjIJegDu33Hv0O3ex4Eg+TpyeqyzitJDICLM5XbrKN0PLdygl5WBr0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 15791873622191013.8167316887954; Thu, 16 Jan 2020 07:09:22 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-407-Rp2yOsulNMuqtQL98vnujw-1; Thu, 16 Jan 2020 10:09:20 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E50111800D48; Thu, 16 Jan 2020 15:09:18 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D95208889D; Thu, 16 Jan 2020 15:09:18 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id CC29C18034EA; Thu, 16 Jan 2020 15:09:18 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00GF9Go0024600 for ; Thu, 16 Jan 2020 10:09:16 -0500 Received: by smtp.corp.redhat.com (Postfix) id ECB2A842BA; Thu, 16 Jan 2020 15:09:16 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-112-61.ams2.redhat.com [10.36.112.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5448A80890 for ; Thu, 16 Jan 2020 15:09:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579187361; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=ONX87NW5GsjNnn3eIv4U3wFn4ZNp2hSfszTEHEXewig=; b=HWGqkgEqqqpiL6Q6W+HXVkJd6xXCT4jOr9n36Ti21+HGer0BGt7b/Jq50509Vu3WxxaxPi NpY7U0EnoJ5NaNErAWg05QVCjZVz3s4AFPovvkJIthhO6oqMXMWjh3ZBLBs7gDc1nfE9xd g2ji/rwMZjKl9oD9BzBKmYf+DRk0Hb8= From: Paolo Bonzini To: patchew-devel@redhat.com Date: Thu, 16 Jan 2020 16:09:03 +0100 Message-Id: <20200116150909.21388-4-pbonzini@redhat.com> In-Reply-To: <20200116150909.21388-1-pbonzini@redhat.com> References: <20200116150909.21388-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: patchew-devel@redhat.com Subject: [Patchew-devel] [PATCH 3/9] add topic model X-BeenThere: patchew-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Patchew development and discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: patchew-devel-bounces@redhat.com Errors-To: patchew-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MC-Unique: Rp2yOsulNMuqtQL98vnujw-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This will be used to allow grouping together even series whose subject has changed. It will also replace the is_series_head field. To migrate the database, create a new topic for every stripped_subject. Signed-off-by: Paolo Bonzini --- api/migrations/0053_auto_20200116_0955.py | 27 +++++++++++++ api/migrations/0054_populate_topic.py | 29 ++++++++++++++ api/models.py | 46 ++++++++++++++++++++--- tests/test_message.py | 30 +++++++++++++++ 4 files changed, 126 insertions(+), 6 deletions(-) create mode 100644 api/migrations/0053_auto_20200116_0955.py create mode 100644 api/migrations/0054_populate_topic.py diff --git a/api/migrations/0053_auto_20200116_0955.py b/api/migrations/005= 3_auto_20200116_0955.py new file mode 100644 index 0000000..3fae555 --- /dev/null +++ b/api/migrations/0053_auto_20200116_0955.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.20 on 2020-01-16 09:55 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies =3D [ + ('api', '0052_auto_20190418_1357'), + ] + + operations =3D [ + migrations.CreateModel( + name=3D'Topic', + fields=3D[ + ('id', models.AutoField(auto_created=3DTrue, primary_key= =3DTrue, serialize=3DFalse, verbose_name=3D'ID')), + ], + ), + migrations.AddField( + model_name=3D'message', + name=3D'topic', + field=3Dmodels.ForeignKey(null=3DTrue, on_delete=3Ddjango.db.m= odels.deletion.CASCADE, to=3D'api.Topic'), + ), + ] diff --git a/api/migrations/0054_populate_topic.py b/api/migrations/0054_po= pulate_topic.py new file mode 100644 index 0000000..359f00e --- /dev/null +++ b/api/migrations/0054_populate_topic.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.conf import settings +from django.db import migrations + + +def topic_fill(apps, schema_editor): + Message =3D apps.get_model("api", "Message") + Topic =3D apps.get_model("api", "Topic") + for record in ( + Message.objects.filter(is_series_head=3DTrue) + .values("stripped_subject") + .distinct() + ): + topic =3D Topic() + topic.save() + topic_subject =3D record["stripped_subject"] + Message.objects.filter( + is_series_head=3DTrue, stripped_subject=3Dtopic_subject + ).update(topic=3Dtopic) + + +class Migration(migrations.Migration): + dependencies =3D [("api", "0053_auto_20200116_0955")] + + operations =3D [ + migrations.RunPython(topic_fill, reverse_code=3Dmigrations.RunPyth= on.noop) + ] diff --git a/api/models.py b/api/models.py index 81bc167..6f4ea4b 100644 --- a/api/models.py +++ b/api/models.py @@ -457,7 +457,11 @@ class MessageManager(models.Manager): msg.stripped_subject =3D m.get_subject(strip_tags=3DTrue) msg.version =3D m.get_version() msg.prefixes =3D m.get_prefixes() - msg.is_series_head =3D m.is_series_head() + msg.is_series_head =3D False + if m.is_series_head(): + msg.is_series_head =3D True + msg.topic =3D Topic.objects.for_stripped_subject(msg.stripped_= subject) + msg.is_patch =3D m.is_patch() msg.patch_num =3D m.get_num()[0] msg.project =3D project @@ -477,18 +481,25 @@ class MessageManager(models.Manager): projects =3D [Project.object.get(name=3Dproject_name)] else: projects =3D find_message_projects(m) + stripped_subject =3D m.get_subject(strip_tags=3DTrue) + is_series_head =3D m.is_series_head() for p in projects: msg =3D Message( message_id=3Dmsgid, in_reply_to=3Dm.get_in_reply_to() or "", date=3Dm.get_date(), subject=3Dm.get_subject(), - stripped_subject=3Dm.get_subject(strip_tags=3DTrue), + stripped_subject=3Dstripped_subject, version=3Dm.get_version(), sender=3Dm.get_from(), recipients=3Dm.get_to() + m.get_cc(), prefixes=3Dm.get_prefixes(), - is_series_head=3Dm.is_series_head(), + is_series_head=3Dis_series_head, + topic=3D( + Topic.objects.for_stripped_subject(stripped_subject) + if is_series_head + else None + ), is_patch=3Dm.is_patch(), patch_num=3Dm.get_num()[0], ) @@ -520,6 +531,26 @@ class QueuedSeries(models.Model): index_together =3D [("user", "message")] =20 =20 +class TopicManager(models.Manager): + def for_stripped_subject(self, stripped_subject): + q =3D ( + Message.objects.filter(stripped_subject=3Dstripped_subject) + .order_by("date") + .reverse()[:1] + .values("topic") + ) + if q: + topic =3D self.get(pk=3Dq[0]["topic"]) + else: + topic =3D Topic() + topic.save() + return topic + + +class Topic(models.Model): + objects =3D TopicManager() + + class Message(models.Model): """ Patch email message """ =20 @@ -555,6 +586,11 @@ class Message(models.Model): is_tested =3D models.BooleanField(default=3DFalse) is_reviewed =3D models.BooleanField(default=3DFalse) =20 + # is series head if not Null + topic =3D models.ForeignKey( + "Topic", on_delete=3Dmodels.CASCADE, null=3DTrue, db_index=3DTrue + ) + # patch index number if is_patch patch_num =3D models.PositiveSmallIntegerField(null=3DTrue, blank=3DTr= ue) =20 @@ -854,9 +890,7 @@ class Message(models.Model): =20 def get_alternative_revisions(self): assert self.is_series_head - return Message.objects.series_heads().filter( - project=3Dself.project, stripped_subject=3Dself.stripped_subje= ct - ) + return Message.objects.filter(project=3Dself.project, topic=3Dself= .topic) =20 def set_complete(self): if self.is_complete: diff --git a/tests/test_message.py b/tests/test_message.py index bc0a98d..3999948 100755 --- a/tests/test_message.py +++ b/tests/test_message.py @@ -20,6 +20,7 @@ from api.models import Message class MessageTest(PatchewTestCase): def setUp(self): self.create_superuser() + self.p =3D self.add_project("QEMU", "qemu-devel@nongnu.org") =20 def test_0_second(self): message =3D Message() @@ -54,6 +55,35 @@ class MessageTest(PatchewTestCase): asctime =3D message.get_asctime() self.assertEqual(asctime, "Sat Oct 22 9:06:04 2016") =20 + def test_topic_on_series_head(self): + self.cli_login() + self.cli_import("0004-multiple-patch-reviewed.mbox.gz") + m1 =3D Message.objects.get( + message_id=3D"1469192015-16487-1-git-send-email-berrange@redha= t.com" + ) + assert m1.is_series_head + assert m1.topic is not None + m2 =3D Message.objects.get( + message_id=3D"1469192015-16487-2-git-send-email-berrange@redha= t.com" + ) + assert not m2.is_series_head + assert m2.topic is None + + def test_topic_assignment(self): + self.cli_login() + self.cli_import("0004-multiple-patch-reviewed.mbox.gz") + self.cli_import("0009-obsolete-by.mbox.gz") + + m1 =3D Message.objects.get(message_id=3D"20160628014747.20971-1-fa= mz@redhat.com") + m2 =3D Message.objects.get(message_id=3D"20160628014747.20971-2-fa= mz@redhat.com") + m3 =3D Message.objects.get(message_id=3D"20160628014747.20971-3-fa= mz@redhat.com") + self.assertEqual(m1.topic, m2.topic) + self.assertEqual(m1.topic, m3.topic) + n =3D Message.objects.get( + message_id=3D"1469192015-16487-1-git-send-email-berrange@redha= t.com" + ) + self.assertNotEqual(m1.topic, n.topic) + =20 if __name__ =3D=3D "__main__": main() --=20 2.21.0 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel From nobody Sat Apr 20 01:14:18 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=patchew-devel-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579187362; cv=none; d=zohomail.com; s=zohoarc; b=iE6Prj3Zj9FM9qaQqu3o5bnD+snhyK6BzmEUk1QczN3ckgKU/7ZvkbEuUNN9CGYjMGJiY1VloUblUdq+vh59Lt+On5fkPeY7EDXwev8y4je3C8X7kxy4kNjC01YUu9tshApffy7DclXS7PUpbI4ExbOno+ivVBQD2+RYEkvSiK8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579187362; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=B0f12W5FoYjMjx1YFJYH/I/e63/domRwURFRVfO/B5c=; b=HVhb54/yawoQ7R5/ytQkcFYkoAEgZTV065UU29rJCdADOxAQGnCJTDKrhIOBcED4+AGdSoQk+ZHEI8poCrj2s5wN7vt9oONLqrrTKwSgEy2PWGVl/yRdlCtgrN/GqOxX/TTLP09kV3JHCKQZ3NeaDrQZHWJR0jCAaSEdI7d13WU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1579187362809664.9480292280773; Thu, 16 Jan 2020 07:09:22 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-146-Bv1pCBydNP6iw3De_fGT5w-1; Thu, 16 Jan 2020 10:09:20 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 83E71800D4E; Thu, 16 Jan 2020 15:09:19 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7719489D04; Thu, 16 Jan 2020 15:09:19 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 699B9845F7; Thu, 16 Jan 2020 15:09:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00GF9I8R024610 for ; Thu, 16 Jan 2020 10:09:18 -0500 Received: by smtp.corp.redhat.com (Postfix) id 0F3D480890; Thu, 16 Jan 2020 15:09:18 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-112-61.ams2.redhat.com [10.36.112.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5F17984335 for ; Thu, 16 Jan 2020 15:09:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579187361; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=B0f12W5FoYjMjx1YFJYH/I/e63/domRwURFRVfO/B5c=; b=d3+HQsgMB6OdNx4WLplF2W6fDIyVnmc0WSWNfhEQN3d0pZ2RTrUUeooyrTEorp/P6i4Cz8 B56IOkOwvpq4cC6Yu4EgWd2lzPAl58ZrjHUMawnhE0wH1EW0E8BBWug89VYILMVhMGrVKC Wp3SRfrEmgx548+Ta2OV0qDKDdU1NjU= From: Paolo Bonzini To: patchew-devel@redhat.com Date: Thu, 16 Jan 2020 16:09:04 +0100 Message-Id: <20200116150909.21388-5-pbonzini@redhat.com> In-Reply-To: <20200116150909.21388-1-pbonzini@redhat.com> References: <20200116150909.21388-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: patchew-devel@redhat.com Subject: [Patchew-devel] [PATCH 4/9] modify database in preparation for removing is_series_head X-BeenThere: patchew-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Patchew development and discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: patchew-devel-bounces@redhat.com Errors-To: patchew-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MC-Unique: Bv1pCBydNP6iw3De_fGT5w-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Otherwise, Django creates the RemoveField migration before AlterIndexTogeth= er, and the latter fails to apply. Also add a default so that reverting the removal works. Signed-off-by: Paolo Bonzini --- api/migrations/0055_auto_20200116_1034.py | 24 +++++++++++++++++++++++ api/models.py | 11 +++++------ 2 files changed, 29 insertions(+), 6 deletions(-) create mode 100644 api/migrations/0055_auto_20200116_1034.py diff --git a/api/migrations/0055_auto_20200116_1034.py b/api/migrations/005= 5_auto_20200116_1034.py new file mode 100644 index 0000000..12ee668 --- /dev/null +++ b/api/migrations/0055_auto_20200116_1034.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.20 on 2020-01-16 10:56 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies =3D [ + ('api', '0054_populate_topic'), + ] + + operations =3D [ + migrations.AlterField( + model_name=3D'message', + name=3D'is_series_head', + field=3Dmodels.BooleanField(default=3DFalse), + ), + migrations.AlterIndexTogether( + name=3D'message', + index_together=3Dset([('topic', 'date'), ('topic', 'project', = 'last_reply_date'), ('topic', 'project', 'date'), ('topic', 'last_reply_dat= e')]), + ), + ] diff --git a/api/models.py b/api/models.py index 6f4ea4b..0435527 100644 --- a/api/models.py +++ b/api/models.py @@ -457,7 +457,6 @@ class MessageManager(models.Manager): msg.stripped_subject =3D m.get_subject(strip_tags=3DTrue) msg.version =3D m.get_version() msg.prefixes =3D m.get_prefixes() - msg.is_series_head =3D False if m.is_series_head(): msg.is_series_head =3D True msg.topic =3D Topic.objects.for_stripped_subject(msg.stripped_= subject) @@ -578,7 +577,7 @@ class Message(models.Model): recipients =3D jsonfield.JSONField() tags =3D jsonfield.JSONField(default=3D[]) prefixes =3D jsonfield.JSONField(blank=3DTrue) - is_series_head =3D models.BooleanField() + is_series_head =3D models.BooleanField(default=3DFalse) is_complete =3D models.BooleanField(default=3DFalse) is_patch =3D models.BooleanField() is_merged =3D models.BooleanField(default=3DFalse, blank=3DTrue) @@ -915,10 +914,10 @@ class Message(models.Model): class Meta: unique_together =3D ("project", "message_id") index_together =3D [ - ("is_series_head", "project", "last_reply_date"), - ("is_series_head", "project", "date"), - ("is_series_head", "last_reply_date"), - ("is_series_head", "date"), + ("topic", "project", "last_reply_date"), + ("topic", "project", "date"), + ("topic", "last_reply_date"), + ("topic", "date"), ] =20 =20 --=20 2.21.0 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel From nobody Sat Apr 20 01:14:18 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=patchew-devel-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579187364; cv=none; d=zohomail.com; s=zohoarc; b=UPT4WXTZC63brEuMG3QuDy5V+ue3FhC9HSeKWZjXmLmpJDQ7pk1KbPM2W2ZGN4PUyEHBHIv9zyTI7//olbh0NrS0oOeNu9IY2WUv/jxKpQaJPHmX4Cob3mtzgDAwpthNi6KiWTXSnD5gxsZ4vSUp4ChVPtz1gWnGm1HFh3QiAjc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579187364; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=eSAnCNVxn5rEWUjD1uUjDCqeejKdnvx2wCXiS+4GOPk=; b=NYVAL92BeQZV09dXp0tThOGZHMz/1vDn8BaIoFjX1YmQkhuQdE4IFSLB4zEezDrKNzyyYXx7uGb6RGgFB+/cpG1z/tYoXeYTQmtdHbBPAEmb5iVQa09bD+Tk9mz07Agic8osxMTCfarxfCdrY6SyF4xuOdKPx/5JkGOY78b4Vvg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1579187364711808.8308170320483; Thu, 16 Jan 2020 07:09:24 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-283-Xnb3IXduOFWrid7Ryz3GJg-1; Thu, 16 Jan 2020 10:09:22 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 35132800EBF; Thu, 16 Jan 2020 15:09:21 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 28BDB60C85; Thu, 16 Jan 2020 15:09:21 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id B092118034EA; Thu, 16 Jan 2020 15:09:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00GF9JqS024620 for ; Thu, 16 Jan 2020 10:09:19 -0500 Received: by smtp.corp.redhat.com (Postfix) id 27FC7842BA; Thu, 16 Jan 2020 15:09:19 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-112-61.ams2.redhat.com [10.36.112.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id 804CC80890 for ; Thu, 16 Jan 2020 15:09:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579187363; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=eSAnCNVxn5rEWUjD1uUjDCqeejKdnvx2wCXiS+4GOPk=; b=hR5GBETFiZ7yKf1xTjVcSohMHrxhXm6791bsSa1l1PyAI7l3DUm5VAYMcWSdFxe6JswzM7 KCmtENbKHPkiBRyk7OcDfgbCCs6l1ClElWA6Iy3TBKFYbvJv0R559Mn6jvQ32vLL0e4709 Bkn5lEx6ZegYjhWQc2fIXy3gmuTsQ9w= From: Paolo Bonzini To: patchew-devel@redhat.com Date: Thu, 16 Jan 2020 16:09:05 +0100 Message-Id: <20200116150909.21388-6-pbonzini@redhat.com> In-Reply-To: <20200116150909.21388-1-pbonzini@redhat.com> References: <20200116150909.21388-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: patchew-devel@redhat.com Subject: [Patchew-devel] [PATCH 5/9] remove is_series_head field X-BeenThere: patchew-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Patchew development and discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: patchew-devel-bounces@redhat.com Errors-To: patchew-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: Xnb3IXduOFWrid7Ryz3GJg-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This also introduces a database migration in order to undo the removal. The field is populated from the topic field when it is added back. Signed-off-by: Paolo Bonzini --- api/admin.py | 1 - api/migrations/0056_repopulate_series_head.py | 18 ++++++++++++++++++ .../0057_remove_message_is_series_head.py | 19 +++++++++++++++++++ api/models.py | 17 +++++++++-------- api/rest.py | 2 +- 5 files changed, 47 insertions(+), 10 deletions(-) create mode 100644 api/migrations/0056_repopulate_series_head.py create mode 100644 api/migrations/0057_remove_message_is_series_head.py diff --git a/api/admin.py b/api/admin.py index d0143d2..d85f5b8 100644 --- a/api/admin.py +++ b/api/admin.py @@ -18,7 +18,6 @@ class ProjectAdmin(admin.ModelAdmin): =20 =20 class MessageAdmin(admin.ModelAdmin): - list_filter =3D [("is_series_head")] search_fields =3D ["message_id", "subject", "sender"] =20 =20 diff --git a/api/migrations/0056_repopulate_series_head.py b/api/migrations= /0056_repopulate_series_head.py new file mode 100644 index 0000000..8ffd266 --- /dev/null +++ b/api/migrations/0056_repopulate_series_head.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.conf import settings +from django.db import migrations + + +def series_head_fill(apps, schema_editor): + Message =3D apps.get_model("api", "Message") + Message.objects.filter(topic__isnull=3DFalse).update(is_series_head=3D= True) + + +class Migration(migrations.Migration): + dependencies =3D [("api", "0055_auto_20200116_1034")] + + operations =3D [ + migrations.RunPython(migrations.RunPython.noop, reverse_code=3Dser= ies_head_fill) + ] diff --git a/api/migrations/0057_remove_message_is_series_head.py b/api/mig= rations/0057_remove_message_is_series_head.py new file mode 100644 index 0000000..c0dc476 --- /dev/null +++ b/api/migrations/0057_remove_message_is_series_head.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.20 on 2020-01-16 10:36 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies =3D [ + ('api', '0056_repopulate_series_head'), + ] + + operations =3D [ + migrations.RemoveField( + model_name=3D'message', + name=3D'is_series_head', + ), + ] diff --git a/api/models.py b/api/models.py index 0435527..f5a1114 100644 --- a/api/models.py +++ b/api/models.py @@ -387,7 +387,7 @@ class MessageManager(models.Manager): if po is None: return None =20 - q =3D super(MessageManager, self).get_queryset() + q =3D self.get_queryset() q =3D q.filter(project=3Dpo) | q.filter(project__parent_project=3D= po) return q =20 @@ -397,8 +397,8 @@ class MessageManager(models.Manager): if q is None: return None else: - q =3D super(MessageManager, self).get_queryset() - return q.filter(is_series_head=3DTrue).prefetch_related("project") + q =3D self.get_queryset() + return q.filter(topic__isnull=3DFalse).prefetch_related("project") =20 def find_series(self, message_id, project_name=3DNone): heads =3D self.series_heads(project_name) @@ -413,7 +413,7 @@ class MessageManager(models.Manager): return messages.filter(message_id=3Dmessage_id).first() =20 def patches(self): - return super(MessageManager, self).get_queryset().filter(is_patch= =3DTrue) + return self.get_queryset().filter(is_patch=3DTrue) =20 def update_series(self, msg): """Update the series' record to which @msg is replying""" @@ -458,7 +458,6 @@ class MessageManager(models.Manager): msg.version =3D m.get_version() msg.prefixes =3D m.get_prefixes() if m.is_series_head(): - msg.is_series_head =3D True msg.topic =3D Topic.objects.for_stripped_subject(msg.stripped_= subject) =20 msg.is_patch =3D m.is_patch() @@ -493,7 +492,6 @@ class MessageManager(models.Manager): sender=3Dm.get_from(), recipients=3Dm.get_to() + m.get_cc(), prefixes=3Dm.get_prefixes(), - is_series_head=3Dis_series_head, topic=3D( Topic.objects.for_stripped_subject(stripped_subject) if is_series_head @@ -577,7 +575,6 @@ class Message(models.Model): recipients =3D jsonfield.JSONField() tags =3D jsonfield.JSONField(default=3D[]) prefixes =3D jsonfield.JSONField(blank=3DTrue) - is_series_head =3D models.BooleanField(default=3DFalse) is_complete =3D models.BooleanField(default=3DFalse) is_patch =3D models.BooleanField() is_merged =3D models.BooleanField(default=3DFalse, blank=3DTrue) @@ -593,7 +590,7 @@ class Message(models.Model): # patch index number if is_patch patch_num =3D models.PositiveSmallIntegerField(null=3DTrue, blank=3DTr= ue) =20 - # number of patches we've got if is_series_head + # number of patches we've got if series head (non-null topic) num_patches =3D models.IntegerField(null=3DFalse, default=3D-1, blank= =3DTrue) =20 queues =3D models.ManyToManyField(User, blank=3DTrue, through=3DQueued= Series) @@ -706,6 +703,10 @@ class Message(models.Model): project_id=3Dself.project_id, message_id=3Dself.in_reply_to ).first() =20 + @property + def is_series_head(self): + return self.topic is not None + def get_series_head(self): s =3D self while s: diff --git a/api/rest.py b/api/rest.py index a3b760c..3a9def5 100644 --- a/api/rest.py +++ b/api/rest.py @@ -526,7 +526,7 @@ class PatchewSearchFilter(filters.BaseFilterBackend): =20 class SeriesViewSet(BaseMessageViewSet): serializer_class =3D SeriesSerializer - queryset =3D Message.objects.filter(is_series_head=3DTrue).order_by("-= last_reply_date") + queryset =3D Message.objects.filter(topic__isnull=3DFalse).order_by("-= last_reply_date") filter_backends =3D (PatchewSearchFilter,) search_fields =3D (SEARCH_PARAM,) =20 --=20 2.21.0 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel From nobody Sat Apr 20 01:14:18 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=patchew-devel-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579187369; cv=none; d=zohomail.com; s=zohoarc; b=frRB/iuQcOOlSacFmmUZh5G5nQbzqjNbG8p+Dz8b69Rv1jqf3pQk9o9lxyQ0juhRcElZdUkPSvWQSDbgyLUfKrJ1ILR2KXbqmmdWA/ZnzrU05nBNoVxzipmJo436XmVJ+Q6tkcSgfpSSW5jI7j1evqQNBZ9J28q9hJZmiRdlyPg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579187369; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=51KcSkEDo/vLxlyfHWz3n/PeTeKj+8b8jdZehLQaBzc=; b=aDY3+xq8FitkhyGrfWS2fbGRi3K3k/tGnkhNoxE8LcFQXWxWB92xzuYDqYbyGa+kpHYcEAtgCbdx+CN+Ie3JS3wlbkan5QgWCyTC3vW1nN26NI9BBFvRNFsrT0jEc3MMsg54fY3QJOMuaDMZSCA+C1I7hSul6RpK5Ye8H6l5H2Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1579187369248641.5735691536524; Thu, 16 Jan 2020 07:09:29 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-153-OnoN1G24Md2raGqPSp0Ipw-1; Thu, 16 Jan 2020 10:09:22 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1FA1F1800D48; Thu, 16 Jan 2020 15:09:21 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0FDDC60FC1; Thu, 16 Jan 2020 15:09:21 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id F357B18034EF; Thu, 16 Jan 2020 15:09:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00GF9KY8024632 for ; Thu, 16 Jan 2020 10:09:20 -0500 Received: by smtp.corp.redhat.com (Postfix) id 3E908842BA; Thu, 16 Jan 2020 15:09:20 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-112-61.ams2.redhat.com [10.36.112.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9104E80890 for ; Thu, 16 Jan 2020 15:09:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579187368; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=51KcSkEDo/vLxlyfHWz3n/PeTeKj+8b8jdZehLQaBzc=; b=ZuY1+JglkmwEObguZ8NzKxsMhbvvo86Xuzfac6xpLylSCNwVk4q9X5rbth4TIsXOMU+Wjk xdFlnCC9712Te9c7/LrnBrMby8CwI6kn5ZSPh4Xu32T2tniwEBErjikWFuiDyWs7dI7fnL BNMdVByjy158IuAypbiSULAuRnmaTzc= From: Paolo Bonzini To: patchew-devel@redhat.com Date: Thu, 16 Jan 2020 16:09:06 +0100 Message-Id: <20200116150909.21388-7-pbonzini@redhat.com> In-Reply-To: <20200116150909.21388-1-pbonzini@redhat.com> References: <20200116150909.21388-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: patchew-devel@redhat.com Subject: [Patchew-devel] [PATCH 6/9] remove obsoleted-by property X-BeenThere: patchew-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Patchew development and discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: patchew-devel-bounces@redhat.com Errors-To: patchew-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: OnoN1G24Md2raGqPSp0Ipw-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Move the obsoleted-by property to the Topic model, which ensures it is consistent for all series in the same topic. While at it, fix the obsoletion check to use the date if the versions are equal. This works better if the submitter forgets to bump the version. Signed-off-by: Paolo Bonzini --- api/migrations/0059_populate_topic_latest.py | 32 ++++++++++ api/models.py | 3 + mods/tags.py | 62 +++++++++---------- tests/data/0030-obsolete-by-v3.mbox.gz | Bin 0 -> 2302 bytes tests/test_tags.py | 40 +++++++++--- 5 files changed, 97 insertions(+), 40 deletions(-) create mode 100644 api/migrations/0059_populate_topic_latest.py create mode 100644 tests/data/0030-obsolete-by-v3.mbox.gz diff --git a/api/migrations/0059_populate_topic_latest.py b/api/migrations/= 0059_populate_topic_latest.py new file mode 100644 index 0000000..eae7607 --- /dev/null +++ b/api/migrations/0059_populate_topic_latest.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.conf import settings +from django.db import migrations + + +def topic_fill_latest(apps, schema_editor): + Message =3D apps.get_model("api", "Message") + Topic =3D apps.get_model("api", "Topic") + series =3D Message.objects.filter(topic__isnull=3DFalse) + for m in series.filter(is_obsolete=3DFalse): + m.topic.latest =3D m + for m in series.filter(is_obsolete=3DTrue): + if "obsoleted-by" in m.properties: + del m.properties["obsoleted-by"] + m.save() + + +def message_set_obsoleted_by(apps, schema_editor): + Message =3D apps.get_model("api", "Message") + for m in Message.objects.filter(is_obsolete=3DTrue, topic__latest__isn= ull=3DFalse): + m.properties["obsoleted-by"] =3D m.topic.latest.message_id + m.save() + + +class Migration(migrations.Migration): + dependencies =3D [("api", "0058_topic_latest")] + + operations =3D [ + migrations.RunPython(topic_fill_latest, reverse_code=3Dmessage_set= _obsoleted_by) + ] diff --git a/api/models.py b/api/models.py index f5a1114..ab122e6 100644 --- a/api/models.py +++ b/api/models.py @@ -546,6 +546,9 @@ class TopicManager(models.Manager): =20 class Topic(models.Model): objects =3D TopicManager() + latest =3D models.ForeignKey( + "Message", on_delete=3Dmodels.SET_NULL, null=3DTrue, related_name= =3D"+" + ) =20 =20 class Message(models.Model): diff --git a/mods/tags.py b/mods/tags.py index 55cc9a6..ec2cc49 100644 --- a/mods/tags.py +++ b/mods/tags.py @@ -79,17 +79,11 @@ series cover letter, patch mail body and their replies. return =20 def newer_than(m1, m2): - return m1.version > m2.version and m1.date >=3D m2.date - - for m in series.get_alternative_revisions(): - if newer_than(m, series): - series.is_obsolete =3D True - series.save() - series.set_property("obsoleted-by", m.message_id) - elif newer_than(series, m): - m.is_obsolete =3D True - m.save() - m.set_property("obsoleted-by", series.message_id) + if m1.version > m2.version: + return m1.date >=3D m2.date + if m1.version < m2.version: + return False + return m1.date > m2.date =20 updated =3D self.update_tags(series) =20 @@ -127,6 +121,14 @@ series cover letter, patch mail body and their replies. if updated: emit_event("TagsUpdate", series=3Dseries) =20 + if not series.topic.latest or newer_than(series, series.topic.late= st): + series.topic.latest =3D series + series.topic.save() + for m in series.get_alternative_revisions(): + if not m.is_obsolete and m.topic.latest !=3D m: + m.is_obsolete =3D True + m.save() + def parse_message_tags(self, m): r =3D [] for l in m.get_body().splitlines(): @@ -156,29 +158,25 @@ series cover letter, patch mail body and their replie= s. "char": "R", } ) - ob =3D message.get_property("obsoleted-by") - if ob: - new =3D Message.objects.find_series(ob, message.project.name) - if new is not None: - message.status_tags.append( - { - "title": "Has a newer version: " + new.subject, - "type": "default", - "char": "O", - "row_class": "obsolete", - } - ) + if message.is_obsolete: + message.status_tags.append( + { + "title": "Has a newer version: " + message.topic.lates= t.subject, + "type": "default", + "char": "O", + "row_class": "obsolete", + } + ) =20 def get_obsoleted_by(self, message, request, format): - obsoleted_by =3D message.get_property("obsoleted-by") - if not obsoleted_by: - return None - return rest_framework.reverse.reverse( - "series-detail", - kwargs=3D{"projects_pk": message.project.id, "message_id": obs= oleted_by}, - request=3Drequest, - format=3Dformat, - ) + if message.is_obsolete: + obsoleted_by =3D message.topic.latest.message_id + return rest_framework.reverse.reverse( + "series-detail", + kwargs=3D{"projects_pk": message.project.id, "message_id":= obsoleted_by}, + request=3Drequest, + format=3Dformat, + ) =20 def get_reviewers(self, message, request, format): reviewers =3D message.get_property("reviewers", []) diff --git a/tests/data/0030-obsolete-by-v3.mbox.gz b/tests/data/0030-obsol= ete-by-v3.mbox.gz new file mode 100644 index 0000000000000000000000000000000000000000..abd55385f95f2be5d7ad487d233= 01c45729eb371 GIT binary patch literal 2302 zcmZw1X*?4O003|~GRK;dn;elgXU!2YVsbRC<&JVRnM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qq~x)MlHA95+yIt?tQ)VTa9I&_Cm zD_?QsOMvR54-%`>ow7G6i27Yz=3Dk}#Pj;*jtK6>5Az^`$!ep|Vnob(=3DJmPJEh?HUH> z=3DW`6QDl7YZOUJsVBAN#u*{H<{I$jYyr_^TuM*cFhfWgzst0Pp{Rk#BqGu+XI`CB44 zI-sN>-tgxpJil1yiN?g&bI{udAuiZnQ7g6=3D%CfS1$jLfpZZHveQxg$K)Rd~rAQ{88 z(a=3Di?-AvUsif9Ql=3DD~v(%nKJbwS+;Usdt~EuYbb6K0_QA$XY&HD|TPL`bo;ZF72xD zBsXH!#Vr+{lrQP=3D5k7stq?eN`pcg9&euy3yy1Kq&@;)2-6EGM6V<&FlPiw@h+AMH=3D z2G8X=3D3cIrIR0&-_Lf8rXnUy#z!td+p9}3=3DHsF-?3>ufw#%r3LCw+i71JtS&6?n&Fv zaeh>cYZ2^E7VPdGK>$#ax>Tv9>;oqx^FT1E4O!`tD=3Dm7wE9;tnwq^A-;*la~&~2Y- zd5FMX?b#vz#)tBrSe*D=3DG`_-u;pyao5;ju}nmTy?q1PA}|LTQDpm&AaEB%)dKYa@@8K z`=3DNQ^GLvF4#H>tTzmwso^cH26XX--j1)M1MCSLL6Xl>AZ*TUT*o1)8wXODPstcl|C zPolT@dMk?bD=3DIEn)VDNU;A$$=3D^;Uq2cO(s}%4}!3N8UHArq*L}gDdB0P32*)o=3D%yd zsh=3D6_3(5`A5O4vRCw_A|UAU)w$eKPQ=3D$U_qZp;j)Krl|+M`-)!J6DeaJ(6r_dss3) z59#-Zy;G6nZ@V$=3DMuGj#OQ!li!|Z2muE^+u5sTlY!6N)6mKJP0q5wHPJQ|&%?R9VR zFfbV$KW6!4FHA?witln%^w44Z>s5tiTy^P4Z%7h}", resp.dat= a["tags"]) self.assertIn("tESTed-bY: Fam Zheng ", resp.data[= "tags"]) =20 - def test_obsoleted_by(self): + def do_test_obsoleted_by(self, old_id, new_id): + m1 =3D Message.objects.find_series(old_id, self.p.name) + m2 =3D Message.objects.find_series(new_id, self.p.name) + self.assertEqual(m1.topic, m2.topic) + + resp =3D self.api_client.get(self.PROJECT_BASE + "series/" + old_i= d + "/") + self.assertEqual( + self.PROJECT_BASE + "series/" + new_id + "/", resp.data["obsol= eted_by"] + ) + resp =3D self.api_client.get(self.PROJECT_BASE + "series/" + new_i= d + "/") + self.assertEqual(None, resp.data["obsoleted_by"]) + + def test_obsoleted_by_date_out_of_order(self): self.cli_login() self.cli_import("0009-obsolete-by.mbox.gz") self.cli_logout() - OLD_ID =3D "20160628014747.20971-1-famz@redhat.com" - NEW_ID =3D "20160628014747.20971-2-famz@redhat.com" - resp =3D self.api_client.get(self.PROJECT_BASE + "series/" + OLD_I= D + "/") - self.assertEqual( - self.PROJECT_BASE + "series/" + NEW_ID + "/", resp.data["obsol= eted_by"] + # note that the "v3" actually has an older date than v2 in the tes= tcase + self.do_test_obsoleted_by( + "20160628014747.20971-1-famz@redhat.com", + "20160628014747.20971-2-famz@redhat.com", + ) + + def test_obsoleted_by_v3(self): + self.cli_login() + self.cli_import("0030-obsolete-by-v3.mbox.gz") + self.cli_logout() + # note that the "v3" actually has an older date than v2 in the tes= tcase + self.do_test_obsoleted_by( + "20160628014747.20971-2-famz@redhat.com", + "20160628014747.20971-3-famz@redhat.com", + ) + self.do_test_obsoleted_by( + "20160628014747.20971-1-famz@redhat.com", + "20160628014747.20971-3-famz@redhat.com", ) - resp =3D self.api_client.get(self.PROJECT_BASE + "series/" + NEW_I= D + "/") - self.assertEqual(None, resp.data["obsoleted_by"]) =20 =20 if __name__ =3D=3D "__main__": --=20 2.21.0 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel From nobody Sat Apr 20 01:14:18 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=patchew-devel-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579187371; cv=none; d=zohomail.com; s=zohoarc; b=bktb9uuBzbYqmDr191J3Y8AZkRmNCrZPR46jb2ZR3f3TAi5s1h2dlY9/fDRsN8f1jipB6rEwrsQlcuiynMJ+stmerW6juBIhq8tNM3APjrTysHAzvZzyYSGC5L5SjiGjGk0gh9dakxBWgrp1MwctbKjEXWL+P2GefXNOqV9LoMY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579187371; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=s+bq/rwav2dMWZvg1evpB7xuBtsrkFjGvhlTJp35/BU=; b=LEcHn+Fn5YOpy+CrazHdbLSyn+GmBh/o4Tl5zDGe5gXdgR21ALEKCNWMTNjmd/IsdaHS++cspov4gxuPndm0266ss4BANvap4t59en3aCdREsHBVMsNbUmGcl4hm6f4gYzrmy0AD8Em/qG6jz6eLlRfJCfcsZBZifi1zmSGnG5w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1579187371365411.48451140662553; Thu, 16 Jan 2020 07:09:31 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-186-yUQ6GzpJMoS9lXIREhn5iA-1; Thu, 16 Jan 2020 10:09:24 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E91918017CC; Thu, 16 Jan 2020 15:09:22 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DDACD60C63; Thu, 16 Jan 2020 15:09:22 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id D0D89845F5; Thu, 16 Jan 2020 15:09:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00GF9LeI024642 for ; Thu, 16 Jan 2020 10:09:21 -0500 Received: by smtp.corp.redhat.com (Postfix) id 549888432E; Thu, 16 Jan 2020 15:09:21 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-112-61.ams2.redhat.com [10.36.112.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id B07D780890 for ; Thu, 16 Jan 2020 15:09:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579187370; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=s+bq/rwav2dMWZvg1evpB7xuBtsrkFjGvhlTJp35/BU=; b=Z1Z6rr5XI+CrOLZOm8ITyEehcG1LyTS8yGmzMkEKr+oqv/D4RDsHzKGpy4VkicRFXI2udT /4Yg7KPFXAZrnjzwmy+YbUszwpUvie0ksJhDwbC0+616QH/zi4MemdvX9JffxqRAf23OmW GgX21AssGxQiK3Zxxnog23g1uBOnEl8= From: Paolo Bonzini To: patchew-devel@redhat.com Date: Thu, 16 Jan 2020 16:09:07 +0100 Message-Id: <20200116150909.21388-8-pbonzini@redhat.com> In-Reply-To: <20200116150909.21388-1-pbonzini@redhat.com> References: <20200116150909.21388-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: patchew-devel@redhat.com Subject: [Patchew-devel] [PATCH 7/9] omit Based-on from downloaded mbox X-BeenThere: patchew-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Patchew development and discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: patchew-devel-bounces@redhat.com Errors-To: patchew-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: yUQ6GzpJMoS9lXIREhn5iA-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The Based-on tag is internal and the information it includes is already accessible from the git base. Do not include it in downloaded mboxes, so that it is not committed to git for no-cover-letter series. Signed-off-by: Paolo Bonzini Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- api/migrations/0056_repopulate_series_head.py | 4 +--- api/models.py | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/api/migrations/0056_repopulate_series_head.py b/api/migrations= /0056_repopulate_series_head.py index 8ffd266..2c2251c 100644 --- a/api/migrations/0056_repopulate_series_head.py +++ b/api/migrations/0056_repopulate_series_head.py @@ -13,6 +13,4 @@ def series_head_fill(apps, schema_editor): class Migration(migrations.Migration): dependencies =3D [("api", "0055_auto_20200116_1034")] =20 - operations =3D [ - migrations.RunPython(migrations.RunPython.noop, reverse_code=3Dser= ies_head_fill) - ] + operations =3D [migrations.RunPython(migrations.RunPython.noop, revers= e_code=3Dseries_head_fill)] diff --git a/api/models.py b/api/models.py index ab122e6..6ae2bae 100644 --- a/api/models.py +++ b/api/models.py @@ -635,7 +635,7 @@ class Message(models.Model): =20 # If no --- line, tags go at the end as there's no better place for tag in sorted(tags): - if tag not in old_tags: + if tag not in old_tags and not tag.startswith("Based-on"): yield tag if need_minusminusminus: yield line --=20 2.21.0 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel From nobody Sat Apr 20 01:14:18 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=patchew-devel-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579187367; cv=none; d=zohomail.com; s=zohoarc; b=Pd0EB4XxU4GRQr9eryXm+FhHUAWT5V7iZVCfwd/coneYu0M4W74S+3ePvfugrjlNCGPWDf6+pEn839LZ5Dq6L0PauXOG8icz7Jy3KAXWlbWjqKP/jTER4Vg9xiq8ukWto3SH8ucRRAtVWc6TPrTb4YE4rjLeI2phgoo/JUcJy2c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579187367; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=6OqQcuv5gcsPeath7u815z8jbyNq32EYhEFvNSScU0I=; b=aEBs5QD9hjD7X/5VBpCsFt9exiO/scCx8zNx4jzIYTtTxkKHXWdJMIwe7/foSn+K3m6IVVYbB0kCTXYmM5z5/vHIoBbEqoL8Ca6Y4Yg3oiaAky91YiAMJYsgBh0suSeELQajgYeWVg0Rz7BTGnRZV1zGmSEXwvWmeosCeTxgcuw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1579187367075562.8167570763036; Thu, 16 Jan 2020 07:09:27 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-233-Vqn-clbAN1OxXZ4Qz7OB8Q-1; Thu, 16 Jan 2020 10:09:24 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B1CDA108442C; Thu, 16 Jan 2020 15:09:23 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A76E78889C; Thu, 16 Jan 2020 15:09:23 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 99B9218034EA; Thu, 16 Jan 2020 15:09:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00GF9Mth024652 for ; Thu, 16 Jan 2020 10:09:22 -0500 Received: by smtp.corp.redhat.com (Postfix) id 6B9ED8432E; Thu, 16 Jan 2020 15:09:22 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-112-61.ams2.redhat.com [10.36.112.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id BDEBC80890 for ; Thu, 16 Jan 2020 15:09:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579187365; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=6OqQcuv5gcsPeath7u815z8jbyNq32EYhEFvNSScU0I=; b=L2Zb8maEbMQP3LSC3QhbOnaMphdwes123l4n6aNbujFe1KEuQzSVpiWXztoT6n8aEaSBg2 u6ljWH6rwGvqIdE0loaMUIf+rcYN4ISrZNwixrmER+ZpESQMoXeGY1AfV772usYSGDkBcX RmImP/F05dTd124p+RghWHkZ2P47LBU= From: Paolo Bonzini To: patchew-devel@redhat.com Date: Thu, 16 Jan 2020 16:09:08 +0100 Message-Id: <20200116150909.21388-9-pbonzini@redhat.com> In-Reply-To: <20200116150909.21388-1-pbonzini@redhat.com> References: <20200116150909.21388-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: patchew-devel@redhat.com Subject: [Patchew-devel] [PATCH 8/9] extract find_series_from_tag X-BeenThere: patchew-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Patchew development and discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: patchew-devel-bounces@redhat.com Errors-To: patchew-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MC-Unique: Vqn-clbAN1OxXZ4Qz7OB8Q-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The same algorithm used for Based-on will be used also for Supersedes; extract it to a utility method. While at it allow passing a Project instance to the various prebuild query methods exposed by MessageManager. Signed-off-by: Paolo Bonzini Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- api/models.py | 22 +++++++++++++++++----- mods/git.py | 9 +-------- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/api/models.py b/api/models.py index 6ae2bae..6fd04fa 100644 --- a/api/models.py +++ b/api/models.py @@ -380,7 +380,9 @@ class MessageManager(models.Manager): =20 def project_messages(self, project): po =3D None - if isinstance(project, str): + if isinstance(project, Project): + po =3D project + elif isinstance(project, str): po =3D Project.objects.filter(name=3Dproject).first() elif isinstance(project, int): po =3D Project.objects.filter(id=3Dproject).first() @@ -400,18 +402,28 @@ class MessageManager(models.Manager): q =3D self.get_queryset() return q.filter(topic__isnull=3DFalse).prefetch_related("project") =20 - def find_series(self, message_id, project_name=3DNone): - heads =3D self.series_heads(project_name) + def find_series(self, message_id, project=3DNone): + heads =3D self.series_heads(project) if heads is None: return None return heads.filter(message_id=3Dmessage_id).first() =20 - def find_message(self, message_id, project_name): - messages =3D self.project_messages(project_name) + def find_message(self, message_id, project): + messages =3D self.project_messages(project) if messages is None: return None return messages.filter(message_id=3Dmessage_id).first() =20 + def find_series_from_tag(self, tag, project): + try: + colon =3D tag.index(":") + except ValueError: + return None + msgid =3D tag[colon + 1 :].strip() + if msgid.startswith("<") and msgid.endswith(">"): + msgid =3D msgid[1:-1] + return self.find_series(msgid, project) + def patches(self): return self.get_queryset().filter(is_patch=3DTrue) =20 diff --git a/mods/git.py b/mods/git.py index c17186f..d10cbeb 100644 --- a/mods/git.py +++ b/mods/git.py @@ -237,14 +237,7 @@ class GitModule(PatchewModule): for tag in series.tags: if not tag.startswith("Based-on:"): continue - base_id =3D tag[len("Based-on:") :].strip() - if base_id.startswith("<") and base_id.endswith(">"): - base_id =3D base_id[1:-1] - base =3D ( - Message.objects.series_heads() - .filter(project=3Dseries.project, message_id=3Dbase_id) - .first() - ) + base =3D Message.objects.find_series_from_tag(tag, series.proj= ect) if not base: return None r =3D base.git_result --=20 2.21.0 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel From nobody Sat Apr 20 01:14:18 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=patchew-devel-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579187406; cv=none; d=zohomail.com; s=zohoarc; b=UBI7ZCXafjaFPsiYNgLgbqoA8zVN1JD3LdVeWhxUOzd6AcmNNOInbxVPJBIoLsQo+Adruhk35qBtSczFUxS2aheIdF2cgmTeJuLguIVs5f/EoUgfM2S//FV56A43ojBefQZFeEVwn45c6Q6LlRlmyoFpXiS4PfCkPFGleYx3nm8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579187406; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=q5hwvUdUXAWypwkOQor5LM4+kKtZbpgJlhRh7XJgacQ=; b=IVai/Q+FxJpuuHQWgd+2pUu0guI3jNv/EXkimmUmkBCD0cwuBIoVl7HR872GpANwNeDF5BTE3GroYuhBlUIiHk/4dd+MYBPfsCvmcc5utdXxgXq910prRDJelbvnGyw7j9/tLV0QeaIU+jOvyvghIWdvgdvqhpDAcNj1YQQ19zw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1579187406169305.7874020733062; Thu, 16 Jan 2020 07:10:06 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-206-cNQB-QmDMzqPWRxiIAhJvw-1; Thu, 16 Jan 2020 10:09:36 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 11A531800D48; Thu, 16 Jan 2020 15:09:27 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0607260F82; Thu, 16 Jan 2020 15:09:27 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id EE2BA18034EA; Thu, 16 Jan 2020 15:09:26 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00GF9NbJ024662 for ; Thu, 16 Jan 2020 10:09:23 -0500 Received: by smtp.corp.redhat.com (Postfix) id ECAA08432E; Thu, 16 Jan 2020 15:09:23 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-112-61.ams2.redhat.com [10.36.112.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id DF08684338; Thu, 16 Jan 2020 15:09:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579187402; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=q5hwvUdUXAWypwkOQor5LM4+kKtZbpgJlhRh7XJgacQ=; b=DGxrgpF25USsPYNK6ljWnRpuri/G1HQ7rgcIQp4RUGetfrbR55v+iTnQobPwY5QmJqlcAE 7RdI1Oo0z3xBEA2tHxXPgl0H4oISWTy4Ub6NbWmGhuPVdxvPh/rFaNiEmYJRMFnweGfsn1 BcX0+BUvX7tUoMeROSLRCNDs4AvsfZ8= From: Paolo Bonzini To: patchew-devel@redhat.com Date: Thu, 16 Jan 2020 16:09:09 +0100 Message-Id: <20200116150909.21388-10-pbonzini@redhat.com> In-Reply-To: <20200116150909.21388-1-pbonzini@redhat.com> References: <20200116150909.21388-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: patchew-devel@redhat.com Cc: Kevin Wolf Subject: [Patchew-devel] [PATCH 9/9] process Supersedes tags X-BeenThere: patchew-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Patchew development and discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: patchew-devel-bounces@redhat.com Errors-To: patchew-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: cNQB-QmDMzqPWRxiIAhJvw-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" A Supersedes tags puts two series in the same topic, even if they have different subjects. For this to work, do not compare versions unless the stripped subject is the same, and always treat already-obsolete series as older. Suggested-by: Kevin Wolf Signed-off-by: Paolo Bonzini Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- api/models.py | 12 +++++- mods/tags.py | 44 +++++++++++++++----- tests/data/0031-supersedes-embedded.mbox.gz | Bin 0 -> 5342 bytes tests/data/0032-supersedes-separate.mbox.gz | Bin 0 -> 6268 bytes tests/test_tags.py | 18 ++++++++ 5 files changed, 63 insertions(+), 11 deletions(-) create mode 100644 tests/data/0031-supersedes-embedded.mbox.gz create mode 100644 tests/data/0032-supersedes-separate.mbox.gz diff --git a/api/models.py b/api/models.py index 6fd04fa..adceee4 100644 --- a/api/models.py +++ b/api/models.py @@ -562,6 +562,12 @@ class Topic(models.Model): "Message", on_delete=3Dmodels.SET_NULL, null=3DTrue, related_name= =3D"+" ) =20 + def merge_with(self, superseded): + if self =3D=3D superseded: + return + Message.objects.filter(topic=3Dself).update(topic=3Dsuperseded) + self.delete() + =20 class Message(models.Model): """ Patch email message """ @@ -647,7 +653,11 @@ class Message(models.Model): =20 # If no --- line, tags go at the end as there's no better place for tag in sorted(tags): - if tag not in old_tags and not tag.startswith("Based-on"): + if ( + tag not in old_tags + and not tag.startswith("Based-on") + and not tag.startswith("Supersedes") + ): yield tag if need_minusminusminus: yield line diff --git a/mods/tags.py b/mods/tags.py index ec2cc49..2c3a503 100644 --- a/mods/tags.py +++ b/mods/tags.py @@ -17,6 +17,7 @@ import rest_framework =20 REV_BY_PREFIX =3D "Reviewed-by:" BASED_ON_PREFIX =3D "Based-on:" +SUPERSEDES_PREFIX =3D "Supersedes:" =20 _default_config =3D """ [default] @@ -24,7 +25,7 @@ tags =3D Tested-by, Reported-by, Acked-by, Suggested-by =20 """ =20 -BUILT_IN_TAGS =3D [REV_BY_PREFIX, BASED_ON_PREFIX] +BUILT_IN_TAGS =3D [REV_BY_PREFIX, BASED_ON_PREFIX, SUPERSEDES_PREFIX] =20 =20 class SeriesTagsModule(PatchewModule): @@ -67,7 +68,7 @@ series cover letter, patch mail body and their replies. =20 def update_tags(self, s): old =3D s.tags - new =3D self.look_for_tags(s) + new =3D self.look_for_tags(s, s) if set(old) !=3D set(new): s.tags =3D list(set(new)) s.save() @@ -79,9 +80,16 @@ series cover letter, patch mail body and their replies. return =20 def newer_than(m1, m2): - if m1.version > m2.version: - return m1.date >=3D m2.date - if m1.version < m2.version: + if m1 =3D=3D m2: + return False + if m1.stripped_subject =3D=3D m2.stripped_subject: + if m1.version > m2.version: + return m1.date >=3D m2.date + if m1.version < m2.version: + return False + if m2.is_obsolete and not m1.is_obsolete: + return True + if m1.is_obsolete and not m2.is_obsolete: return False return m1.date > m2.date =20 @@ -129,21 +137,37 @@ series cover letter, patch mail body and their replie= s. m.is_obsolete =3D True m.save() =20 - def parse_message_tags(self, m): + def process_supersedes(self, series, tag): + old =3D Message.objects.find_series_from_tag(tag, series.project) + if old: + # the newer_than test does not work when the subject changes + assert old.topic + series.topic =3D old.topic + if old.topic.latest =3D=3D old: + old.topic.latest =3D series + old.topic.save() + old.is_obsolete =3D True + old.save() + series.topic.merge_with(old.topic) + + def parse_message_tags(self, series, m): r =3D [] for l in m.get_body().splitlines(): + line =3D l.lower() for p in self.get_tag_prefixes(): - if l.lower().startswith(p.lower()): + if line.startswith(p.lower()): + if line.startswith("supersedes:"): + self.process_supersedes(series, l) r.append(l) return r =20 - def look_for_tags(self, m): + def look_for_tags(self, series, m): # Incorporate tags from non-patch replies - r =3D self.parse_message_tags(m) + r =3D self.parse_message_tags(series, m) for x in m.get_replies(): if x.is_patch: continue - r +=3D self.look_for_tags(x) + r +=3D self.look_for_tags(series, x) return r =20 def prepare_message_hook(self, request, message, detailed): diff --git a/tests/data/0031-supersedes-embedded.mbox.gz b/tests/data/0031-= supersedes-embedded.mbox.gz new file mode 100644 index 0000000000000000000000000000000000000000..a32bfe494f6f3c5d961103d03bb= 402be937c024a GIT binary patch literal 5342 zcmV<46d~&$iwFp;VIW=3Dr128Z%FfDU+aAk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KOi6hQ<$ zOg$GMr0Du)FivR!s literal 0 HcmV?d00001 diff --git a/tests/data/0032-supersedes-separate.mbox.gz b/tests/data/0032-= supersedes-separate.mbox.gz new file mode 100644 index 0000000000000000000000000000000000000000..3cfc5ffa5625fee1cfac15b598c= 7904d757151eb GIT binary patch literal 6268 zcmV-?7=3Dz~@iwFo_av)v+128Z%F)ed-aAk6HWn^V@EpugXVRB(~WiD-EZ+HOgT4`6} z*t-6F@+Vq#A{J;DSDoR*XM9IvW5zJPRs0vx(_ z6k!t)?3p+`MTTQzFJkSWv^V%O!rlTqet_8tkX)K$H)c%?kJzyvdj=3D+FTY^hF1pn&! z-iD6P$b$JL$0iZUZJ#maII>_r+t4H1_t+auVkaU+(Iq=3DcRXC3u68X_NE<*0-<@8|Bi~LD7~TQNo$>O@-}a-2tta z_|Hf$g+ynGr3OPCQfb~Bt0v4>DlXgztMZTF@zhZwKM{`JdeF$KC0ixd0bxKkMKoV=3Dypx16{^u#jpq2a6U;94 z@TxzkOj`z5aN2e#5d{<3mW`+7u$)g!SCUF8{~b(-KE-T5)mI$igTgRCY>vLdW`6Vi z8NDZmec4&1itk0#ya!2ui_bTq?vV)&*_vngrtM9O6{A=3DMn<-v^o{E=3DXv1~sc6C3FxF-d-A-`BcUrKwiM;Hf2adS1(}S-Mg#G#u$iG4EEAcw)v2(~7--6NS5Wp1*M(nyq_oVAa}vk{>MRH;G+~NK&&_vW1@}SC+2~RC$Ck){A+1P7V38f z-9EBS^x|rQ#*4g?(_}>|a4Ih=3Dg2I9G4y^bS5>#~MFF+T(hB%=3Dp$wiq*ET?iDI_dTY zr*EkA4c)Q8-_Xf##UlT;D8VkuPBP(xEzzgo1<5P6QW7!MDmtmHY!^v6jeF!_=3D*eD2 z`!0#XDwJ2ya!pc9S<{<$JA z2}Kd4!F>hkDXM(Rpl|0Kz2^LtrJbS;Qx_s-O6;m^uf`zC)QgPvGW$WUD5ZzFs^YP& zdn~3z0oi*@rc{$acUfZSo(HbECBE<>(s@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dgNhOdUeTkEzAGseW9p(hv&&lIpX?K^8qortkdbkvMDg|DO%t#HGA}bCW z_bx{FE>44*BE4V0roP+eisw!oE3RZ=3DhZopMnq|SiVWvNfd>Z(`*T3wO430qwqn*djrrOwe+ mDD@b;3J2bfuRaTZ1F-fXwZmAY%pPP#SN{j-!1$7dSO5UxPbkm; literal 0 HcmV?d00001 diff --git a/tests/test_tags.py b/tests/test_tags.py index 38ded37..73f0c18 100755 --- a/tests/test_tags.py +++ b/tests/test_tags.py @@ -127,6 +127,24 @@ class ImportTest(PatchewTestCase): "20160628014747.20971-3-famz@redhat.com", ) =20 + def test_supersedes_embedded(self): + self.cli_login() + self.cli_import("0031-supersedes-embedded.mbox.gz") + self.cli_logout() + self.do_test_obsoleted_by( + "20200110173215.3865-1-quintela@redhat.com", + "20200114092606.1761-1-quintela@redhat.com", + ) + + def test_supersedes_separate(self): + self.cli_login() + self.cli_import("0032-supersedes-separate.mbox.gz") + self.cli_logout() + self.do_test_obsoleted_by( + "20191128104129.250206-1-slp@redhat.com", + "20200108143138.129909-1-slp@redhat.com", + ) + =20 if __name__ =3D=3D "__main__": main() --=20 2.21.0 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel