From nobody Fri Mar 29 15:04:53 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=patchew-devel-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1540949960951978.0603075717835; Tue, 30 Oct 2018 18:39:20 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id A476676201; Wed, 31 Oct 2018 01:39: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 952F060BE2; Wed, 31 Oct 2018 01:39: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 897E04CA94; Wed, 31 Oct 2018 01:39:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w9V1ObOO011230 for ; Tue, 30 Oct 2018 21:24:37 -0400 Received: by smtp.corp.redhat.com (Postfix) id 92FB12A2E4; Wed, 31 Oct 2018 01:24:37 +0000 (UTC) Received: from magic.redhat.com (ovpn-12-37.pek2.redhat.com [10.72.12.37]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5AF475D969 for ; Wed, 31 Oct 2018 01:24:36 +0000 (UTC) From: Fam Zheng To: patchew-devel@redhat.com Date: Wed, 31 Oct 2018 09:24:27 +0800 Message-Id: <20181031012429.25415-2-famz@redhat.com> In-Reply-To: <20181031012429.25415-1-famz@redhat.com> References: <20181031012429.25415-1-famz@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: patchew-devel@redhat.com Subject: [Patchew-devel] [PATCH 1/3] testing: Fix assert failure about git result 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 31 Oct 2018 01:39:19 +0000 (UTC) Content-Type: text/plain; charset="utf-8" We hit this when a series is partially tested but git result status is updated to "failure" (for example a new "Based-on:" tag arrvied: File "/home/fzheng/work/patchew/venv/lib64/python3.6/site-packages/django= /views/generic/base.py", line 88, in dispatch return handler(request, *args, **kwargs) File "/home/fzheng/work/patchew/api/views.py", line 46, in post r =3D self.handle(request, **params) File "/home/fzheng/work/patchew/mods/testing.py", line 476, in handle candidate =3D self._find_series_test(request, po, tester, capabilities) File "/home/fzheng/work/patchew/mods/testing.py", line 466, in _find_seri= es_test td =3D self._generate_series_test_data(request, s, r, test) File "/home/fzheng/work/patchew/mods/testing.py", line 406, in _generate_= series_test_data assert gr.is_success() This may be considered a DB consistency issue because git reset should ideally clear testing status, but crashing is harmful anyway, so add a check in the query. Signed-off-by: Fam Zheng --- mods/testing.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mods/testing.py b/mods/testing.py index f3e8cb5..2d0ed0f 100644 --- a/mods/testing.py +++ b/mods/testing.py @@ -446,6 +446,8 @@ class TestingGetView(APILoginRequiredView): name__startswith=3D'testing.').order_by('statu= s', 'last_update') tests =3D _instance.get_tests(po) for r in q: + if isinstance(r, MessageResult) and not r.message.git_result.i= s_success(): + continue tn =3D _instance.get_test_name(r) t =3D tests.get(tn, None) # Shouldn't happen, but let's protect against it --=20 2.17.2 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel From nobody Fri Mar 29 15:04:53 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=patchew-devel-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1540949961013353.9535278491219; Tue, 30 Oct 2018 18:39:21 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id B821630820DC; Wed, 31 Oct 2018 01:39:19 +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 A775B5D75C; Wed, 31 Oct 2018 01:39: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 9B5811808841; Wed, 31 Oct 2018 01:39:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w9V1OdS7011240 for ; Tue, 30 Oct 2018 21:24:39 -0400 Received: by smtp.corp.redhat.com (Postfix) id 429CE5D969; Wed, 31 Oct 2018 01:24:39 +0000 (UTC) Received: from magic.redhat.com (ovpn-12-37.pek2.redhat.com [10.72.12.37]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4741A61B88 for ; Wed, 31 Oct 2018 01:24:38 +0000 (UTC) From: Fam Zheng To: patchew-devel@redhat.com Date: Wed, 31 Oct 2018 09:24:28 +0800 Message-Id: <20181031012429.25415-3-famz@redhat.com> In-Reply-To: <20181031012429.25415-1-famz@redhat.com> References: <20181031012429.25415-1-famz@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: patchew-devel@redhat.com Subject: [Patchew-devel] [PATCH 2/3] testing: Recalculate pending tests after disabling 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: patchew-devel-bounces@redhat.com Errors-To: patchew-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Wed, 31 Oct 2018 01:39:19 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Fam Zheng --- mods/testing.py | 6 ++++++ tests/test_testing.py | 19 +++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/mods/testing.py b/mods/testing.py index 2d0ed0f..44e8822 100644 --- a/mods/testing.py +++ b/mods/testing.py @@ -453,6 +453,12 @@ class TestingGetView(APILoginRequiredView): # Shouldn't happen, but let's protect against it if not t: continue + if not t.get("enabled"): + if isinstance(r, MessageResult): + _instance.recalc_pending_tests(r.message) + else: + _instance.recalc_pending_tests(r.project) + continue reqs =3D t.get("requirements", "") for req in [x.strip() for x in reqs.split(",") if x]: if req not in capabilities: diff --git a/tests/test_testing.py b/tests/test_testing.py index c9452a4..6e960f1 100755 --- a/tests/test_testing.py +++ b/tests/test_testing.py @@ -348,6 +348,25 @@ class TestingResetTest(PatchewTestCase): "testing.c": Result.PENDING}) self.assertFalse(msg.get_property("testing.done")) =20 +class TestingDisableTest(PatchewTestCase): + + def setUp(self): + self.create_superuser() + + self.repo =3D self.create_git_repo("repo") + + self.p1 =3D self.add_project("QEMU", "qemu-devel@nongnu.org") + create_test(self.p1, "a") + + def test_disable_test(self): + self.cli_login() + self.cli_import('0013-foo-patch.mbox.gz') + self.do_apply() + self.p1.set_property("testing.tests.a.enabled", False) + out, err =3D self.check_cli(["tester", "-p", "QEMU", "--no-wait"]) + self.assertNotIn("Project: QEMU\n", out) + self.cli_logout() + # do not run tests on the abstract class del TestingTestCase =20 --=20 2.17.2 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel From nobody Fri Mar 29 15:04:53 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=patchew-devel-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 154094987364426.010477845619562; Tue, 30 Oct 2018 18:37:53 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 5C9A93084259; Wed, 31 Oct 2018 01:37:52 +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 4D08C5D75C; Wed, 31 Oct 2018 01:37:52 +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 3BA371808841; Wed, 31 Oct 2018 01:37:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w9V1OeHX011252 for ; Tue, 30 Oct 2018 21:24:40 -0400 Received: by smtp.corp.redhat.com (Postfix) id BD2075D969; Wed, 31 Oct 2018 01:24:40 +0000 (UTC) Received: from magic.redhat.com (ovpn-12-37.pek2.redhat.com [10.72.12.37]) by smtp.corp.redhat.com (Postfix) with ESMTP id C9A5F5E7CD for ; Wed, 31 Oct 2018 01:24:39 +0000 (UTC) From: Fam Zheng To: patchew-devel@redhat.com Date: Wed, 31 Oct 2018 09:24:29 +0800 Message-Id: <20181031012429.25415-4-famz@redhat.com> In-Reply-To: <20181031012429.25415-1-famz@redhat.com> References: <20181031012429.25415-1-famz@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: patchew-devel@redhat.com Subject: [Patchew-devel] [PATCH 3/3] Rework map entry delete 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: patchew-devel-bounces@redhat.com Errors-To: patchew-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Wed, 31 Oct 2018 01:37:52 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Stale data of "testing.tests.FOO.users" in testing has prevented deleting from working. Use a prefix based approach to do delete to make it more robust. Signed-off-by: Fam Zheng --- api/views.py | 11 +++++++++++ mod.py | 10 ++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/api/views.py b/api/views.py index f224a63..615ff97 100644 --- a/api/views.py +++ b/api/views.py @@ -158,6 +158,17 @@ def get_properties(m): r['tags'] =3D m.tags return r =20 +class DeleteProjectPropertiesByPrefixView(APILoginRequiredView): + name =3D "delete-project-properties-by-prefix" + allowed_groups =3D ["maintainers"] + + def handle(self, request, project, prefix): + po =3D Project.objects.get(name=3Dproject) + if not po.maintained_by(request.user): + raise PermissionDenied("Access denied to this project") + for k in [x for x in po.get_properties().keys() if x.startswith(pr= efix)]: + po.set_property(k, None) + def prepare_patch(p): r =3D {"subject": p.subject, "message-id": p.message_id, diff --git a/mod.py b/mod.py index 90880ea..8d48772 100644 --- a/mod.py +++ b/mod.py @@ -317,6 +317,7 @@ TMPL_MAP_ITEM =3D """
{{ item_schema.title }} {{ item.name }} +
{{ item.html }} @@ -447,19 +448,16 @@ function map_add_item(btn) { } function map_delete_item(btn) { name =3D $(btn).parent().parent().parent().find("#item-name").html(); + prefix =3D $(btn).parent().parent().parent().find("#prefix").val(); if (!window.confirm("Really delete '" + name +"'?")) { return; } - props =3D collect_properties(btn, false); - for (var k in props) { - props[k] =3D null; - } $(btn).addClass("disabled"); $(btn).text("Deleting..."); $(btn).parent().find(".delete-message").remove(); - patchew_api_do("set-project-properties", + patchew_api_do("delete-project-properties-by-prefix", { project: "{{ project.name }}", - properties: props }) + prefix: prefix }) .done(function (data) { container =3D $(btn).parent().parent().parent(); container.remove(); --=20 2.17.2 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel