]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
patchreview: use check_upstream_status() from oe.qa
authorMartin Jansa <Martin.Jansa@gmail.com>
Wed, 15 Feb 2023 15:59:58 +0000 (16:59 +0100)
committerMartin Jansa <martin.jansa@gmail.com>
Wed, 6 Aug 2025 06:17:14 +0000 (08:17 +0200)
* the idea was to reuse the same function as I've noticed that the
  QA check which was added to insane.bbclass in:
  https://git.openembedded.org/openembedded-core/commit/?id=76a685bfcf927593eac67157762a53259089ea8a
  is in some cases more strcit than scripts/contrib/patchreview.py

  To be honest I wasn't aware of scripts/contrib/patchreview.py
  existence when I've asked about moving check_upstream_status()
  to oe.qa in order to write standalone script just like
  patchreview.py, now I don't feel strongly about sharing this
  functionality (other than adjusting regexes in patchreview.py)

* it finds one "new" issue in oe-core:
  Malformed Upstream-Status 'Malformed Upstream-Status in patch
  meta/recipes-support/libssh2/files/0001-Don-t-let-host-enviroment-to-decide-if-a-test-is-bui.patch
  Please correct according to https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines#Patch_Header_Recommendations:_Upstream-Status :
  Upstream-Status: Inappropriate[oe specific]' (meta/recipes-support/libssh2/files/0001-Don-t-let-host-enviroment-to-decide-if-a-test-is-bui.patch)

* but unlike the QA check patchreview.py will report this:
  -Upstream-Status: Submitted [https://github.com/madler/zlib/pull/599]
  +Upstream-Broken-Status: Submitted [https://github.com/madler/zlib/pull/599]

  as a missing Upstream-Status instead of malformed as reported by QA check:

  ERROR: zlib-native-1.2.13-r0 do_patch: QA Issue: Malformed Upstream-Status in patch
  /OE/build/oe-core/openembedded-core/meta/recipes-core/zlib/zlib/0001-configure-Pass-LDFLAGS-to-link-tests.patch
  Please correct according to https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines#Patch_Header_Recommendations:_Upstream-Status :
  Upstream-Broken-Status: Submitted [https://github.com/madler/zlib/pull/599] [patch-status-core]

* RFC: let me know if you think it's worth re-working this to better
  integrate (e.g. detecting Upstream-Broken-Status and not repeating
  .patch path in patchreview.py output) or if I should just adjust
  regexes in patchreview.py.

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
scripts/contrib/patchreview.py

index bceae06561c48c87a6911a76a3314d7e8800ee05..162511f3f06aa289f06c53e21b53716d116b5370 100755 (executable)
@@ -50,6 +50,9 @@ def blame_patch(patch):
                                     "--", patch)).decode("utf-8").splitlines()
 
 def patchreview(patches):
+    import sys
+    sys.path.append(os.path.join(sys.path[0], '../../meta/lib'))
+    import oe.qa
 
     # General pattern: start of line, optional whitespace, tag with optional
     # hyphen or spaces, maybe a colon, some whitespace, then the value, all case
@@ -78,12 +81,11 @@ def patchreview(patches):
         else:
             result.missing_sob = True
 
-
         # Find the Upstream-Status tag
         match = status_re.search(content)
         if match:
-            value = match.group(1)
-            if value != "Upstream-Status:":
+            value = oe.qa.check_upstream_status(patch)
+            if value:
                 result.malformed_upstream_status = value
 
             value = match.group(2).lower()