Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 01/55] insane.bbclass: add a SUMMARY/HOMEPAGE check (oe-core recipes only)
@ 2023-06-14  9:28 Alexander Kanavin
  2023-06-14  9:28 ` [PATCH 02/55] insane.bbclass: add a RECIPE_MAINTAINER " Alexander Kanavin
                   ` (54 more replies)
  0 siblings, 55 replies; 70+ messages in thread
From: Alexander Kanavin @ 2023-06-14  9:28 UTC (permalink / raw)
  To: openembedded-core; +Cc: Alexander Kanavin

This was done in a selftest, but that is too late and creates
friction in integration as errors are not seen until autobuilder fails.

Bonus fix: SUMMARY check wasn't even working, as in the absence
of one set in the recipe there is a default value set from bitbake.conf.

I left DESCRIPTION check out for now, as many recipes don't actually
have it, and it's set from SUMMARY (plus a dot) if absent.

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
 meta/classes-global/insane.bbclass         | 26 ++++++++++++++++
 meta/lib/oeqa/selftest/cases/distrodata.py | 36 ----------------------
 2 files changed, 26 insertions(+), 36 deletions(-)

diff --git a/meta/classes-global/insane.bbclass b/meta/classes-global/insane.bbclass
index 8788f58fc5b..632f738c86d 100644
--- a/meta/classes-global/insane.bbclass
+++ b/meta/classes-global/insane.bbclass
@@ -34,6 +34,7 @@ WARN_QA ?= " libdir xorg-driver-abi buildpaths \
             missing-update-alternatives native-last missing-ptest \
             license-exists license-no-generic license-syntax license-format \
             license-incompatible license-file-missing obsolete-license \
+            missing-metadata \
             "
 ERROR_QA ?= "dev-so debug-deps dev-deps debug-files arch pkgconfig la \
             perms dep-cmp pkgvarcheck perm-config perm-line perm-link \
@@ -1473,6 +1474,28 @@ python do_qa_unpack() {
     unpack_check_src_uri(d.getVar('PN'), d)
 }
 
+python do_qa_fetch() {
+    def test_missing_metadata(d):
+        fn = d.getVar("FILE")
+        if not '/meta/recipes-' in fn:
+            # We are only interested in OE-Core
+            return
+        pn = d.getVar('BPN')
+        srcfile = d.getVar('SRC_URI').split()
+        # Check that SUMMARY is not the same as the default from bitbake.conf
+        if d.getVar('SUMMARY') == d.expand("${PN} version ${PV}-${PR}"):
+            oe.qa.handle_error("missing-metadata", "Recipe {} in {} does not contain a SUMMARY. Please add an entry.".format(pn, fn), d)
+        if not d.getVar('HOMEPAGE'):
+            if srcfile and srcfile[0].startswith('file') or not d.getVar('SRC_URI'):
+                # We are only interested in recipes SRC_URI fetched from external sources
+                pass
+            else:
+                oe.qa.handle_error("missing-metadata", "Recipe {} in {} does not contain a HOMEPAGE. Please add an entry.".format(pn, fn), d)
+
+    test_missing_metadata(d)
+    oe.qa.exit_if_errors(d)
+}
+
 # Check for patch fuzz
 do_patch[postfuncs] += "do_qa_patch "
 
@@ -1484,6 +1507,9 @@ do_configure[postfuncs] += "do_qa_configure "
 # Check does S exist.
 do_unpack[postfuncs] += "do_qa_unpack"
 
