Skip to contentSkip to conversation

checklayer: check for patch file upstream status

PATCH Superseded [email protected] 3 participants 5 messages Feb 23, 2023 – Feb 24, 2023

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 checklayer: check for patch file upstream status

From: Chee Yang Lee <[email protected]>

yocto-check-layer to check all .patch file in layer for Upstream-status and list down all .patch file without Upstream-Status. Since upstream-status is additional Yocto Compatible requirement, set this test as expected failure for now so it wont fail final result.

[YOCTO #14642]

---
 scripts/lib/checklayer/cases/common.py | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
scripts/lib/checklayer/cases/common.py +15 -0
index 722d3cf638..8fb37e175f 100644
@@ -72,6 +72,21 @@ class CommonCheckLayer(OECheckLayerTestCase):
                 self.tc.layer['name'])
             self.fail('\n'.join(msg))
 
+    @unittest.expectedFailure
+    def test_patches_upstream_status(self):
+        patches = []
+        for dirpath, dirs, files in os.walk(self.tc.layer['path']):
+            for filename in files:
+                if filename.endswith(".patch"):
+                    data = ""
+                    ppath = os.path.join(dirpath, filename)
+                    with open(ppath, 'r', encoding='utf-8', errors='ignore') as f:
+                        data = f.read()
+                    if not re.search(r'^Upstream-Status', data, flags=re.I + re.M):
+                        patches.append(ppath)
+        self.assertEqual(len(patches), 0 , \
+                msg="Layer contains patches without upstream status:\n%s" % '\n'.join([str(patch) for patch in patches]))
+
     def test_signatures(self):
         if self.tc.layer['type'] == LayerType.SOFTWARE and \
            not self.tc.test_software_layer_signatures:
Signature · 1 line
2.37.3
#1 lore raw

I don't recall the upstream-status being added as a yocto compatibility requirement. Can someone point me to a discussion that I missed ?

As everyone can recall, I wasn't on board with this being a default QA check and error, and I'm also not on board with it being a yocto compliance error.

I realize it isn't being made an error in this patch, but I wanted to raise my concerns now, before someone throws that switch.

Bruce

Quoted 54 lines · Lee Chee Yang

From: Chee Yang Lee <[email protected]>

yocto-check-layer to check all .patch file in layer for Upstream-status and list down all .patch file without Upstream-Status. Since upstream-status is additional Yocto Compatible requirement, set this test as expected failure for now so it wont fail final result.

[YOCTO #14642]

---
 scripts/lib/checklayer/cases/common.py | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
scripts/lib/checklayer/cases/common.py +15 -1
index 722d3cf638..8fb37e175f 100644
@@ -72,6 +72,21 @@ class CommonCheckLayer(OECheckLayerTestCase):
                 self.tc.layer['name'])
             self.fail('\n'.join(msg))
 
+    @unittest.expectedFailure
+    def test_patches_upstream_status(self):
+        patches = []
+        for dirpath, dirs, files in os.walk(self.tc.layer['path']):
+            for filename in files:
+                if filename.endswith(".patch"):
+                    data = ""
+                    ppath = os.path.join(dirpath, filename)
+                    with open(ppath, 'r', encoding='utf-8', errors='ignore') as f:
+                        data = f.read()
+                    if not re.search(r'^Upstream-Status', data, flags=re.I + re.M):
+                        patches.append(ppath)
+        self.assertEqual(len(patches), 0 , \
+                msg="Layer contains patches without upstream status:\n%s" % '\n'.join([str(patch) for patch in patches]))
+
     def test_signatures(self):
         if self.tc.layer['type'] == LayerType.SOFTWARE and \
            not self.tc.test_software_layer_signatures:
--

2.37.3

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#177599): https://lists.openembedded.org/g/openembedded-core/message/177599
Mute This Topic: https://lists.openembedded.org/mt/97178225/1050810
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II
#2 lore raw
Quoted 3 lines · Bruce Ashfield

I don't recall the upstream-status being added as a yocto compatibility requirement. Can someone point me to a discussion that I missed ?

It isn't a requirement at this time and there isn't any recent discussion you've missed.

The topic has come up now and again at various points, including with the YP TSC and I suspect that was why we have
https://bugzilla.yoctoproject.org/show_bug.cgi?id=14642 from back in 2021. I think the view of the YP TSC was that we probably should warn about things like this from yocto-check-layer perspective as it is a best practise we want to raise the profile of.

Quoted 6 lines

As everyone can recall, I wasn't on board with this being a default QA check and error, and I'm also not on board with it being a yocto compliance error.

I realize it isn't being made an error in this patch, but I wanted to raise my concerns now, before someone throws that switch.

Your concerns are definitely known! As I said at the time in the discussion, the TSC does intend to add some extra checks around QA issues to YP Compatible but no decision on which ones has been made yet, I think that action rests with me to make a proposal. My view is this one can remain a warning, I can't speak for the rest of the TSC. I do think having yocto-check-layer show more warnings about best practises if the direction things will move though even if it doesn't change the resulting compatibility status.

There is an intent to improve "quality" over time so I can't promise this will never become an error but I don't have any plans to push this beyond a warning. As above, I can't speak for all TSC members though.

Cheers,

Richard

#3 lore raw
Quoted 32 lines · Richard Purdie
Quoted 3 lines · Bruce Ashfield

I don't recall the upstream-status being added as a yocto compatibility requirement. Can someone point me to a discussion that I missed ?

It isn't a requirement at this time and there isn't any recent discussion you've missed.

The topic has come up now and again at various points, including with the YP TSC and I suspect that was why we have
https://bugzilla.yoctoproject.org/show_bug.cgi?id=14642 from back in 2021. I think the view of the YP TSC was that we probably should warn about things like this from yocto-check-layer perspective as it is a best practise we want to raise the profile of.

Quoted 6 lines

As everyone can recall, I wasn't on board with this being a default QA check and error, and I'm also not on board with it being a yocto compliance error.

I realize it isn't being made an error in this patch, but I wanted to raise my concerns now, before someone throws that switch.

Your concerns are definitely known! As I said at the time in the discussion, the TSC does intend to add some extra checks around QA issues to YP Compatible but no decision on which ones has been made yet, I think that action rests with me to make a proposal. My view is this one can remain a warning, I can't speak for the rest of the TSC. I do think having yocto-check-layer show more warnings about best practises if the direction things will move though even if it doesn't change the resulting compatibility status.

Quoted 4 lines

There is an intent to improve "quality" over time so I can't promise this will never become an error but I don't have any plans to push this beyond a warning. As above, I can't speak for all TSC members though.

Sounds good.

Summary: Everything is under control, and I didn't manage to zone out and miss something while battling with the latest round of golang craziness.

I've already gone through my layers and updated the formatting and put inappropriate on most of the patches (I may have missed some), so my argument isn't really an argument at this point. With the QA check being around now, and anyone being able to turn it on, patches without a status should be fairly rare.

If it did become a compatibility requirement, I'd of course make the changes and stay compatible (maybe grumbling a bit at the same time ;))

Cheers,

Bruce

Quoted 7 lines

Cheers,

Richard

Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II
#4 lore raw
In reply to Richard Purdie
Quoted 9 lines

-----Original Message-----
From: Richard Purdie <[email protected]>
Sent: Thursday, February 23, 2023 9:49 PM
To: Bruce Ashfield <[email protected]>; Lee, Chee Yang <[email protected]>
Cc: [email protected]
Subject: Re: [OE-core] [PATCH] checklayer: check for patch file upstream status

Quoted 7 lines
Quoted 3 lines · Bruce Ashfield

I don't recall the upstream-status being added as a yocto compatibility requirement. Can someone point me to a discussion that I missed ?

It isn't a requirement at this time and there isn't any recent discussion you've missed.

Sorry that I misunderstand the discussion in the bug ticket. Would update the commit message to avoid confusion.

Quoted 33 lines

The topic has come up now and again at various points, including with the YP TSC and I suspect that was why we have
https://bugzilla.yoctoproject.org/show_bug.cgi?id=14642 from back in 2021. I think the view of the YP TSC was that we probably should warn about things like this from yocto-check-layer perspective as it is a best practise we want to raise the profile of.

Quoted 6 lines

As everyone can recall, I wasn't on board with this being a default QA check and error, and I'm also not on board with it being a yocto compliance error.

I realize it isn't being made an error in this patch, but I wanted to raise my concerns now, before someone throws that switch.

Your concerns are definitely known! As I said at the time in the discussion, the TSC does intend to add some extra checks around QA issues to YP Compatible but no decision on which ones has been made yet, I think that action rests with me to make a proposal. My view is this one can remain a warning, I can't speak for the rest of the TSC. I do think having yocto-check- layer show more warnings about best practises if the direction things will move though even if it doesn't change the resulting compatibility status.

There is an intent to improve "quality" over time so I can't promise this will never become an error but I don't have any plans to push this beyond a warning. As above, I can't speak for all TSC members though.

Cheers,

Richard