From nobody Tue May 13 19:42:36 2025 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; dkim=fail; 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 153460144919042.63412837715123; Sat, 18 Aug 2018 07:10:49 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 0C87A81DF1; Sat, 18 Aug 2018 14:10:48 +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 EF6772A168; Sat, 18 Aug 2018 14:10:47 +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 E33FE180613A; Sat, 18 Aug 2018 14:10:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7IEAki9020445 for ; Sat, 18 Aug 2018 10:10:46 -0400 Received: by smtp.corp.redhat.com (Postfix) id 11272308BDA3; Sat, 18 Aug 2018 14:10:46 +0000 (UTC) Received: from mx1.redhat.com (ext-mx05.extmail.prod.ext.phx2.redhat.com [10.5.110.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 07402308BDA2 for ; Sat, 18 Aug 2018 14:10:45 +0000 (UTC) Received: from mail-wm0-f46.google.com (mail-wm0-f46.google.com [74.125.82.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 94EDA461CD for ; Sat, 18 Aug 2018 14:10:44 +0000 (UTC) Received: by mail-wm0-f46.google.com with SMTP id q8-v6so9815578wmq.4 for ; Sat, 18 Aug 2018 07:10:44 -0700 (PDT) Received: from donizetti.lan (dynamic-adsl-78-12-184-244.clienti.tiscali.it. [78.12.184.244]) by smtp.gmail.com with ESMTPSA id g2-v6sm13874652wrd.71.2018.08.18.07.10.42 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 18 Aug 2018 07:10:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=/f/qOregyE5wKBzEPMXHE9OnzUacRSOFN5cQz3bgjjI=; b=Aa0pd0PmIzoh7GowLoOAgq2JwM26yJG3wF0qIegpWef890irjQeERF6MMS4lmOnAfp iMKthrfON4PErRo4cwIftQgXqeyU0IVNSCi4FzlUAapzKGLfCWJx5haVsK4+NaWsmplI PZ5xi7dXPzEgJJLaAtuJ7LAYvRe+Qzu2sR40BW+Yy+HXX7it+nxlh75IofTHWRhNxVJK +OKzIEwIyBvZZwObAeu55Fn01U+qPSs8xRzlKM/t3J+j2ADY268HLBmWKimX9O2LBL3u ACr9+Kt/6rnI4+OVbKO+1xIQQihHsEVEBFuknNcXu65QVFnpKkYwyN9tKZv3Bm5k99Ps IMGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=/f/qOregyE5wKBzEPMXHE9OnzUacRSOFN5cQz3bgjjI=; b=WsdjojkteRf61e2IOZoWOKfI9/r39GLPBFVj4h9YVaq9Zv0M6lotk/PXWVZ5D8id3r j0J0ZdZIXibs1OKocul7U+5zNZKapofOyGKCgkjkKcUx9dQAMLwmx3uC6Il+3imOsjiI L3xCK03f5Q3qJgQ6B5Xy1mG6XrLTT1sRfm4ueXzQnlBzRSNFWKFmoEyUgkBZHoykC1gp 185CjEqanPXCDKxEPSWd+LheI0oETiiDjMqu//i79BfkjbUtrdDQGlkaKT6z6XqCiTf5 LA/y1J1l4DXaxYFEPuSMV5GYpJ92VHv6SnXOqUxc0qRKNghnOX+H5U9iHU7HA+954Gwh 9gWw== X-Gm-Message-State: AOUpUlFd4mJ/di+eDbQZjPSNh8TJWaOJln0mFdn6KlkpaPp/QLLOHiBJ SV7Msvw/p5z/u+vxsurW92ke00UD X-Google-Smtp-Source: AA+uWPzT38kAlbaq+o3RXNO+lgO5fGSomXsD6rWiTgdkib1akHp11AO5Iwdq4IYLU6URobP+Z97i/A== X-Received: by 2002:a1c:1f10:: with SMTP id f16-v6mr22464096wmf.112.1534601443023; Sat, 18 Aug 2018 07:10:43 -0700 (PDT) From: Paolo Bonzini To: patchew-devel@redhat.com Date: Sat, 18 Aug 2018 16:10:32 +0200 Message-Id: <20180818141033.29752-9-pbonzini@redhat.com> In-Reply-To: <20180818141033.29752-1-pbonzini@redhat.com> References: <20180818141033.29752-1-pbonzini@redhat.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Sat, 18 Aug 2018 14:10:44 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Sat, 18 Aug 2018 14:10:44 +0000 (UTC) for IP:'74.125.82.46' DOMAIN:'mail-wm0-f46.google.com' HELO:'mail-wm0-f46.google.com' FROM:'paolo.bonzini@gmail.com' RCPT:'' X-RedHat-Spam-Score: -0.028 (DKIM_SIGNED, DKIM_VALID, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_PASS) 74.125.82.46 mail-wm0-f46.google.com 74.125.82.46 mail-wm0-f46.google.com X-RedHat-Possible-Forgery: Paolo Bonzini X-Scanned-By: MIMEDefang 2.78 on 10.5.110.29 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.24 X-loop: patchew-devel@redhat.com Subject: [Patchew-devel] [PATCH 8/9] rest: add testing capabilities to the projects 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.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Sat, 18 Aug 2018 14:10:48 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDMRC_0 RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Paolo Bonzini --- api/rest.py | 7 +++++++ mods/testing.py | 8 +++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/api/rest.py b/api/rest.py index 22d7c98..4132e38 100644 --- a/api/rest.py +++ b/api/rest.py @@ -173,6 +173,13 @@ class ProjectSerializer(serializers.HyperlinkedModelSe= rializer): series =3D HyperlinkedIdentityField(view_name=3D'series-list', lookup_= field=3D'pk', lookup_url_kwarg=3D'projects_pk') =20 + def get_fields(self): + fields =3D super(ProjectSerializer, self).get_fields() + request =3D self.context['request'] + dispatch_module_hook("rest_project_fields_hook", request=3Drequest, + fields=3Dfields) + return fields + class ProjectsViewSet(viewsets.ModelViewSet): queryset =3D Project.objects.all().order_by('id') serializer_class =3D ProjectSerializer diff --git a/mods/testing.py b/mods/testing.py index 98216d4..e68ab11 100644 --- a/mods/testing.py +++ b/mods/testing.py @@ -20,7 +20,7 @@ import math from api.views import APILoginRequiredView from api.models import (Message, MessageProperty, MessageResult, Project, ProjectResult, Result) -from api.rest import reverse_detail +from api.rest import PluginMethodField, reverse_detail from api.search import SearchEngine from event import emit_event, declare_event, register_handler from patchew.logviewer import LogView @@ -385,6 +385,12 @@ class TestingModule(PatchewModule): ret[name] =3D v return ret =20 + def get_testing_probes(self, project, request, format): + return self.get_capability_probes(project) + + def rest_project_fields_hook(self, request, fields): + fields['testing_probes'] =3D PluginMethodField(obj=3Dself) + def tester_check_in(self, project, tester): assert project assert tester --=20 2.17.1 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel