From 3e61f40f36d2aebcef0eaa0e64361c60bb561f46 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Wed, 5 Mar 2025 10:12:25 +0000 Subject: [PATCH] bitbake: toaster: Add script to compare toaster fixtures to project release data We need to validate the toaster fixtures information against our current release data to ensure it is correct when we release. Add a script we can use to do this which the autobuilder can run to validate things. [YOCTO #15516] (Bitbake rev: 5b2d79ed505bbfa2fb2d355935e75199b7f2c37e) Signed-off-by: Richard Purdie --- .../toaster/orm/fixtures/check_fixtures.py | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 bitbake/lib/toaster/orm/fixtures/check_fixtures.py diff --git a/bitbake/lib/toaster/orm/fixtures/check_fixtures.py b/bitbake/lib/toaster/orm/fixtures/check_fixtures.py new file mode 100755 index 0000000000..ae3722e0f6 --- /dev/null +++ b/bitbake/lib/toaster/orm/fixtures/check_fixtures.py @@ -0,0 +1,38 @@ +#!/usr/bin/env python3 +# +# Copyright (C) 2025 Linux Foundation +# SPDX-License-Identifier: GPL-2.0-only +# + +import json +import urllib.request + +import gen_fixtures as fixtures + +RELEASE_URL = "https://dashboard.yoctoproject.org/releases.json" + +with urllib.request.urlopen(RELEASE_URL) as response: + if response.getcode() == 200: + data = response.read().decode("utf-8") + releases = json.loads(data) + else: + print("Couldn't access %s: %s" % (RELEASE_URL, reponse.getcode())) + exit(1) + + +# grab the recent release branches and add master, so we can ignore old branches +active_releases = [ + e["release_codename"].lower() for e in releases if e["series"] == "current" +] +active_releases.append("master") +active_releases.append("head") + +fixtures_releases = [x[0].lower() for x in fixtures.current_releases] + +if set(active_releases) != set(fixtures_releases): + print("WARNING: Active releases don't match toaster configured releases, the difference is: %s" % set(active_releases).difference(set(fixtures_releases))) + print("Active releases: %s" % sorted(active_releases)) + print("Toaster configured releases: %s" % sorted(fixtures_releases)) +else: + print("Success, configuration matches") +