From patchwork Tue Jan 25 16:59:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 2928 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8A96EC4332F for ; Tue, 25 Jan 2022 16:59:49 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.1.1643129988199538730 for ; Tue, 25 Jan 2022 08:59:48 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id F3AEBD6E for ; Tue, 25 Jan 2022 08:59:46 -0800 (PST) Received: from oss-tx204.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9E9C93F766 for ; Tue, 25 Jan 2022 08:59:46 -0800 (PST) From: Ross Burton To: meta-arm@lists.yoctoproject.org Subject: [PATCH 1/4] scripts/machine-summary: remove obsolete is_old test Date: Tue, 25 Jan 2022 16:59:33 +0000 Message-Id: <20220125165936.1456059-1-ross.burton@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 25 Jan 2022 16:59:49 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arm/message/2910 This test isn't used any more, so remove it. Signed-off-by: Ross Burton --- scripts/machine-summary.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/scripts/machine-summary.py b/scripts/machine-summary.py index 1f98f247..5e66cc1b 100755 --- a/scripts/machine-summary.py +++ b/scripts/machine-summary.py @@ -154,12 +154,6 @@ class Format: trim_blocks=True, lstrip_blocks=True ) - def is_old(version, upstream): - if "+git" in version: - # strip +git and see if this is a post-release snapshot - version = version.replace("+git", "") - return version != upstream - env.tests["old"] = is_old return env.get_template(name) From patchwork Tue Jan 25 16:59:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 2926 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88387C433EF for ; Tue, 25 Jan 2022 16:59:49 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web12.2.1643129988198619699 for ; Tue, 25 Jan 2022 08:59:48 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 867621063 for ; Tue, 25 Jan 2022 08:59:47 -0800 (PST) Received: from oss-tx204.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 321EB3F766 for ; Tue, 25 Jan 2022 08:59:47 -0800 (PST) From: Ross Burton To: meta-arm@lists.yoctoproject.org Subject: [PATCH 2/4] scripts/machine-summary: don't mark denied patches as good Date: Tue, 25 Jan 2022 16:59:34 +0000 Message-Id: <20220125165936.1456059-2-ross.burton@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220125165936.1456059-1-ross.burton@arm.com> References: <20220125165936.1456059-1-ross.burton@arm.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 25 Jan 2022 16:59:49 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arm/message/2909 A patch in denied state isn't good, it's bad. Signed-off-by: Ross Burton --- scripts/report-details.html.jinja | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/report-details.html.jinja b/scripts/report-details.html.jinja index ba66fcf0..19ede510 100644 --- a/scripts/report-details.html.jinja +++ b/scripts/report-details.html.jinja @@ -6,9 +6,9 @@ {% set status = status.split()[0] %} {% if status in ("Unknown", "Pending") %} {% set class = "is-danger" %} - {% elif status in ("Backport", "Accepted", "Inappropriate") %} + {% elif status in ("Backport", "Accepted", "Inappropriate", "Denied") %} {% set class = "is-success" %} - {% elif status in ("Submitted", "Denied") %} + {% elif status in ("Submitted",) %} {% set class = "is-info" %} {% else %} {% set class = "is-info" %} From patchwork Tue Jan 25 16:59:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 2929 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7170EC433F5 for ; Tue, 25 Jan 2022 16:59:49 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web08.1.1643129988533728540 for ; Tue, 25 Jan 2022 08:59:48 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1987611FB for ; Tue, 25 Jan 2022 08:59:48 -0800 (PST) Received: from oss-tx204.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B92C53F766 for ; Tue, 25 Jan 2022 08:59:47 -0800 (PST) From: Ross Burton To: meta-arm@lists.yoctoproject.org Subject: [PATCH 3/4] scripts/machine-summary: remove default Format.render() Date: Tue, 25 Jan 2022 16:59:35 +0000 Message-Id: <20220125165936.1456059-3-ross.burton@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220125165936.1456059-1-ross.burton@arm.com> References: <20220125165936.1456059-1-ross.burton@arm.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 25 Jan 2022 16:59:49 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arm/message/2911 There's no shared code anymore, so move the code to TextOverview. Signed-off-by: Ross Burton --- scripts/machine-summary.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/machine-summary.py b/scripts/machine-summary.py index 5e66cc1b..0849c579 100755 --- a/scripts/machine-summary.py +++ b/scripts/machine-summary.py @@ -142,9 +142,7 @@ class Format: return cls.registry[name]() def render(self, context, output: pathlib.Path): - # Default implementation for convenience - with open(output, "wt") as f: - f.write(self.get_template(f"machine-summary-{self.name}.jinja").render(context)) + pass def get_template(self, name): template_dir = os.path.dirname(os.path.abspath(__file__)) @@ -160,6 +158,10 @@ class Format: class TextOverview(Format): name = "overview.txt" + def render(self, context, output: pathlib.Path): + with open(output, "wt") as f: + f.write(self.get_template(f"machine-summary-overview.txt.jinja").render(context)) + class HtmlUpdates(Format): name = "report" From patchwork Tue Jan 25 16:59:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 2927 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5023AC43217 for ; Tue, 25 Jan 2022 16:59:50 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web09.6.1643129989304576553 for ; Tue, 25 Jan 2022 08:59:49 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A0A341063 for ; Tue, 25 Jan 2022 08:59:48 -0800 (PST) Received: from oss-tx204.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4C4E43F766 for ; Tue, 25 Jan 2022 08:59:48 -0800 (PST) From: Ross Burton To: meta-arm@lists.yoctoproject.org Subject: [PATCH 4/4] scripts/machine-summary: show patch count in the overview Date: Tue, 25 Jan 2022 16:59:36 +0000 Message-Id: <20220125165936.1456059-4-ross.burton@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220125165936.1456059-1-ross.burton@arm.com> References: <20220125165936.1456059-1-ross.burton@arm.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 25 Jan 2022 16:59:50 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arm/message/2912 Instead of simply adding a tag saying "Patched", include the patch count and make a judgement call on whether the patches are "safe" or not. For example, patches which are entirely backports or inappropriate are "safe", pending and denied patches are not. Signed-off-by: Ross Burton --- scripts/machine-summary.py | 11 +++++++++++ scripts/report-index.html.jinja | 8 +++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/scripts/machine-summary.py b/scripts/machine-summary.py index 0849c579..4888a007 100755 --- a/scripts/machine-summary.py +++ b/scripts/machine-summary.py @@ -24,6 +24,12 @@ def needs_update(version, upstream): version = version.replace("+git", "") return version != upstream +def safe_patches(patches): + for info in patches: + if info["status"] in ("Denied", "Pending", "Unknown"): + return False + return True + def layer_path(layername, d): """ Return the path to the specified layer, or None if the layer isn't present. @@ -100,6 +106,7 @@ def harvest_data(machines, recipes): details["fullversion"] = d.getVar("PV") details["patches"] = [extract_patch_info(p, d) for p in oe.patch.src_patches(d)] details["patched"] = bool(details["patches"]) + details["patches_safe"] = safe_patches(details["patches"]) # Now backfill the upstream versions for machine in versions: @@ -148,11 +155,15 @@ class Format: template_dir = os.path.dirname(os.path.abspath(__file__)) env = jinja2.Environment( loader=jinja2.FileSystemLoader(template_dir), + extensions=['jinja2.ext.i18n'], autoescape=jinja2.select_autoescape(), trim_blocks=True, lstrip_blocks=True ) + # We only need i18n for plurals + env.install_null_translations() + return env.get_template(name) class TextOverview(Format): diff --git a/scripts/report-index.html.jinja b/scripts/report-index.html.jinja index 3e39174f..44537581 100644 --- a/scripts/report-index.html.jinja +++ b/scripts/report-index.html.jinja @@ -26,7 +26,13 @@ {% if details.patches or details.needs_update %}
{% if details.patches %} - Patched + + {% trans count=details.patches|length %} + {{ count }} Patch + {% pluralize %} + {{ count }} Patches + {% endtrans %} + {% endif %} {% if details.needs_update %} Upgrade