From nobody Sat Dec 21 13:22:26 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=patchew-devel-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1645604805; cv=none; d=zohomail.com; s=zohoarc; b=myZQF/jeCSdjt0DOuBNrcuJtHrXKyqqA1hyAhx2kuUFcq3gk1PYhgdlF6U/2vxoxq+Nkp4KO/vzSHxsukV0fKhQHozzdqTks+xWFCLa6sF+WHztrDhy/vHsRxfUIqKeOxG5jUzRQ7AeKrvb+VYLW3f7nRHCQ9JzJHpNMYCFZ3G4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1645604805; 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=PL41Rg/02XROj5SRHLwU4rvBJg4W00wtTVNvKcgO1wc=; b=efZBsmYXXWjBZBrsQnzZxZL9VNL2s2ShtYC/ByNKuaTBkFtzwZOmeukvX1qGFKEYE227P0R7Zon36QeuGZ8FAoHLbHj4jk9EMtpycAtdPBNn214lwY93YFgqpJZI3F2A3UCM6LPslp8eQWpSWfLECl1fSo+ISGFem/qnN0EdTMM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1645604805915190.08081026156958; Wed, 23 Feb 2022 00:26:45 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-584-y7lKdu_yNpWTMCK81bo2LQ-1; Wed, 23 Feb 2022 03:26:41 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B9413805741; Wed, 23 Feb 2022 08:26:40 +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 B0E197FCE9; Wed, 23 Feb 2022 08:26:40 +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 760674BB40; Wed, 23 Feb 2022 08:26:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 21N8Qcgb027993 for ; Wed, 23 Feb 2022 03:26:38 -0500 Received: by smtp.corp.redhat.com (Postfix) id 3956F40E80ED; Wed, 23 Feb 2022 08:26:38 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 352C340E80EC for ; Wed, 23 Feb 2022 08:26:38 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1C4B7802E5C for ; Wed, 23 Feb 2022 08:26:38 +0000 (UTC) Received: from mail-ed1-f52.google.com (mail-ed1-f52.google.com [209.85.208.52]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-22-fWqRS5PgOCOL6p9nAU04lg-1; Wed, 23 Feb 2022 03:26:36 -0500 Received: by mail-ed1-f52.google.com with SMTP id z22so42910327edd.1 for ; Wed, 23 Feb 2022 00:26:36 -0800 (PST) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id s18sm334929eja.87.2022.02.23.00.26.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Feb 2022 00:26:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645604804; 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=PL41Rg/02XROj5SRHLwU4rvBJg4W00wtTVNvKcgO1wc=; b=SFEHBCThnz4sgwUyN8H4X1s1j1mrYdb0TTEJKGigeNi/mMIHVnaVBdpdxmtyfXmqoB9XFO eZz4gUQpMl7RrY3tGtL/xl/B8nqXHM8URG09tCw3JNawZG/M8ef+NBpOxPM6i1ekE+Tjuu Ttit8tctqeNfvkJ5GzNDtPYq+bqHNkE= X-MC-Unique: y7lKdu_yNpWTMCK81bo2LQ-1 X-MC-Unique: fWqRS5PgOCOL6p9nAU04lg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=UnR7MrJEBARNGTfuO5BJXlUS1/KgO1VdbVs3pK0i9LQ=; b=J3xjjNI4Ophxzkq0sm/1YapA6gUJt3/0vZZrNgbfwKTCGqofQ0Ce48jl8IVkj5eeHk A6poV/a6R6orKadDYJoLiXQz7mxg6/bcmXDSdetdkB+M89D8RtUwOw5lQqsoeqdaTUXB jFk684jVxyEei300enWeVeLf+skUKhHEYGov8Qkn3soXW8Xk86/WEBO9BS9shKZWqLgX Z9Ze3c830Q0JyNPv3EpWzzY1f6HP8S3BRxsC10T4xRdPzTk+B/WdiBaLR+Ti8r4NPc6k SBxb3uC+BKIBjl2ecuk5y23EGL8TjejFC07BE7upicmg5S6LQ8iFwEom2BL9X36c/Jjo i/oQ== X-Gm-Message-State: AOAM533/l+gGt4Dc3qIXLl6Y5Azk6+6IVwop6l5q04Jnx3M/4uvyQgkz yYMMTAEWqo55n4B+Rbo+Z8Gv/5JyqNQ= X-Google-Smtp-Source: ABdhPJw9vVXcu3XPd4CxT/s0hykUvxSiq5ZXE/e5J4FPfRXDcviV9drb0ceJ1nhhxfcMG3td7LxilQ== X-Received: by 2002:a50:c44b:0:b0:410:cebf:161d with SMTP id w11-20020a50c44b000000b00410cebf161dmr30144429edf.259.1645604794387; Wed, 23 Feb 2022 00:26:34 -0800 (PST) From: Paolo Bonzini To: patchew-devel@redhat.com Date: Wed, 23 Feb 2022 09:26:26 +0100 Message-Id: <20220223082631.228937-2-pbonzini@redhat.com> In-Reply-To: <20220223082631.228937-1-pbonzini@redhat.com> References: <20220223082631.228937-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 X-loop: patchew-devel@redhat.com Subject: [Patchew-devel] [PATCH 1/6] maintainer: fix typos 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.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=patchew-devel-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1645604806998100004 Content-Type: text/plain; charset="utf-8" Signed-off-by: Paolo Bonzini --- mods/maintainer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mods/maintainer.py b/mods/maintainer.py index 0084bf0..18ff6b8 100644 --- a/mods/maintainer.py +++ b/mods/maintainer.py @@ -80,7 +80,7 @@ class MaintainerModule(PatchewModule): =20 def on_series_reviewed(self, evt, series): # Handle changes to "is:reviewed" - self._update_watch_queue(obj) + self._update_watch_queue(series) =20 def on_series_merged(self, evt, project, series): # This is a bit of a hack for now. We probably should hide merged @@ -91,7 +91,7 @@ class MaintainerModule(PatchewModule): ) self._drop_all_from_queue(query) # Handle changes to "is:merged" - self._update_watch_queue(obj) + self._update_watch_queue(series) =20 def _update_review_state(self, request, message_id, accept): if not request.user.is_authenticated: --=20 2.34.1 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://listman.redhat.com/mailman/listinfo/patchew-devel From nobody Sat Dec 21 13:22:26 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=patchew-devel-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 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=1645604940; cv=none; d=zohomail.com; s=zohoarc; b=mx02Z/HVUQ23XHU63VWLCmGtkbiALx/usiVOKO/nY2iQL1vT+YiLeT1H6OVyqVfcMagjmrrFHKCPuAehNqKpxmQaRzj4xDDW4Z4Rh4/imFvgoeRIJxyXFWeSz7gCoMU6F3XWr2dYALWQINk8T0S1NQrn9wgUWB9Gjrte59j7pes= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1645604940; 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=oDLA3s2p1VqN27fI4NgFlvIjV+tuXzFgsItZXGPuGUg=; b=MbFxuIoG0i9SgNNX4F/2v1wlD3tYyEOLklUs6z3Nt+BPDdcNU3iSDwRnn4wKy59L6RIy4+mPpea+dsDuils+w+0n8s1f2wmFZps/uxcrNNEl9TBR8ekX54ZCHW5iXT4VV+6c/Wx0WFNKhhyUoFsbRxImD5GYjAAU9QW4qvfImUA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1645604940711729.9221208380268; Wed, 23 Feb 2022 00:29:00 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-217-PEuI8CxzMiazVsEg8rOtdA-1; Wed, 23 Feb 2022 03:28:57 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B1A7C1854E2A; Wed, 23 Feb 2022 08:28:56 +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 A8BDC1053B0D; Wed, 23 Feb 2022 08:28:56 +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 9E75F1809C98; Wed, 23 Feb 2022 08:28:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 21N8Qcah027989 for ; Wed, 23 Feb 2022 03:26:38 -0500 Received: by smtp.corp.redhat.com (Postfix) id 05AA6C202D1; Wed, 23 Feb 2022 08:26:38 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast07.extmail.prod.ext.rdu2.redhat.com [10.11.55.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 01803C202CB for ; Wed, 23 Feb 2022 08:26:37 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DD0A33C02187 for ; Wed, 23 Feb 2022 08:26:37 +0000 (UTC) Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-351-IItf3WKRMqOsrSqrMmo7tA-1; Wed, 23 Feb 2022 03:26:36 -0500 Received: by mail-ed1-f46.google.com with SMTP id x5so42828654edd.11 for ; Wed, 23 Feb 2022 00:26:36 -0800 (PST) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id s18sm334929eja.87.2022.02.23.00.26.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Feb 2022 00:26:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645604939; 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=oDLA3s2p1VqN27fI4NgFlvIjV+tuXzFgsItZXGPuGUg=; b=Pc+J2Ta8swAX7UYi81q4DbkA7cwM2bu0jLJT3f6b2n4kaq3Zg0avuXMuivajBPczNh1dzh MAmAr+mALwTJx0toGZg+S4jbjfWP5qCPaghrdkzR/MPqkp3Plo6P3ZMArNelx1z6IWm0UK yoOK0Z3H+QYqy2DBIM6ODTW4Fgu0ys0= X-MC-Unique: PEuI8CxzMiazVsEg8rOtdA-1 X-MC-Unique: IItf3WKRMqOsrSqrMmo7tA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=vYhvRXoimkgk8+OV52PlFGK1VkRo8Kw+7dyhbMEVpDM=; b=GQSlsgSe2HW+c7JXpsLR+mxo62PsMGCOzhLOl1WkGVhftRHhJn7Zrh9EfTuwcYoL2H xuSAfipwY3vgSFEn7kHRLQNZUg+FXYyTVfRsbLmmqXPFNejA4IRP59WdxIQ4X+sgF6bw k0yoruQGY77NeptGyG+puqlBddqxkdsPAWJ/fhs3B/G4CusFpLGFaI3QaDcraQrZCllK 36OngvJT1hf7xXYhURxDq/Y3AxVmFwQxb6wSvYb8hMrRlg3UpVFP1Og+RimUOdenwyVK HP4m+BRMXnWuHPgNwdYzb89YSujIunkyW5WA+n23QnKyLZ2IPkfdUYh3YnijHJjSR9FW bfog== X-Gm-Message-State: AOAM531LV8Evn15uqUt6Jo7TOu7guCDpMPasOHdrxMTzV2XV9ZHOwvu5 rVqDeiRljaLFohT2MGSAwEn8WnX7R+4= X-Google-Smtp-Source: ABdhPJywcmXGhzNHh2nhOaywJxo+innwlgBTMlF5ZMs77tW3FMvNJi/SaqjpQCfxepPNpTbXvvu2SQ== X-Received: by 2002:a05:6402:845:b0:412:ad14:863e with SMTP id b5-20020a056402084500b00412ad14863emr29303050edz.380.1645604795177; Wed, 23 Feb 2022 00:26:35 -0800 (PST) From: Paolo Bonzini To: patchew-devel@redhat.com Date: Wed, 23 Feb 2022 09:26:27 +0100 Message-Id: <20220223082631.228937-3-pbonzini@redhat.com> In-Reply-To: <20220223082631.228937-1-pbonzini@redhat.com> References: <20220223082631.228937-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 X-loop: patchew-devel@redhat.com Subject: [Patchew-devel] [PATCH 2/6] maintainer: replace MessageDropping event with MessageDropped 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.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=patchew-devel-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1645604941925100001 Content-Type: text/plain; charset="utf-8" Raise the event when search results have changed already. Signed-off-by: Paolo Bonzini --- mods/maintainer.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mods/maintainer.py b/mods/maintainer.py index 18ff6b8..24209c8 100644 --- a/mods/maintainer.py +++ b/mods/maintainer.py @@ -38,8 +38,8 @@ class MaintainerModule(PatchewModule): queue=3D"Queue that message is being added to", ) declare_event( - "MessageDropping", - message=3D"Message to be dropped", + "MessageDropped", + message=3D"Message that has been dropped", user=3D"Owner of the queue", queue=3D"Queue that message is being removed from", ) @@ -52,9 +52,10 @@ class MaintainerModule(PatchewModule): emit_event("MessageQueued", user=3Duser, message=3Dm, queue=3D= q) =20 def _drop_all_from_queue(self, query): - for q in query: - emit_event("MessageDropping", user=3Dq.user, message=3Dq.messa= ge, queue=3Dq) + events =3D [{"user": q.user, "message": q.message, "queue": q} for= q in query] query.delete() + for ev in events: + emit_event("MessageDropped", **ev) =20 def _drop_from_queue(self, user, m, queue): query =3D QueuedSeries.objects.filter( --=20 2.34.1 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://listman.redhat.com/mailman/listinfo/patchew-devel From nobody Sat Dec 21 13:22:26 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=patchew-devel-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1645604805; cv=none; d=zohomail.com; s=zohoarc; b=e1sbP0rV8tJgcylmNeexinOEgV8A/8s149Y68M+KGyutyzxMK+/VBprHrYAxT8sBhJ0btqOZ4Dgy9V4h+G048Hshh8Kqn3vaKWCA8X5YzmGF8DeUL+5931UTdLnmxRnFB1rRepg9Fftfpgrx4FJxK0tPwg0V2fIMSAMEJ1VhxyE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1645604805; 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=xn7FLuzuzP1+1CSQ3wL4gHbfIdk611oa+zxWKiqN4V4=; b=fRkZtwtcq+Ro9egS6EdXxwD6XQqPaXzkwFhN9mDuen7tJ30UVd/0y45SzIPwUdXp5aQhte7ofY3zRBQ0+8M6AZUij8uhH6+9w7bDNnkZjrVp3w96/O/CFDkW0igBm99LvXpE5ERqLp8qZOldHT5n+vJ/IZQue5F5G4V1bbyU9sE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1645604805840884.0045776341393; Wed, 23 Feb 2022 00:26:45 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-326-yusU2ZXWMpOoid3gA2x_sA-1; Wed, 23 Feb 2022 03:26:41 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B945C801AAD; Wed, 23 Feb 2022 08:26:40 +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 B0A397FCE8; Wed, 23 Feb 2022 08:26:40 +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 792F24ED28; Wed, 23 Feb 2022 08:26:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 21N8Qcqp027995 for ; Wed, 23 Feb 2022 03:26:38 -0500 Received: by smtp.corp.redhat.com (Postfix) id 4F810492D4C; Wed, 23 Feb 2022 08:26:38 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast10.extmail.prod.ext.rdu2.redhat.com [10.11.55.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4B1F8492D4A for ; Wed, 23 Feb 2022 08:26:38 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3267D1C05AEF for ; Wed, 23 Feb 2022 08:26:38 +0000 (UTC) Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-641-0Sl8rmz_MXyy_5Nt3k_svQ-2; Wed, 23 Feb 2022 03:26:36 -0500 Received: by mail-ed1-f53.google.com with SMTP id q17so43186454edd.4 for ; Wed, 23 Feb 2022 00:26:36 -0800 (PST) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id s18sm334929eja.87.2022.02.23.00.26.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Feb 2022 00:26:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645604804; 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=xn7FLuzuzP1+1CSQ3wL4gHbfIdk611oa+zxWKiqN4V4=; b=PtxTrCJRKepzQb9t9CXqhobrEdc7EG9SkMkmQibglWd57EAV2BwkSDz8FBcZH2YKKR3pWC QXXvi51i1qQ+sy+OUkOWpxVNEDyu7d9ZQ3KdtcVD6ZZaC1/Cj2XJAaIisAgPoDflYt54qy Dt6L1xJ9cb06K/8Ix2TNb/MTv1wDm/M= X-MC-Unique: yusU2ZXWMpOoid3gA2x_sA-1 X-MC-Unique: 0Sl8rmz_MXyy_5Nt3k_svQ-2 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=5H7JdPlEKBRUqs8HX50xm5T8H7G3unjx//Oilngg0Mc=; b=EpAUtjH3PbC8M4sP7sxyu+qcMeMgltce1b8vjCmzDgbk2Xcc/0WFoFK1I9ImFYMjyn rJgP1s5WidU5VeQXaffv09sawPQre12O4xDvaIHDnHyLN6GtAp3F9mSz3QTpKfpofG0w cNa4nkoTdGTI4oa2Tlp1xbPu8IoGadayfYN5RFMJRDyA6rgxgVBhAPhgYAh04P3TKHF6 pGPll2N2G3/ItuDQPbJby7+94gGpbS28W9ZZBEZ1EuVvZ+hysLpu4vTOw7SAwKq3Lakd uY5xp8gcrqxADI9umVCMwmQY306G9P52ap/VrdjwMxOSU2K7sKnCkOLPWJM5ZoSNftPr QXpA== X-Gm-Message-State: AOAM531biaHzuLP6N+T/JCvsY83zVpTpJRkszE+BTfB8com+GUPm3/Fp Ey7fD61h8vjYjnkkLJoA1BJNPehvsAo= X-Google-Smtp-Source: ABdhPJwvtRI7shDjJ1NFY3+bkmeRfrItOdRUbWeyYTWcfIxhaydPW6Gj4M8r4Se0Eep4zcycWY+zLA== X-Received: by 2002:a50:fa9a:0:b0:413:4420:518a with SMTP id w26-20020a50fa9a000000b004134420518amr530199edr.168.1645604796102; Wed, 23 Feb 2022 00:26:36 -0800 (PST) From: Paolo Bonzini To: patchew-devel@redhat.com Date: Wed, 23 Feb 2022 09:26:28 +0100 Message-Id: <20220223082631.228937-4-pbonzini@redhat.com> In-Reply-To: <20220223082631.228937-1-pbonzini@redhat.com> References: <20220223082631.228937-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 X-loop: patchew-devel@redhat.com Subject: [Patchew-devel] [PATCH 3/6] maintainer: update watch query on add/remove to other queues 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.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=patchew-devel-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1645604806991100003 Content-Type: text/plain; charset="utf-8" Signed-off-by: Paolo Bonzini --- mods/maintainer.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mods/maintainer.py b/mods/maintainer.py index 24209c8..3e4ee09 100644 --- a/mods/maintainer.py +++ b/mods/maintainer.py @@ -28,6 +28,8 @@ class MaintainerModule(PatchewModule): =20 def __init__(self): register_handler("ResultUpdate", self.on_result_update) + register_handler("MessageQueued", self.on_queue_change) + register_handler("MessageDropped", self.on_queue_change) register_handler("SeriesMerged", self.on_series_merged) register_handler("SeriesReviewed", self.on_series_reviewed) declare_event( @@ -71,6 +73,11 @@ class MaintainerModule(PatchewModule): else: self._drop_from_queue(wq.user, series, "watched") =20 + def on_queue_change(self, evt, user, message, queue): + # Handle changes to e.g. "-nack:me" + if queue !=3D "watched": + self._update_watch_queue(message) + def on_result_update(self, evt, obj, old_status, result): if not isinstance(obj, Message): return @@ -117,7 +124,7 @@ class MaintainerModule(PatchewModule): r =3D QueuedSeries.objects.filter( user=3Drequest.user, message=3Dmsg, name__in=3D["accept", "rej= ect"] ) - r.delete() + self._drop_all_from_queue(r) return HttpResponseRedirect(request.META.get("HTTP_REFERER")) =20 def _update_merge_state(self, request, message_id, is_merged): --=20 2.34.1 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://listman.redhat.com/mailman/listinfo/patchew-devel From nobody Sat Dec 21 13:22:26 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=patchew-devel-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 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=1645604804; cv=none; d=zohomail.com; s=zohoarc; b=RXttHjg8jI6G3ClloYgMh4/eAOAXIGvBOFQs3geCQq7PMvcSilecVRBITDdEiY49X0mdTbRlw3GbF/1+AxiTDJm31p3xMm02cPpoZReXpqU+phXBBmvo5Z/FRURg09KWziadChpFC/FJE0WWJe3JvesxZkLHqMgY+fo4wFUSOTA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1645604804; 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=mc3lidU3+4FCHbsjdI0fTRr5hqQ+dkHkDBWdiNFLJng=; b=UYpQFBfbGUrbq16Dav7eKHu0F6BJ3xBT9nmVcmDAhspg0Y550VfoLCvbuV7P1ED07m7wIdyXPbQyBR1XbcKtsOqmuMZoNpqgmRjDramFzzncPDlJXKnxie0lC6KEK70zJwxijVl6yUaAziK5JKzHm88QMWvoycfn2SQnCFHGgdw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1645604804696125.11605848471083; Wed, 23 Feb 2022 00:26:44 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-349-xf19b9k-NVquex8mbMmMEg-1; Wed, 23 Feb 2022 03:26:42 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 63F871006AA7; Wed, 23 Feb 2022 08:26:41 +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 5C8061053B0D; Wed, 23 Feb 2022 08:26:41 +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 511081809C98; Wed, 23 Feb 2022 08:26:41 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 21N8QeI8028012 for ; Wed, 23 Feb 2022 03:26:40 -0500 Received: by smtp.corp.redhat.com (Postfix) id 1FA605361EB; Wed, 23 Feb 2022 08:26:40 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast08.extmail.prod.ext.rdu2.redhat.com [10.11.55.24]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1BB3E5361C4 for ; Wed, 23 Feb 2022 08:26:40 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id F262B3800505 for ; Wed, 23 Feb 2022 08:26:39 +0000 (UTC) Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-152-WNnl7fhmO0udPL4M_m8tOQ-1; Wed, 23 Feb 2022 03:26:38 -0500 Received: by mail-ed1-f54.google.com with SMTP id i11so41211178eda.9 for ; Wed, 23 Feb 2022 00:26:37 -0800 (PST) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id s18sm334929eja.87.2022.02.23.00.26.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Feb 2022 00:26:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645604803; 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=mc3lidU3+4FCHbsjdI0fTRr5hqQ+dkHkDBWdiNFLJng=; b=Pzf/WA50MdIGedNx2C6/uSMPMe88IVoHOee4LGhzLyRIt7PafAtB40FSF0zQykkYjEsw7G KGpLBqFiTnvQaYfQEYrTi+DiM8RMW3vo3RhbfhWvbd0EKcQzy71U234+lWSN1OBeWU030D hi+YnswMXj1ZEg4E2O4HMllfaBiO2ZE= X-MC-Unique: xf19b9k-NVquex8mbMmMEg-1 X-MC-Unique: WNnl7fhmO0udPL4M_m8tOQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=s8BjNI+uImTyLXRfnmpTBny3MyT/d4PuOKluEBysoSs=; b=kDNJuF6WQ5GckZxj1ETVUR+1WBvXzIS1Z5sRi3MrwWM5WAxMpnrQhO8oO9Nby5r7Rf 6XafzxtfK0ZSj2L9LXZvxAQUxfY8cgLebUdq370a6in/PaBMRRkVVR75NWSH1n1IWFFF /pL4EOCvTqJYgz3j+ScnRwUeUSsQOV43Ytd4qx5TdgPano50LP38THR6kPb1j6CExyib vOqjdgrANrWuGEGuzJWzIstnO8N/WVCVbYklOvXo8Y3iV+jGOf63Ee3CcQGSZIFw9ZN6 NYXX3+n4rnz3SjPK5ELt1VlEpX9A+TITCXVNjk5hNDdoveSlkjfbhUEofIqmVMeAaqU7 qAOg== X-Gm-Message-State: AOAM531Nt7kbT7+wjdIE7TD9SuAj0Mx4QYie7kH5K4BQB+0bt1F0kH50 D/+KAZ1oIC4OHK77HmxTpOGdIvGIPGM= X-Google-Smtp-Source: ABdhPJzmLLUWn0uzFB+ZYZ8G/BdA+OqoocSLsqwq4rvch5TkRItOJLhltrkbVXP10Mufn0yMdivOkQ== X-Received: by 2002:a50:e08c:0:b0:407:cdc6:809e with SMTP id f12-20020a50e08c000000b00407cdc6809emr29864506edl.162.1645604796862; Wed, 23 Feb 2022 00:26:36 -0800 (PST) From: Paolo Bonzini To: patchew-devel@redhat.com Date: Wed, 23 Feb 2022 09:26:29 +0100 Message-Id: <20220223082631.228937-5-pbonzini@redhat.com> In-Reply-To: <20220223082631.228937-1-pbonzini@redhat.com> References: <20220223082631.228937-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 X-loop: patchew-devel@redhat.com Subject: [Patchew-devel] [PATCH 4/6] maintainer: add to watch list even if no applier is present for a project 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.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=patchew-devel-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1645604807003100005 Content-Type: text/plain; charset="utf-8" Signed-off-by: Paolo Bonzini --- mods/maintainer.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mods/maintainer.py b/mods/maintainer.py index 3e4ee09..c246d8a 100644 --- a/mods/maintainer.py +++ b/mods/maintainer.py @@ -30,6 +30,7 @@ class MaintainerModule(PatchewModule): register_handler("ResultUpdate", self.on_result_update) register_handler("MessageQueued", self.on_queue_change) register_handler("MessageDropped", self.on_queue_change) + register_handler("SeriesComplete", self.on_series_complete) register_handler("SeriesMerged", self.on_series_merged) register_handler("SeriesReviewed", self.on_series_reviewed) declare_event( @@ -86,6 +87,9 @@ class MaintainerModule(PatchewModule): # maintainers so redo the watched queue self._update_watch_queue(obj) =20 + def on_series_complete(self, evt, project, series): + self._update_watch_queue(series) + def on_series_reviewed(self, evt, series): # Handle changes to "is:reviewed" self._update_watch_queue(series) --=20 2.34.1 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://listman.redhat.com/mailman/listinfo/patchew-devel From nobody Sat Dec 21 13:22:26 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=patchew-devel-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1645604812; cv=none; d=zohomail.com; s=zohoarc; b=hXY2xkN7oR2jA35OGoCSTHj+8cqvGC5nKlURGLrPfcgaOkxzpCKO2zCJNOihINlUJJ1fbn1CgmFEjYZ4Q1WHXewny1ZGyGdQ5Mr0BaPlEc3M2L3mCqChxkzr6ZL3QWSRwYT2eo1bdMI4/pb2N7/6bzxbDxuWnZ+Hx/TlKNEu0Ps= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1645604812; 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=ZomkD645gvR/+mFEqFK1ChrYwPR8ZDyxfnWsGnRhW+Y=; b=i43+rqNT5FDW3jPHkgZWXa3/UF0oRjzFilWjbO1DaPMz0mV+l63ZnV6dF7j1PfS1jlELgBqovrq28OhErEAr6kHgj0zxyno+kaM65bYhAHyPD2EyAz20WkfebrAUdUC36YzoMjEDUp70b5vaIB+YynPLZwMXacbMEP9Ay5fHNkc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1645604812145893.0012769543449; Wed, 23 Feb 2022 00:26:52 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-368-uufQtUWtP66ZEyaEnEmQRA-1; Wed, 23 Feb 2022 03:26:42 -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 8C8ED51E0; Wed, 23 Feb 2022 08:26:41 +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 8426C8317D; Wed, 23 Feb 2022 08:26:41 +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 7CB801809CB3; Wed, 23 Feb 2022 08:26:41 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 21N8Qelp028020 for ; Wed, 23 Feb 2022 03:26:40 -0500 Received: by smtp.corp.redhat.com (Postfix) id 8EBE140E80ED; Wed, 23 Feb 2022 08:26:40 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast08.extmail.prod.ext.rdu2.redhat.com [10.11.55.24]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8AA9040E80EC for ; Wed, 23 Feb 2022 08:26:40 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 742D33800505 for ; Wed, 23 Feb 2022 08:26:40 +0000 (UTC) Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-404-FLLzM7LKMIy33jDlWGSODg-1; Wed, 23 Feb 2022 03:26:38 -0500 Received: by mail-ej1-f50.google.com with SMTP id hw13so50472378ejc.9 for ; Wed, 23 Feb 2022 00:26:38 -0800 (PST) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id s18sm334929eja.87.2022.02.23.00.26.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Feb 2022 00:26:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645604810; 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=ZomkD645gvR/+mFEqFK1ChrYwPR8ZDyxfnWsGnRhW+Y=; b=JPW/W7AKZWXyLUPoBt4DRBbq+EeMqoiy5FQmq/C7DHoZad08TO1mWpy7JbMD+ASzaCpkqL frxCSNwm6nh1f1OI9b4XPth5TangQPqHo/z0ZIK6N8F0qMetKN17T2OwHy85XPKkZY8auZ u4aeB+wsnebXML0XqBpvCddk7vUGOtw= X-MC-Unique: uufQtUWtP66ZEyaEnEmQRA-1 X-MC-Unique: FLLzM7LKMIy33jDlWGSODg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=VtVg15NAxUZePVDScth5+SAPMM+yt/s4k4m8ZdwtBi0=; b=pEgz4JpP5RktHACrwEwP3ffEg+fvSS1FERqb0VHZ3xm08wup8FdaIUPV0dcfbNj/Ci USKR/twdfSJXfV0hNjW7ov8gyNz5AJZHkDeHwyVgDHZ5HAWeyOrO4pdq/45w3JCllr+G NVy9mFMLLzEPSmT4vQXNjBQ1E87B2I3hz+KG6BfW3V23uc2NfJYhCwjKA2dr0xCIjB5D svhZSdWvogJW3g+3+slqAMspJ4Mu7lbtlS+P1ovPw+CQiQFqBNnkn0IQx5JAjwIi7JCg Kp1pSson8ojjEjWeyTB79g9vFimBZyUR0Ned6c4c9iTnDq1HBM7n/rED/UKLZ+7URT74 genA== X-Gm-Message-State: AOAM533DFVfLMiWY7eeT/D2KwWfQu0JUBj19oFvVx/E+E0ckbCJ4pWQ7 cW91G0TPMLH/7rwc4Sfz6wwtJE41tZY= X-Google-Smtp-Source: ABdhPJxTOgfmlHKUl34zVhlyGrlqeOmj6EBl85fJIcXotjDXbXH+aAQNmRFk8tlIBDvXC4qlYq161g== X-Received: by 2002:a17:906:5a94:b0:6c5:5aa4:da87 with SMTP id l20-20020a1709065a9400b006c55aa4da87mr22953074ejq.381.1645604797656; Wed, 23 Feb 2022 00:26:37 -0800 (PST) From: Paolo Bonzini To: patchew-devel@redhat.com Date: Wed, 23 Feb 2022 09:26:30 +0100 Message-Id: <20220223082631.228937-6-pbonzini@redhat.com> In-Reply-To: <20220223082631.228937-1-pbonzini@redhat.com> References: <20220223082631.228937-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 X-loop: patchew-devel@redhat.com Subject: [Patchew-devel] [PATCH 5/6] maintainer: add unit tests 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 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=patchew-devel-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1645604813045100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Paolo Bonzini --- tests/test_maintainers.py | 93 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100755 tests/test_maintainers.py diff --git a/tests/test_maintainers.py b/tests/test_maintainers.py new file mode 100755 index 0000000..91ad044 --- /dev/null +++ b/tests/test_maintainers.py @@ -0,0 +1,93 @@ +#!/usr/bin/env python3 +# +# Copyright 2022 Red Hat, Inc. +# +# Authors: +# Paolo Bonzini +# +# This work is licensed under the MIT License. Please see the LICENSE fil= e or +# http://opensource.org/licenses/MIT. + +from api.models import Message, WatchedQuery, QueuedSeries + +from .patchewtest import PatchewTestCase, main + + +class MaintainerQueueTest(PatchewTestCase): + def setUp(self): + self.testuser =3D self.create_user("test", "1234", groups=3D["impo= rter"]) + self.create_superuser() + self.cli_login() + self.add_project("QEMU", "qemu-devel@nongnu.org") + + def test_watched_query(self): + wq =3D WatchedQuery(user=3Dself.testuser, query=3D"to:qemu-block@n= ongnu.org") + wq.save() + self.cli_import("0001-simple-patch.mbox.gz") + msg =3D Message.objects.first() + query =3D QueuedSeries.objects.filter(user=3Dself.testuser, name= =3D"watched") + q =3D query.first() + assert q + assert q.message.id =3D=3D msg.id + + def test_update_watch_on_merge_change(self): + wq =3D WatchedQuery(user=3Dself.testuser, query=3D"to:qemu-block@n= ongnu.org -is:merged") + wq.save() + self.cli_import("0001-simple-patch.mbox.gz") + msg =3D Message.objects.first() + query =3D QueuedSeries.objects.filter(user=3Dself.testuser, name= =3D"watched") + q =3D query.first() + assert q + assert q.message.id =3D=3D msg.id + + msg.set_merged() + msg.save() + query =3D QueuedSeries.objects.filter(user=3Dself.testuser, name= =3D"watched") + q =3D query.first() + assert not q + + def test_update_watch_on_queue_add(self): + wq =3D WatchedQuery(user=3Dself.testuser, query=3D"to:qemu-block@n= ongnu.org -nack:test") + wq.save() + self.cli_import("0001-simple-patch.mbox.gz") + msg =3D Message.objects.first() + query =3D QueuedSeries.objects.filter(user=3Dself.testuser, name= =3D"watched") + q =3D query.first() + assert q + assert q.message.id =3D=3D msg.id + + # TODO: support and use REST API + self.client.post("/login/", {"username": "test", "password": "1234= "}) + self.client.get("/mark-as-rejected/" + msg.message_id + "/") + query =3D QueuedSeries.objects.filter(user=3Dself.testuser, name= =3D"reject") + q =3D query.first() + assert q + assert q.message.id =3D=3D msg.id + + query =3D QueuedSeries.objects.filter(user=3Dself.testuser, name= =3D"watched") + q =3D query.first() + assert not q + + def test_update_watch_on_queue_remove(self): + self.cli_import("0001-simple-patch.mbox.gz") + msg =3D Message.objects.first() + + # TODO: support and use REST API; same below + self.client.post("/login/", {"username": "test", "password": "1234= "}) + self.client.get("/mark-as-rejected/" + msg.message_id + "/") + query =3D QueuedSeries.objects.filter(user=3Dself.testuser, name= =3D"reject") + q =3D query.first() + assert q + assert q.message.id =3D=3D msg.id + + wq =3D WatchedQuery(user=3Dself.testuser, query=3D"to:qemu-block@n= ongnu.org -nack:test") + wq.save() + self.client.get("/clear-reviewed/" + msg.message_id + "/") + query =3D QueuedSeries.objects.filter(user=3Dself.testuser, name= =3D"watched") + q =3D query.first() + assert q + assert q.message.id =3D=3D msg.id + + +if __name__ =3D=3D "__main__": + main() --=20 2.34.1 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://listman.redhat.com/mailman/listinfo/patchew-devel From nobody Sat Dec 21 13:22:26 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=patchew-devel-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 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=1645604941; cv=none; d=zohomail.com; s=zohoarc; b=UG3WPiKTERqD4cgwvTHsl2KqJ1uIiw6FMkNxZHiRmUTjZqI0CnpZYrWRKnnUUGTTxxLE8uX/FeAiVyjYvF4/kfnDNC5+5JNbijMkvSfTGXkLlAwriLcZUZAKJ0yizVaFfb+9FOjDcrGjDD/rrVQ+k199CMhLNumgk0+ohFXfvP4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1645604941; 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=EWnel3KLsP4luSOj/2nOd3Co0aUAMtT0Tstt/+SXJ3Q=; b=XUSuadFCOZdRspxlACV91zXiO/BUYYwDG6gQGs2Lh3BsQDDyUD2M4Tn6NHglpZWQ4V1eH5bJioX9ohY7YGY/cA5cAwlr/s1//8cUwxzA9JA4Brnd4x5FuEeTY9U8mz7/7HJl+QYjrnPfFLQBWnpbLTWiFuVRSovINLTZKMw9FBo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1645604941717393.3770747522518; Wed, 23 Feb 2022 00:29:01 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-341-pSO7oMtgO4OKqn87idaDBQ-1; Wed, 23 Feb 2022 03:28:58 -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 5AD231091DA6; Wed, 23 Feb 2022 08:28:57 +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 51CEB6608C; Wed, 23 Feb 2022 08:28:57 +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 4A0A94ED66; Wed, 23 Feb 2022 08:28:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 21N8QieX028042 for ; Wed, 23 Feb 2022 03:26:45 -0500 Received: by smtp.corp.redhat.com (Postfix) id B9B941121339; Wed, 23 Feb 2022 08:26:44 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B43671121334 for ; Wed, 23 Feb 2022 08:26:41 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6809610AF953 for ; Wed, 23 Feb 2022 08:26:41 +0000 (UTC) Received: from mail-ed1-f52.google.com (mail-ed1-f52.google.com [209.85.208.52]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-22-T6QHAxb5P_if07PcySF2Xw-2; Wed, 23 Feb 2022 03:26:39 -0500 Received: by mail-ed1-f52.google.com with SMTP id z22so42910327edd.1 for ; Wed, 23 Feb 2022 00:26:39 -0800 (PST) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id s18sm334929eja.87.2022.02.23.00.26.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Feb 2022 00:26:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645604939; 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=EWnel3KLsP4luSOj/2nOd3Co0aUAMtT0Tstt/+SXJ3Q=; b=CHY1RCJeFxn+4QkfQ2xfFr7yaOrKg1n+B9Fe7l6rNtHQGs6vrEXcZv0e0iqyjUvXa8WHny XfhvDAnn3kKTMtRn9AWQPSRJ0z+CFcQU7/Tig8W/+OLvJfum1qaONkn4avv9Db1lgwRd9H R2UqeYgR1U85DDuUjSmzPyVRs8y8csM= X-MC-Unique: pSO7oMtgO4OKqn87idaDBQ-1 X-MC-Unique: T6QHAxb5P_if07PcySF2Xw-2 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=33oLJVFSxNqz87AN65aYXvdqWVW9MbM5z2THLhAX2xc=; b=xyukHoRUk4lTi8bJF3iYNdCEpY3o67oqAaDzCtgLZKZt0s37Ju5wiVPCEENBi0UJwC 1SuWBvGiI2czStxql/+1EbHvThivp9HeadbT2VdGIWlDgO8fYJagcfSBdK038S54CHSu T9jRa/A6xv8YF/oqPK0eHlPOudsJ27xFwEsGc8rJhzA9Mmnu9DbuoflhLl11hE1SK59R 7au87oW/3/9MqwJwGADOwoNUU3ZsegGCtdsjZ5F0jRUUt/FIyu97c4UHHz/UbyZM7RcB fq++H5vgJZURG9bFeaY5vwL9GM8r3JXGwrtuzPAknxvIBipVWbn1uqvhE1HJMJaInz0i hDUA== X-Gm-Message-State: AOAM530A74n0I8JkMTpggbLtVKcq7VULNERC/35IUVMfd1xQM2bYR814 jX/iPutGS0bFJUImSH/+yC9ns4IUTgY= X-Google-Smtp-Source: ABdhPJyEcm4jDrhtUFKhjXFA8mLSqGyf0dkKlKjTqKBXZXX63EvkOjpK9FwydpaurUVQ8VdsaD9Irg== X-Received: by 2002:a05:6402:c10:b0:40f:33cd:a39 with SMTP id co16-20020a0564020c1000b0040f33cd0a39mr30000186edb.234.1645604798390; Wed, 23 Feb 2022 00:26:38 -0800 (PST) From: Paolo Bonzini To: patchew-devel@redhat.com Date: Wed, 23 Feb 2022 09:26:31 +0100 Message-Id: <20220223082631.228937-7-pbonzini@redhat.com> In-Reply-To: <20220223082631.228937-1-pbonzini@redhat.com> References: <20220223082631.228937-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: patchew-devel@redhat.com Subject: [Patchew-devel] [PATCH 6/6] search, maintainer: allow "xxx:me" terms in watched queries 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 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=patchew-devel-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1645604943935100005 Content-Type: text/plain; charset="utf-8" Signed-off-by: Paolo Bonzini --- api/search.py | 4 ++-- mods/maintainer.py | 2 +- tests/test_maintainers.py | 22 ++++++++++++++++++++++ 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/api/search.py b/api/search.py index 08b40c3..2e43421 100644 --- a/api/search.py +++ b/api/search.py @@ -427,7 +427,7 @@ Search text keyword in the email message. Example: =20 return queryset.filter(q) =20 - def query_test_message(self, query, message): + def query_test_message(self, query, message, user=3DNone): queryset =3D Message.objects.filter(id=3Dmessage.id) terms =3D [x.strip() for x in query.split() if x.strip()] - return self.search_series(*terms, queryset=3Dqueryset).first() + return self.search_series(*terms, user=3Duser, queryset=3Dqueryset= ).first() diff --git a/mods/maintainer.py b/mods/maintainer.py index c246d8a..966eb05 100644 --- a/mods/maintainer.py +++ b/mods/maintainer.py @@ -69,7 +69,7 @@ class MaintainerModule(PatchewModule): def _update_watch_queue(self, series): se =3D SearchEngine() for wq in WatchedQuery.objects.all(): - if se.query_test_message(wq.query, series): + if se.query_test_message(wq.query, series, wq.user): self._add_to_queue(wq.user, series, "watched") else: self._drop_from_queue(wq.user, series, "watched") diff --git a/tests/test_maintainers.py b/tests/test_maintainers.py index 91ad044..5f1fcc5 100755 --- a/tests/test_maintainers.py +++ b/tests/test_maintainers.py @@ -88,6 +88,28 @@ class MaintainerQueueTest(PatchewTestCase): assert q assert q.message.id =3D=3D msg.id =20 + def test_update_watch_with_user_me(self): + wq =3D WatchedQuery(user=3Dself.testuser, query=3D"to:qemu-block@n= ongnu.org -nack:me") + wq.save() + self.cli_import("0001-simple-patch.mbox.gz") + msg =3D Message.objects.first() + query =3D QueuedSeries.objects.filter(user=3Dself.testuser, name= =3D"watched") + q =3D query.first() + assert q + assert q.message.id =3D=3D msg.id + + # TODO: support and use REST API + self.client.post("/login/", {"username": "test", "password": "1234= "}) + self.client.get("/mark-as-rejected/" + msg.message_id + "/") + query =3D QueuedSeries.objects.filter(user=3Dself.testuser, name= =3D"reject") + q =3D query.first() + assert q + assert q.message.id =3D=3D msg.id + + query =3D QueuedSeries.objects.filter(user=3Dself.testuser, name= =3D"watched") + q =3D query.first() + assert not q + =20 if __name__ =3D=3D "__main__": main() --=20 2.34.1 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://listman.redhat.com/mailman/listinfo/patchew-devel