From patchwork Wed Jan 19 21:20:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 2684 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 E42DEC433F5 for ; Wed, 19 Jan 2022 21:20:54 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web09.2936.1642627253937591592 for ; Wed, 19 Jan 2022 13:20:54 -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 B50ECED1 for ; Wed, 19 Jan 2022 13:20:52 -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 5F3FA3F774 for ; Wed, 19 Jan 2022 13:20:52 -0800 (PST) From: Ross Burton To: meta-arm@lists.yoctoproject.org Subject: [PATCH 1/6] scripts/layer-overview: improve layer detection Date: Wed, 19 Jan 2022 21:20:45 +0000 Message-Id: <20220119212050.1886613-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 ; Wed, 19 Jan 2022 21:20:54 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arm/message/2872 Refactor the script somewhat, and detect whether the starting directory is a single layer, or a collection of layers. Signed-off-by: Ross Burton --- scripts/layer-overview.py | 60 ++++++++++++++++++++++++++------------- 1 file changed, 41 insertions(+), 19 deletions(-) diff --git a/scripts/layer-overview.py b/scripts/layer-overview.py index 24a9a5b6..326470e6 100755 --- a/scripts/layer-overview.py +++ b/scripts/layer-overview.py @@ -6,31 +6,24 @@ Print an overview of the layer to help writing release notes. Output includes sublayers, machines, recipes. """ +import argparse +import sys + # TODO: # - More human-readable output # - Diff mode, give two revisions and list the changes -# - Support finding no sublayers, meaning the path is a single layer - -import argparse -parser = argparse.ArgumentParser() -parser.add_argument("repository") -parser.add_argument("revision", nargs="?") -args = parser.parse_args() -if args.revision: - import gitpathlib - base = gitpathlib.GitPath(args.repository, args.revision) -else: - import pathlib - base = pathlib.Path(args.repository) +def is_layer(path): + """ + Determine if this path looks like a layer (is a directory and contains conf/layer.conf). + """ + return path.is_dir() and (path / "conf" / "layer.conf").exists() -print("Sub-Layers") -sublayers = sorted(p for p in base.glob("meta-*") if p.is_dir()) -for l in sublayers: - print(f" {l.name}") -print() -for layer in sublayers: +def print_layer(layer): + """ + Print a summary of the layer. + """ print(layer.name) machines = sorted(p for p in layer.glob("conf/machine/*.conf")) @@ -50,3 +43,32 @@ for layer in sublayers: else: print(f" {r.stem}") print() + + +parser = argparse.ArgumentParser() +parser.add_argument("repository") +parser.add_argument("revision", nargs="?") +args = parser.parse_args() + +if args.revision: + import gitpathlib + base = gitpathlib.GitPath(args.repository, args.revision) +else: + import pathlib + base = pathlib.Path(args.repository) + +if is_layer(base): + print_layer(base) +else: + sublayers = sorted(p for p in base.glob("meta-*") if is_layer(p)) + if sublayers: + print("Sub-Layers") + for l in sublayers: + print(f" {l.name}") + print() + + for layer in sublayers: + print_layer(layer) + else: + print(f"No layers found in {base}", file=sys.stderr) + sys.exit(1) From patchwork Wed Jan 19 21:20:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 2687 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 04130C433FE for ; Wed, 19 Jan 2022 21:20:55 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web09.2937.1642627253937765172 for ; Wed, 19 Jan 2022 13:20:54 -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 46165101E for ; Wed, 19 Jan 2022 13:20:53 -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 E5E9A3F774 for ; Wed, 19 Jan 2022 13:20:52 -0800 (PST) From: Ross Burton To: meta-arm@lists.yoctoproject.org Subject: [PATCH 2/6] scripts/machine-summary: harvest more patch data Date: Wed, 19 Jan 2022 21:20:46 +0000 Message-Id: <20220119212050.1886613-2-ross.burton@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220119212050.1886613-1-ross.burton@arm.com> References: <20220119212050.1886613-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 ; Wed, 19 Jan 2022 21:20:55 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arm/message/2870 Instead of just putting whether there are patches or not into the context, store the list of patches, the layer they came from, and the upstream status. Signed-off-by: Ross Burton --- scripts/machine-summary.py | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/scripts/machine-summary.py b/scripts/machine-summary.py index 7d2eb53f..e0c7870d 100755 --- a/scripts/machine-summary.py +++ b/scripts/machine-summary.py @@ -1,9 +1,10 @@ #! /usr/bin/env python3 -import os -import sys import argparse import datetime +import os +import re +import sys import jinja2 @@ -42,8 +43,28 @@ def layer_path(layername, d): return path return None +def extract_patch_info(src_uri, d): + """ + Parse the specified patch entry from a SRC_URI and return (base name, layer name, status) tuple + """ + import bb.fetch, bb.utils + + info = {} + localpath = bb.fetch.decodeurl(src_uri)[2] + info["name"] = os.path.basename(localpath) + info["layer"] = bb.utils.get_file_layer(localpath, d) + + status = "Unknown" + with open(localpath, errors="ignore") as f: + m = re.search(r"^[\t ]*Upstream[-_ ]Status:?[\t ]*(\w*)", f.read(), re.IGNORECASE | re.MULTILINE) + if m: + # TODO: validate + status = m.group(1) + info["status"] = status + return info + def harvest_data(machines, recipes): - import bb.tinfoil, bb.utils + import bb.tinfoil with bb.tinfoil.Tinfoil() as tinfoil: tinfoil.prepare(config_only=True) corepath = layer_path("core", tinfoil.config_data) @@ -83,7 +104,8 @@ def harvest_data(machines, recipes): details = versions[machine][recipe] = {} details["recipe"] = d.getVar("PN") details["version"] = trim_pv(d.getVar("PV")) - details["patched"] = bool(oe.patch.src_patches(d)) + details["patches"] = [extract_patch_info(p, d) for p in oe.patch.src_patches(d)] + details["patched"] = bool(details["patches"]) # Now backfill the upstream versions for machine in versions: From patchwork Wed Jan 19 21:20:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 2686 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 F0F82C4332F for ; Wed, 19 Jan 2022 21:20:54 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.2782.1642627254186026610 for ; Wed, 19 Jan 2022 13:20:54 -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 CCA3D1063 for ; Wed, 19 Jan 2022 13:20:53 -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 786BB3F774 for ; Wed, 19 Jan 2022 13:20:53 -0800 (PST) From: Ross Burton To: meta-arm@lists.yoctoproject.org Subject: [PATCH 3/6] scripts/machine-summary: refactor output to classes Date: Wed, 19 Jan 2022 21:20:47 +0000 Message-Id: <20220119212050.1886613-3-ross.burton@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220119212050.1886613-1-ross.burton@arm.com> References: <20220119212050.1886613-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 ; Wed, 19 Jan 2022 21:20:54 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arm/message/2871 To prepare for future expansion, refactor the output code to be delegated to Format subclasses. Signed-off-by: Ross Burton --- scripts/machine-summary.py | 75 +++++++++++++++++++++++++++----------- 1 file changed, 53 insertions(+), 22 deletions(-) diff --git a/scripts/machine-summary.py b/scripts/machine-summary.py index e0c7870d..e5161440 100755 --- a/scripts/machine-summary.py +++ b/scripts/machine-summary.py @@ -3,28 +3,12 @@ import argparse import datetime import os +import pathlib import re import sys import jinja2 -def get_template(name): - template_dir = os.path.dirname(os.path.abspath(__file__)) - env = jinja2.Environment( - loader=jinja2.FileSystemLoader(template_dir), - autoescape=jinja2.select_autoescape(), - 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(f"machine-summary-{name}.jinja") - def trim_pv(pv): """ Strip anything after +git from the PV @@ -126,19 +110,66 @@ recipes = ("virtual/kernel", "gcc-aarch64-none-elf-native", "gcc-arm-none-eabi-native") + +class Format: + """ + The name of this format + """ + name = None + """ + Registry of names to classes + """ + registry = {} + + def __init_subclass__(cls, **kwargs): + super().__init_subclass__(**kwargs) + assert cls.name + cls.registry[cls.name] = cls + + @classmethod + def get_format(cls, name): + 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)) + + def get_template(self, name): + template_dir = os.path.dirname(os.path.abspath(__file__)) + env = jinja2.Environment( + loader=jinja2.FileSystemLoader(template_dir), + autoescape=jinja2.select_autoescape(), + 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) + +class TextOverview(Format): + name = "overview.txt" + +class HtmlUpdates(Format): + name = "updates.html" + if __name__ == "__main__": parser = argparse.ArgumentParser(description="machine-summary") parser.add_argument("machines", nargs="+", help="machine names", metavar="MACHINE") - parser.add_argument("-t", "--template", required=True) - parser.add_argument("-o", "--output", required=True, type=argparse.FileType('w', encoding='UTF-8')) + parser.add_argument("-t", "--type", required=True, choices=Format.registry.keys()) + parser.add_argument("-o", "--output", type=pathlib.Path, required=True) args = parser.parse_args() - template = get_template(args.template) - context = {} # TODO: include git describe for meta-arm context["timestamp"] = str(datetime.datetime.now().strftime("%c")) context["recipes"] = sorted(recipes) context["releases"], context["data"] = harvest_data(args.machines, recipes) - args.output.write(template.render(context)) + formatter = Format.get_format(args.type) + formatter.render(context, args.output) From patchwork Wed Jan 19 21:20:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 2685 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 01F63C43219 for ; Wed, 19 Jan 2022 21:20:56 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web08.2873.1642627254708511303 for ; Wed, 19 Jan 2022 13:20:54 -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 5EE95113E for ; Wed, 19 Jan 2022 13:20:54 -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 0AAFB3F774 for ; Wed, 19 Jan 2022 13:20:53 -0800 (PST) From: Ross Burton To: meta-arm@lists.yoctoproject.org Subject: [PATCH 4/6] scripts/machine-summary: put more version information into the context Date: Wed, 19 Jan 2022 21:20:48 +0000 Message-Id: <20220119212050.1886613-4-ross.burton@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220119212050.1886613-1-ross.burton@arm.com> References: <20220119212050.1886613-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 ; Wed, 19 Jan 2022 21:20:55 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arm/message/2873 As well as storing the truncated PV, also store the original PV and whether the recipe needs updating, to avoid the templates needing to do that logic. Signed-off-by: Ross Burton --- scripts/machine-summary.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/scripts/machine-summary.py b/scripts/machine-summary.py index e5161440..2fef8491 100755 --- a/scripts/machine-summary.py +++ b/scripts/machine-summary.py @@ -15,6 +15,15 @@ def trim_pv(pv): """ return "".join(pv.partition("+git")[:2]) +def needs_update(version, upstream): + """ + Do a dumb comparison to determine if the version needs to be updated. + """ + if "+git" in version: + # strip +git and see if this is a post-release snapshot + version = version.replace("+git", "") + return version != upstream + def layer_path(layername, d): """ Return the path to the specified layer, or None if the layer isn't present. @@ -88,14 +97,16 @@ def harvest_data(machines, recipes): details = versions[machine][recipe] = {} details["recipe"] = d.getVar("PN") details["version"] = trim_pv(d.getVar("PV")) + 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"]) # Now backfill the upstream versions for machine in versions: for recipe in versions[machine]: - versions[machine][recipe]["upstream"] = upstreams[recipe] - + data = versions[machine][recipe] + data["upstream"] = upstreams[recipe] + data["needs_update"] = needs_update(data["version"], data["upstream"]) return upstreams, versions # TODO can this be inferred from the list of recipes in the layer From patchwork Wed Jan 19 21:20:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 2688 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 E8932C43217 for ; Wed, 19 Jan 2022 21:20:55 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web08.2874.1642627255393603090 for ; Wed, 19 Jan 2022 13:20:55 -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 0C3BCED1 for ; Wed, 19 Jan 2022 13:20:55 -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 915AF3F774 for ; Wed, 19 Jan 2022 13:20:54 -0800 (PST) From: Ross Burton To: meta-arm@lists.yoctoproject.org Subject: [PATCH 5/6] scripts/machine-summary: write per-machine reports with more details Date: Wed, 19 Jan 2022 21:20:49 +0000 Message-Id: <20220119212050.1886613-5-ross.burton@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220119212050.1886613-1-ross.burton@arm.com> References: <20220119212050.1886613-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 ; Wed, 19 Jan 2022 21:20:55 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arm/message/2874 Rename the updates.html format to just 'report'. This report has the existing overview as the index.html, and then per-machine files are written with the patch breakdown. Signed-off-by: Ross Burton --- scripts/machine-summary-updates.html.jinja | 47 ----------------- scripts/machine-summary.py | 21 +++++++- scripts/report-base.html.jinja | 35 +++++++++++++ scripts/report-details.html.jinja | 61 ++++++++++++++++++++++ scripts/report-index.html.jinja | 44 ++++++++++++++++ 5 files changed, 160 insertions(+), 48 deletions(-) delete mode 100644 scripts/machine-summary-updates.html.jinja create mode 100644 scripts/report-base.html.jinja create mode 100644 scripts/report-details.html.jinja create mode 100644 scripts/report-index.html.jinja diff --git a/scripts/machine-summary-updates.html.jinja b/scripts/machine-summary-updates.html.jinja deleted file mode 100644 index d3ac2ff6..00000000 --- a/scripts/machine-summary-updates.html.jinja +++ /dev/null @@ -1,47 +0,0 @@ - - - - Pending Machine Upgrades Report - - - - -
-
-