+# Check basic recipe metadata (e.g. SUMMARY/HOMEPAGE/RECIPE_MAINTAINER)
+do_fetch[postfuncs] += "do_qa_fetch"
+
 python () {
     import re
     
diff --git a/meta/lib/oeqa/selftest/cases/distrodata.py b/meta/lib/oeqa/selftest/cases/distrodata.py
index c83a3a7bd67..fd262fe3c9e 100644
--- a/meta/lib/oeqa/selftest/cases/distrodata.py
+++ b/meta/lib/oeqa/selftest/cases/distrodata.py
@@ -39,42 +39,6 @@ but their recipes claim otherwise by setting UPSTREAM_VERSION_UNKNOWN. Please re
 """ + "\n".join(regressed_successes)
         self.assertTrue(len(regressed_failures) == 0 and len(regressed_successes) == 0, msg)
 
-    def test_missing_homepg(self):
-        """
-        Summary:     Test for oe-core recipes that don't have a HOMEPAGE or DESCRIPTION
-        Expected:    All oe-core recipes should have a DESCRIPTION entry
-        Expected:    All oe-core recipes should have a HOMEPAGE entry except for recipes that are not fetched from external sources.
-        Product:     oe-core
-        """
-        with bb.tinfoil.Tinfoil() as tinfoil:
-            tinfoil.prepare(config_only=False)
-            no_description = []
-            no_homepage = []
-            for fn in tinfoil.all_recipe_files(variants=False):
-                if not '/meta/recipes-' in fn:
-                    # We are only interested in OE-Core
-                    continue
-                rd = tinfoil.parse_recipe_file(fn, appends=False)
-                pn = rd.getVar('BPN')
-                srcfile = rd.getVar('SRC_URI').split()
-                #Since DESCRIPTION defaults to SUMMARY if not set, we are only interested in recipes without DESCRIPTION or SUMMARY
-                if not (rd.getVar('SUMMARY') or rd.getVar('DESCRIPTION')):
-                    no_description.append((pn, fn))
-                if not rd.getVar('HOMEPAGE'):
-                    if srcfile and srcfile[0].startswith('file') or not rd.getVar('SRC_URI'):
-                        # We are only interested in recipes SRC_URI fetched from external sources
-                        continue
-                    no_homepage.append((pn, fn))
-        if no_homepage:
-            self.fail("""
-The following recipes do not have a HOMEPAGE. Please add an entry for HOMEPAGE in the recipe.
-""" + "\n".join(['%s (%s)' % i for i in no_homepage]))
-
-        if no_description:
-            self.fail("""
-The following recipes do not have a DESCRIPTION. Please add an entry for DESCRIPTION in the recipe.
-""" + "\n".join(['%s (%s)' % i for i in no_description]))
-
     def test_maintainers(self):
         """
         Summary:     Test that oe-core recipes have a maintainer and entries in maintainers list have a recipe
-- 
2.30.2



^ permalink raw reply related	[flat|nested] 70+ messages in thread

end of thread, other threads:[~2023-06-16 16:51 UTC | newest]

Thread overview: 70+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-14  9:28 [PATCH 01/55] insane.bbclass: add a SUMMARY/HOMEPAGE check (oe-core recipes only) Alexander Kanavin
2023-06-14  9:28 ` [PATCH 02/55] insane.bbclass: add a RECIPE_MAINTAINER " Alexander Kanavin
2023-06-14  9:28 ` [PATCH 03/55] apmd: remove recipe and apm MACHINE_FEATURE Alexander Kanavin
2023-06-14  9:28 ` [PATCH 04/55] qemu: a pending patch was submitted and accepted upstream Alexander Kanavin
2023-06-14  9:28 ` [PATCH 05/55] sysfsutils: fetch a supported fork from github Alexander Kanavin
2023-06-14  9:28 ` [PATCH 06/55] sysfsutils: update 2.1.0 -> 2.1.1 Alexander Kanavin
2023-06-15 15:10   ` [OE-core] " Ross Burton
2023-06-15 15:24     ` Ross Burton
2023-06-15 17:40       ` Alexander Kanavin
2023-06-14  9:28 ` [PATCH 07/55] grub: submit determinism.patch upstream Alexander Kanavin
2023-06-14  9:28 ` [PATCH 08/55] ghostscript: remove mkdir-p.patch Alexander Kanavin
2023-06-16 10:39   ` [OE-core] " Ross Burton
2023-06-14  9:28 ` [PATCH 09/55] apr: upgrade 1.7.3 -> 1.7.4 Alexander Kanavin
2023-06-14  9:28 ` [PATCH 10/55] at-spi2-core: upgrade 2.48.0 -> 2.48.3 Alexander Kanavin
2023-06-14  9:28 ` [PATCH 11/55] btrfs-tools: upgrade 6.3 -> 6.3.1 Alexander Kanavin
2023-06-14  9:28 ` [PATCH 12/55] attr: package /etc/xattr.conf with the library that consumes it Alexander Kanavin
2023-06-14  9:28 ` [PATCH 13/55] glib-2.0: backport a patch to address ptest fails caused by coreutils 9.2+ Alexander Kanavin
2023-06-15 22:26   ` [OE-core] " Alexandre Belloni
2023-06-15 22:34     ` Alexandre Belloni
2023-06-16  8:17       ` Alexander Kanavin
2023-06-14  9:28 ` [PATCH 14/55] coreutils: upgrade 9.1 -> 9.3 Alexander Kanavin
2023-06-15  8:14   ` [OE-core] " Ross Burton
2023-06-15  8:57     ` Alexander Kanavin
2023-06-14  9:28 ` [PATCH 15/55] diffoscope: upgrade 236 -> 242 Alexander Kanavin
2023-06-14  9:28 ` [PATCH 16/55] dnf: upgrade 4.14.0 -> 4.16.1 Alexander Kanavin
2023-06-14  9:28 ` [PATCH 17/55] ethtool: upgrade 6.2 -> 6.3 Alexander Kanavin
2023-06-14  9:28 ` [PATCH 18/55] gawk: upgrade 5.2.1 -> 5.2.2 Alexander Kanavin
2023-06-14  9:28 ` [PATCH 19/55] gdb: upgrade 13.1 -> 13.2 Alexander Kanavin
2023-06-14 17:12   ` [OE-core] " Khem Raj
2023-06-14  9:28 ` [PATCH 20/55] gnupg: upgrade 2.4.0 -> 2.4.2 Alexander Kanavin
2023-06-14  9:28 ` [PATCH 21/55] gobject-introspection: upgrade 1.74.0 -> 1.76.1 Alexander Kanavin
2023-06-14  9:28 ` [PATCH 22/55] kmscube: upgrade to latest revision Alexander Kanavin
2023-06-14  9:28 ` [PATCH 23/55] libmodulemd: upgrade 2.14.0 -> 2.15.0 Alexander Kanavin
2023-06-14  9:28 ` [PATCH 24/55] libuv: license file was split in two in the 1.45.0 version update Alexander Kanavin
2023-06-14  9:28 ` [PATCH 25/55] libx11: upgrade 1.8.4 -> 1.8.5 Alexander Kanavin
2023-06-14  9:28 ` [PATCH 26/55] libxcrypt: upgrade 4.4.33 -> 4.4.34 Alexander Kanavin
2023-06-14 17:11   ` [OE-core] " Khem Raj
2023-06-15  7:24     ` Alexander Kanavin
2023-06-14  9:28 ` [PATCH 27/55] libxslt: upgrade 1.1.37 -> 1.1.38 Alexander Kanavin
2023-06-14  9:28 ` [PATCH 28/55] linux-firmware: upgrade 20230404 -> 20230515 Alexander Kanavin
2023-06-14  9:28 ` [PATCH 29/55] ltp: upgrade 20230127 -> 20230516 Alexander Kanavin
2023-06-14  9:28 ` [PATCH 30/55] mesa: upgrade 23.0.3 -> 23.1.1 Alexander Kanavin
2023-06-14  9:28 ` [PATCH 31/55] meson: upgrade 1.1.0 -> 1.1.1 Alexander Kanavin
2023-06-14  9:28 ` [PATCH 32/55] mmc-utils: upgrade to latest revision Alexander Kanavin
2023-06-14  9:28 ` [PATCH 33/55] nettle: upgrade 3.8.1 -> 3.9 Alexander Kanavin
2023-06-14  9:28 ` [PATCH 34/55] nghttp2: upgrade 1.52.0 -> 1.53.0 Alexander Kanavin
2023-06-14  9:28 ` [PATCH 35/55] parted: upgrade 3.5 -> 3.6 Alexander Kanavin
2023-06-14  9:28 ` [PATCH 36/55] puzzles: upgrade to latest revision Alexander Kanavin
2023-06-14  9:29 ` [PATCH 37/55] python3: upgrade 3.11.2 -> 3.11.3 Alexander Kanavin
2023-06-14  9:29 ` [PATCH 38/55] python3-certifi: upgrade 2022.12.7 -> 2023.5.7 Alexander Kanavin
2023-06-14  9:29 ` [PATCH 39/55] python3-docutils: upgrade 0.19 -> 0.20.1 Alexander Kanavin
2023-06-14  9:29 ` [PATCH 40/55] python3-flit-core: upgrade 3.8.0 -> 3.9.0 Alexander Kanavin
2023-06-14  9:29 ` [PATCH 41/55] python3-importlib-metadata: upgrade 6.2.0 -> 6.6.0 Alexander Kanavin
2023-06-14  9:29 ` [PATCH 42/55] python3-pyasn1: upgrade 0.4.8 -> 0.5.0 Alexander Kanavin
2023-06-14  9:29 ` [PATCH 43/55] python3-pyopenssl: upgrade 23.1.1 -> 23.2.0 Alexander Kanavin
2023-06-14  9:29 ` [PATCH 44/55] python3-sphinx: remove BSD-3-Clause from LICENSE Alexander Kanavin
2023-06-14  9:29 ` [PATCH 45/55] serf: upgrade 1.3.9 -> 1.3.10 Alexander Kanavin
2023-06-14  9:29 ` [PATCH 46/55] shaderc: upgrade 2023.2 -> 2023.4 Alexander Kanavin
2023-06-14  9:29 ` [PATCH 47/55] squashfs-tools: upgrade 4.5.1 -> 4.6.1 Alexander Kanavin
2023-06-14  9:29 ` [PATCH 48/55] strace: upgrade 6.2 -> 6.3 Alexander Kanavin
2023-06-14  9:29 ` [PATCH 49/55] vala: upgrade 0.56.6 -> 0.56.8 Alexander Kanavin
2023-06-16 16:51   ` [OE-core] " Khem Raj
2023-06-14  9:29 ` [PATCH 50/55] vulkan: upgrade 1.3.243.0 -> 1.3.250.0 Alexander Kanavin
2023-06-14  9:29 ` [PATCH 51/55] wget: upgrade 1.21.3 -> 1.21.4 Alexander Kanavin
2023-06-14  9:29 ` [PATCH 52/55] wireless-regdb: upgrade 2023.02.13 -> 2023.05.03 Alexander Kanavin
2023-06-14  9:29 ` [PATCH 53/55] xf86-input-libinput: upgrade 1.2.1 -> 1.3.0 Alexander Kanavin
2023-06-14  9:29 ` [PATCH 54/55] xf86-input-mouse: upgrade 1.9.4 -> 1.9.5 Alexander Kanavin
2023-06-14  9:29 ` [PATCH 55/55] zstd: upgrade 1.5.4 -> 1.5.5 Alexander Kanavin
2023-06-14 11:33 ` [OE-core] [PATCH 01/55] insane.bbclass: add a SUMMARY/HOMEPAGE check (oe-core recipes only) Richard Purdie
2023-06-14 15:02   ` Ross Burton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox