diff mbox series

[yocto-autobuilder-helper] scripts: Add bitbake-setup repo filtering for migration

Message ID 20250926164724.30475-1-richard.purdie@linuxfoundation.org
State New
Headers show
Series [yocto-autobuilder-helper] scripts: Add bitbake-setup repo filtering for migration | expand

Commit Message

Richard Purdie Sept. 26, 2025, 4:47 p.m. UTC
In order to allow bitbake-setup builds to co-exist with older poky ones,
we need to add the bitbake repository to the layers present in the builds.

For older branches, add a workaround to filter the layerinfo.json file so
the right information is presented in older builds but newer ones can
work for bitbake-setup too.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 scripts/prepare-shared-repos | 2 ++
 scripts/send_qa_email.py     | 2 ++
 scripts/shared-repo-unpack   | 2 ++
 scripts/utils.py             | 8 ++++++++
 4 files changed, 14 insertions(+)
diff mbox series

Patch

diff --git a/scripts/prepare-shared-repos b/scripts/prepare-shared-repos
index 3d10af4..a510a4f 100755
--- a/scripts/prepare-shared-repos
+++ b/scripts/prepare-shared-repos
@@ -38,6 +38,8 @@  ourconfig = utils.loadconfig()
 with open(args.repojson) as f:
     repos = json.load(f)
 
+utils.filterrepojson(repos)
+
 stashdir = utils.getconfig("REPO_STASH_DIR", ourconfig)
 
 with tempfile.TemporaryDirectory(prefix="shared-repo-temp-", dir="/home/pokybuild/tmp") as tempdir:
diff --git a/scripts/send_qa_email.py b/scripts/send_qa_email.py
index 9e539a0..7ab9f3c 100755
--- a/scripts/send_qa_email.py
+++ b/scripts/send_qa_email.py
@@ -131,6 +131,8 @@  def send_qa_email():
     with open(args.repojson) as f:
         repos = json.load(f)
 
+    utils.filterrepojson(repos)
+
     resulttool = os.path.dirname(args.repojson) + "/build/scripts/resulttool"
     querytool = os.path.dirname(args.repojson) + "/build/scripts/yocto_testresults_query.py"
 
diff --git a/scripts/shared-repo-unpack b/scripts/shared-repo-unpack
index 8e7ec95..be47eec 100755
--- a/scripts/shared-repo-unpack
+++ b/scripts/shared-repo-unpack
@@ -49,6 +49,8 @@  needrepos = utils.getconfigvar("NEEDREPOS", ourconfig, args.target, None)
 with open(args.repojson) as f:
     repos = json.load(f)
 
+utils.filterrepojson(repos)
+
 targetsubdir = args.abworkdir + "/repos"
 needrepos_baseddirs = [r.split('/')[0] for r in needrepos]
 for repo in sorted(repos.keys()):
diff --git a/scripts/utils.py b/scripts/utils.py
index 2902dfa..6a0302a 100644
--- a/scripts/utils.py
+++ b/scripts/utils.py
@@ -297,6 +297,14 @@  def publishrepo(clonedir, repo, publishdir):
     mkdir(publishdir)
     subprocess.check_call("rsync -av " + archive_name + "* " + publishdir, shell=True, cwd=sharedrepo)
 
+# The repo json needs to be filtered to allow builds with and without bitbake-setup
+def filterrepojson(data):
+    # If bitbake and poky are present, we should use poky and ignore bitbake
+    # If oecore is there, it is a-full or a-quick so don't do that
+    if "bitbake" in data and "poky" in data and "oecore" not in data:
+        del data["bitbake"]
+    return
+
 def mkdir(path):
     try:
         os.makedirs(path)