Pending Machine Upgrades Report

-

Generated at {{ timestamp }}.

-
- - - - - - {% for recipe in recipes|sort %} - - {% endfor %} - - - - {% for machine, data in data|dictsort %} - - - {% for recipe in recipes|sort %} - {% if recipe in data %} - {% set details = data[recipe] %} - {% set is_old = details.version is old(details.upstream) %} - - {% else %} - - {% endif %} - {% endfor %} - - {% endfor %} - -
Machine{{ recipe }} ({{releases[recipe]|default("?")}})
{{ machine }} - {{ details.recipe if details.recipe != recipe}} - {{ details.version }} - {{ "(patched)" if details.patched }} - -
-
- - diff --git a/scripts/machine-summary.py b/scripts/machine-summary.py index 2fef8491..1f98f247 100755 --- a/scripts/machine-summary.py +++ b/scripts/machine-summary.py @@ -167,7 +167,26 @@ class TextOverview(Format): name = "overview.txt" class HtmlUpdates(Format): - name = "updates.html" + name = "report" + + def render(self, context, output: pathlib.Path): + if output.exists() and not output.is_dir(): + print(f"{output} is not a directory", file=sys.stderr) + sys.exit(1) + + if not output.exists(): + output.mkdir(parents=True) + + with open(output / "index.html", "wt") as f: + f.write(self.get_template(f"report-index.html.jinja").render(context)) + + subcontext = context.copy() + del subcontext["data"] + for machine, subdata in context["data"].items(): + subcontext["machine"] = machine + subcontext["data"] = subdata + with open(output / f"{machine}.html", "wt") as f: + f.write(self.get_template(f"report-details.html.jinja").render(subcontext)) if __name__ == "__main__": parser = argparse.ArgumentParser(description="machine-summary") diff --git a/scripts/report-base.html.jinja b/scripts/report-base.html.jinja new file mode 100644 index 00000000..be081251 --- /dev/null +++ b/scripts/report-base.html.jinja @@ -0,0 +1,35 @@ + + + + {% block title %}{% endblock %} + + + + +
+ {# TODO use position: sticky to glue this to the top #} + + +
+ {% block content %}{% endblock %} +
+
+ +
+
+ Generated by machine-summary at {{ timestamp }}. +
+
+ + diff --git a/scripts/report-details.html.jinja b/scripts/report-details.html.jinja new file mode 100644 index 00000000..ba66fcf0 --- /dev/null +++ b/scripts/report-details.html.jinja @@ -0,0 +1,61 @@ +{% extends "report-base.html.jinja" %} +{% block title %}Recipe Report for {{ machine }}{% endblock %} + +{# Write a tag element using the Upstream-Status to determine the class. #} +{% macro make_patch_tag(status) -%} + {% set status = status.split()[0] %} + {% if status in ("Unknown", "Pending") %} + {% set class = "is-danger" %} + {% elif status in ("Backport", "Accepted", "Inappropriate") %} + {% set class = "is-success" %} + {% elif status in ("Submitted", "Denied") %} + {% set class = "is-info" %} + {% else %} + {% set class = "is-info" %} + {% endif %} + {{ status }} +{%- endmacro %} + +{% block content %} + + + {% for name, data in data|dictsort if data.needs_update or data.patched %} +

+ {{ data.recipe }} {{ data.fullversion }} + {% if name != data.recipe %} + (provides {{ name }}) + {% endif %} + {% if data.needs_update %}Upgrade Needed{% endif %} + # +

+ + {% if data.needs_update %} +

+ Recipe is version {{ data.fullversion }}, latest upstream release is {{ data.upstream }}. +

+ {% endif%} + + {% if data.patched %} + + + + + + + + + + {% for pinfo in data.patches %} + + + + + + + + {% endfor %} + +
PatchLayerStatus
{{ pinfo.name }}{{ pinfo.layer }}{{ make_patch_tag(pinfo.status)}}
+ {% endif %} + {% endfor %} +{% endblock %} diff --git a/scripts/report-index.html.jinja b/scripts/report-index.html.jinja new file mode 100644 index 00000000..3e39174f --- /dev/null +++ b/scripts/report-index.html.jinja @@ -0,0 +1,44 @@ +{% extends "report-base.html.jinja" %} +{% block title %}Recipe Report{% endblock %} + +{% block content %} + + + + + {% for recipe in recipes|sort %} + + {% endfor %} + + + + {% for machine, data in data|dictsort %} + + + {% for recipe in recipes|sort %} + {% if recipe in data %} + {% set details = data[recipe] %} + + {% else %} + + {% endif %} + {% endfor %} + + {% endfor %} + +
Machine{{ recipe }} ({{releases[recipe]|default("?")}})
{{ machine }} + + {{ details.recipe if details.recipe != recipe}} + {{ details.version }} + + {% if details.patches or details.needs_update %} +
+ {% if details.patches %} + Patched + {% endif %} + {% if details.needs_update %} + Upgrade + {% endif %} + {% endif %} +
-
+{% endblock %} From patchwork Wed Jan 19 21:20:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 2689 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 03AF3C433F5 for ; Wed, 19 Jan 2022 21:20:57 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web09.2938.1642627256072070614 for ; Wed, 19 Jan 2022 13:20:56 -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 92AF7101E for ; Wed, 19 Jan 2022 13:20:55 -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 3E7803F774 for ; Wed, 19 Jan 2022 13:20:55 -0800 (PST) From: Ross Burton To: meta-arm@lists.yoctoproject.org Subject: [PATCH 6/6] CI: update for changes to machine-summary Date: Wed, 19 Jan 2022 21:20:50 +0000 Message-Id: <20220119212050.1886613-6-ross.burton@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220119212050.1886613-1-ross.burton@arm.com> References: <20220119212050.1886613-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 ; Wed, 19 Jan 2022 21:20:57 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arm/message/2875 Signed-off-by: Ross Burton --- .gitlab-ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bec61400..266e0868 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -86,9 +86,11 @@ pending-updates: extends: .setup artifacts: paths: - - update-report.html + - update-report script: - - kas shell ci/qemuarm64.yml:ci/meta-openembedded.yml -c "$CI_PROJECT_DIR/scripts/machine-summary.py -t updates.html -o $CI_PROJECT_DIR/update-report.html $($CI_PROJECT_DIR/ci/listmachines.py meta-arm meta-arm-bsp)" + - rm -fr update-report + - kas shell ci/qemuarm64.yml:ci/meta-openembedded.yml --command \ + "$CI_PROJECT_DIR/scripts/machine-summary.py -t report -o $CI_PROJECT_DIR/update-report $($CI_PROJECT_DIR/ci/listmachines.py meta-arm meta-arm-bsp)" # Do this on x86 whilst the compilers are x86-only tags: - x86_64