From nobody Sun Dec 22 14:33:08 2024 Delivered-To: importer2@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 ARC-Seal: i=1; a=rsa-sha256; t=1556795894; cv=none; d=zoho.com; s=zohoarc; b=htc2JLivrhRw6GXSeywmKt9u04Ob+skx8R4118oHPrGfs9pGHTS8Y2JJAGDzo0iFl45zu5Y/gW73JvveBzarXFebiWFiKJGGG4WznuoaDtbhMA2XmW596SNLeOd4r9SVJq9xYSVDx3DPNqsYqhzeSgc1QnQYjZLvixYCbgelly4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1556795894; 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:ARC-Authentication-Results; bh=oyolDaF+q2KM/yExffTQdbQ6xHJ4kdn1AgEEJ2PprMw=; b=jaXOSwA1IcQuifBKXC+eb/WNaCzH70g1iFgDkWVB9rxwUwLoWhwCVwun0xl1TwEbJnOWM7vA7v1JCOe7OzH8msGr32kR8s0IMoN8blj0A+5ARPZe9SHwu7LN/hOGqsHlg4fD39NXuCPU1133SNCOJlmVLuBCJhModERahHJ8eig= ARC-Authentication-Results: i=1; mx.zoho.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 header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1556795894168347.79759825334645; Thu, 2 May 2019 04:18:14 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E33D789C3F; Thu, 2 May 2019 11:18:12 +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 D71555DA34; Thu, 2 May 2019 11:18:12 +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 C35CC41F3D; Thu, 2 May 2019 11:18:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x42BIAoF008922 for ; Thu, 2 May 2019 07:18:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id A1B8AA21E; Thu, 2 May 2019 11:18:10 +0000 (UTC) Received: from mx1.redhat.com (ext-mx08.extmail.prod.ext.phx2.redhat.com [10.5.110.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9D123A21B for ; Thu, 2 May 2019 11:18:08 +0000 (UTC) Received: from mail-ot1-f41.google.com (mail-ot1-f41.google.com [209.85.210.41]) (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 97481C0568FE for ; Thu, 2 May 2019 11:18:07 +0000 (UTC) Received: by mail-ot1-f41.google.com with SMTP id n15so1703223ota.1 for ; Thu, 02 May 2019 04:18:07 -0700 (PDT) Received: from localhost.localdomain ([198.59.53.9]) by smtp.gmail.com with ESMTPSA id o1sm19095697otj.11.2019.05.02.04.18.05 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 02 May 2019 04:18:06 -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 :mime-version:content-transfer-encoding; bh=E7OUZAlStmscyfnzU7qa3wk3Cy1Bv2o4MV/bZE6QElU=; b=rYagTHB0dITjSawIFwGaGYEdK4kha+UxTfpwc35ZrEWk2fye2Mv5yD+255r1pWiPKl 5a9uxJ4OTI2VJlPPG8n+ak256hAHqDIHbUDXoR00HHvH/1a5VrnJC8o4cNQct0ro2Pt4 1+Ok99Ygq5B5IV2BQ8xpqV5R3TtmgLuZhHqp2reNsx9nLTmtZySzZ1xk7BzLz/5t4kY0 Vi4ESnrmFNXzlUBEBQ6yGdp5JX0bhCSl5ZaF2zqpnb7Py5oTKxiZ4LDAC7njQ6xVyuqP 0yfySkRnxYQYUQYoGuG1zZd3cz4nRcNj8n/tYpwk2XxzHYgZSxe9zmKYsUQVCCYrJiW4 Hq6Q== 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:mime-version:content-transfer-encoding; bh=E7OUZAlStmscyfnzU7qa3wk3Cy1Bv2o4MV/bZE6QElU=; b=s/YkpuhbHc5SGCdu1gQDqH8Ar5aLILyOv4+swRq2x8NeBe6AaqIVi0fiNzokfRXIsZ g9MRAMwti4169MvkpviYvf/vm1nuRH3bD+f0a1M/sgNmBAauBiEq1/vM+2Y8PaIUwMOf nUdNiOrALbb6Vlq37hw3D3okBTVpOr24S7BtgNpbujBOm0f3upauP5rbhuahxxyB2n5+ HFy5A5sYvIPMgc+LrJ/+wNjKp44BFDLLCbznGc+xAyWYgJZWKM+ZopVLhoiBkn6Xx8VJ Jp0nJ2oRec+JbliuPvKvu55tfZv42+jPXqNTxHWrrbKO3ePkxRjFhbejZPK8Njzddgye qUsg== X-Gm-Message-State: APjAAAWnwFRazD+2cJuyjYWghU+yP7jM8+6mCPsShfx1sb92NfD7DP2d mlADR5FTE9LkP0RScud+WQjjsUAfCvU= X-Google-Smtp-Source: APXvYqwBECT4WMK5ULXhIJGQSQ6XMknFgbkycOYBe0ffQcuA/jfDcjYG4Oqqz9QF4eYus23xsjAJUQ== X-Received: by 2002:a9d:37e6:: with SMTP id x93mr1994348otb.351.1556795886848; Thu, 02 May 2019 04:18:06 -0700 (PDT) From: Paolo Bonzini To: patchew-devel@redhat.com Date: Thu, 2 May 2019 05:17:49 -0600 Message-Id: <20190502111804.15843-3-pbonzini@redhat.com> In-Reply-To: <20190502111804.15843-1-pbonzini@redhat.com> References: <20190502111804.15843-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 02 May 2019 11:18:07 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 02 May 2019 11:18:07 +0000 (UTC) for IP:'209.85.210.41' DOMAIN:'mail-ot1-f41.google.com' HELO:'mail-ot1-f41.google.com' FROM:'paolo.bonzini@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.115 (DKIM_SIGNED, DKIM_VALID, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, SPF_PASS) 209.85.210.41 mail-ot1-f41.google.com 209.85.210.41 mail-ot1-f41.google.com X-RedHat-Possible-Forgery: Paolo Bonzini X-Scanned-By: MIMEDefang 2.78 on 10.5.110.32 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: patchew-devel@redhat.com Subject: [Patchew-devel] [PATCH 02/17] git: do not return properties from applier-get 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: , 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 02 May 2019 11:18:12 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Properties that are of interest to the applier are already returned directly in the applier-get reply; the applier is only using properties to retrieve tags from old servers that do not have commit 32bddb4 ("models: convert tags from property to field", 2018-10-30). It is not needed anymore, remove it to hide properties from the API. Signed-off-by: Paolo Bonzini --- api/views.py | 14 ++++---------- patchew-cli | 4 +--- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/api/views.py b/api/views.py index d323ba3..4ac5636 100644 --- a/api/views.py +++ b/api/views.py @@ -137,14 +137,6 @@ class SetProjectPropertiesView(APILoginRequiredView): po.set_property(k, v) =20 =20 -def get_properties(m): - r =3D m.get_properties() - # for compatibility with patchew-cli's applier mode - if m.tags: - r['tags'] =3D m.tags - return r - - class DeleteProjectPropertiesByPrefixView(APILoginRequiredView): name =3D "delete-project-properties-by-prefix" allowed_groups =3D ["maintainers"] @@ -161,7 +153,8 @@ def prepare_patch(p): r =3D {"subject": p.subject, "message-id": p.message_id, "mbox": p.get_mbox(), - "properties": get_properties(p) + # For backwards compatibility with old clients + "properties": {} } return r =20 @@ -181,7 +174,8 @@ def prepare_series(request, s, fields=3DNone): if want_field("patches"): r["patches"] =3D [prepare_patch(x) for x in s.get_patches()] if want_field("properties"): - r["properties"] =3D get_properties(s) + # For backwards compatibility with old clients + r["properties"] =3D {} if want_field("tags"): r["tags"] =3D s.tags if want_field("is_complete"): diff --git a/patchew-cli b/patchew-cli index efc6f13..bfff69c 100755 --- a/patchew-cli +++ b/patchew-cli @@ -681,9 +681,7 @@ class ApplyCommand(SubCommand): subprocess.check_output(["git", "log", "-n", "1", "--format=3D%b"], cwd=3Drepo)= \ .decode('utf-8').splitlines() - # old servers do not have "tags" directly in the response - for t in set(p["properties"].get("tags", []) + p.get("tags", [= ]) + \ - s["properties"].get("tags", []) + s.get("tags", [= ])): + for t in set(p.get("tags", []) + s.get("tags", [])): if t in commit_message_lines: continue filter_cmd +=3D "echo '%s';" % t --=20 2.21.0 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel