From patchwork Fri Dec 8 21:59:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alexis_Lothor=C3=A9?= X-Patchwork-Id: 35978 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 42A07C10DCE for ; Fri, 8 Dec 2023 21:59:36 +0000 (UTC) Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by mx.groups.io with SMTP id smtpd.web10.24922.1702072771161494345 for ; Fri, 08 Dec 2023 13:59:31 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=GtsltXhG; spf=pass (domain: bootlin.com, ip: 217.70.183.200, mailfrom: alexis.lothore@bootlin.com) Received: by mail.gandi.net (Postfix) with ESMTPSA id A6BFE20004; Fri, 8 Dec 2023 21:59:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1702072769; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GFSHK39PXKGsEFlUPyOXcl96Jj1eK96KSZMLF671p7g=; b=GtsltXhGOqlHvKnbGgnf6i7MlpKdo8CyR8s59dNohwLoVCdb3SROU9ieWMqDSvaMT4kvH9 U9Ec29Jbg1OSskKsgmetzbbm5D2AmsVSxnX4yHjPsIq7IaL7Up5eTqBTrh0aUpPjhrV38L 5mz3uGEynEdV5sMqyGC+LRezf4H4+c2ZNLj0L6DFOkpMug+2J4fd72cARt68CAmmoEZniJ wdyytwNo2zoZiIDkMr4nn/i9Hu6Yc6axdof7pJblZ5RF4LM5WCPusMt6f1J3/VK/uxYKmy P5jWIJkCi0P7zCoToII4XoI+/H302ct2/s/sPyakWwZ8gPLgxVqzD6KXeTLj3Q== From: =?utf-8?q?Alexis_Lothor=C3=A9?= To: Cc: Thomas Petazzoni , Alexandre Belloni Subject: [yocto-autobuilder-helper][mickledore][PATCH 1/3] scripts/utils.py: replace BUILD_HISTORY_DIRECTPUSH with hardcoded condition Date: Fri, 8 Dec 2023 22:59:13 +0100 Message-ID: <20231208215915.225182-2-alexis.lothore@bootlin.com> X-Mailer: git-send-email 2.42.1 In-Reply-To: <20231208215915.225182-1-alexis.lothore@bootlin.com> References: <20231208215915.225182-1-alexis.lothore@bootlin.com> MIME-Version: 1.0 X-GND-Sasl: alexis.lothore@bootlin.com List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 08 Dec 2023 21:59:36 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto/message/61846 From: Alexis Lothoré It has been observed that when a new release branch is created, it is quite easy to forget to update the BUILD_HISTORY_DIRECTPUSH variable, which leads to failures in autobuilder like test results not being pushed. Replace the BUILD_HISTORY_DIRECTPUSH usage with a hardcoded condition which validates any branch in poky representing a "main" branch, i.e all branches not ending in "-next" Signed-off-by: Alexis Lothoré Signed-off-by: Richard Purdie --- scripts/utils.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/scripts/utils.py b/scripts/utils.py index 444b3ab55092..36b3e81bfc94 100644 --- a/scripts/utils.py +++ b/scripts/utils.py @@ -19,6 +19,15 @@ import fnmatch import glob import fcntl + +def is_a_main_branch(reponame, branchname): + """ + Checks if target repo/branch combo represent a main branch. This + includes master and release branches in poky, while excluding "next" + branches + """ + return reponame == "poky" and not branchname.endswith("-next") + # # Check if config contains all the listed params # @@ -212,7 +221,7 @@ def getbuildhistoryconfig(ourconfig, builddir, target, reponame, branchname, ste reponame = reponame.rsplit("/", 1)[1] if reponame.endswith(".git"): reponame = reponame[:-4] - if (reponame + ":" + branchname) in getconfig("BUILD_HISTORY_DIRECTPUSH", ourconfig): + if is_a_main_branch(reponame, branchname): base = reponame + ":" + branchname if (reponame + ":" + branchname) in getconfig("BUILD_HISTORY_FORKPUSH", ourconfig): base = getconfig("BUILD_HISTORY_FORKPUSH", ourconfig)[reponame + ":" + branchname] @@ -392,7 +401,7 @@ def getcomparisonbranch(ourconfig, reponame, branchname): comparerepo, comparebranch = base.split(":") print("Comparing to %s\n" % (comparebranch)) return branchname, comparebranch - if (reponame + ":" + branchname) in getconfig("BUILD_HISTORY_DIRECTPUSH", ourconfig): + if is_a_main_branch(reponame, branchname): return branchname, None return None, None From patchwork Fri Dec 8 21:59:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alexis_Lothor=C3=A9?= X-Patchwork-Id: 35977 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2E2CEC10F04 for ; Fri, 8 Dec 2023 21:59:36 +0000 (UTC) Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by mx.groups.io with SMTP id smtpd.web11.24565.1702072771964082046 for ; Fri, 08 Dec 2023 13:59:32 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=YFW1ftL8; spf=pass (domain: bootlin.com, ip: 217.70.183.200, mailfrom: alexis.lothore@bootlin.com) Received: by mail.gandi.net (Postfix) with ESMTPSA id 72E4A20002; Fri, 8 Dec 2023 21:59:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1702072770; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=seR6HGyly1hhqdzi9/zTRi401UKx5lPrjePFOEFA9sA=; b=YFW1ftL8YMOVgTA3zn0Jhf1zqZi/JFaPMKQm4VppV+8cy2RThbnIutxVEgdKmJUihQId9T Mkg+6W+D22bBH+apbdjL6/IxG7FJGamOrUMUXEReCUepkuBJJ+OjHyXEjLoPUWvTjoVdps wV5th2xliIwB8eDFUXPldGHhvq+J3FoG5R5PcG3LNe1OY70GJigHEiMXq4W43iO2Lu1qxg y1vFeDolcPH93SqQ0p3YH7Bfi0ugnK5iiZuzKFDe4ks3CMNix/BEQJdQhPj3BdYPcV/NE2 CT9OTSop8RC8atqUzFAKAaD56AZoDIU4I/p2jRbfB5J12XjnShwWc+CBF/Bofg== From: =?utf-8?q?Alexis_Lothor=C3=A9?= To: Cc: Thomas Petazzoni , Alexandre Belloni Subject: [yocto-autobuilder-helper][mickledore][PATCH 2/3] config.json: remove BUILD_HISTORY_DIRECTPUSH Date: Fri, 8 Dec 2023 22:59:14 +0100 Message-ID: <20231208215915.225182-3-alexis.lothore@bootlin.com> X-Mailer: git-send-email 2.42.1 In-Reply-To: <20231208215915.225182-1-alexis.lothore@bootlin.com> References: <20231208215915.225182-1-alexis.lothore@bootlin.com> MIME-Version: 1.0 X-GND-Sasl: alexis.lothore@bootlin.com List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 08 Dec 2023 21:59:36 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto/message/61847 From: Alexis Lothoré Now that BUILD_HISTORY_DIRECTPUSH has been replaced by a hardcoded condition, remove it from config.json Signed-off-by: Alexis Lothoré Signed-off-by: Richard Purdie --- config.json | 1 - 1 file changed, 1 deletion(-) diff --git a/config.json b/config.json index 1eeabc4c9015..f93ec45927ac 100644 --- a/config.json +++ b/config.json @@ -5,7 +5,6 @@ "BUILD_HISTORY_DIR" : "buildhistory", "BUILD_HISTORY_REPO" : "ssh://git@push.yoctoproject.org/poky-buildhistory", - "BUILD_HISTORY_DIRECTPUSH" : ["poky:morty", "poky:pyro", "poky:rocko", "poky:sumo", "poky:thud", "poky:warrior", "poky:zeus", "poky:dunfell", "poky:gatesgarth", "poky:hardknott", "poky:honister", "poky:kirkstone", "poky:langdale", "poky:master"], "BUILD_HISTORY_FORKPUSH" : {"poky-contrib:ross/mut" : "poky:master", "poky-contrib:abelloni/master-next": "poky:master", "poky:master-next" : "poky:master"}, "BUILDTOOLS_URL_TEMPLOCAL" : "/srv/autobuilder/autobuilder.yocto.io/pub/non-release/20210214-8/buildtools/x86_64-buildtools-extended-nativesdk-standalone-3.2+snapshot-7d38cc8e749aedb8435ee71847e04b353cca541d.sh", From patchwork Fri Dec 8 21:59:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alexis_Lothor=C3=A9?= X-Patchwork-Id: 35976 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2D5BFC46CC5 for ; Fri, 8 Dec 2023 21:59:36 +0000 (UTC) Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by mx.groups.io with SMTP id smtpd.web11.24566.1702072772641186723 for ; Fri, 08 Dec 2023 13:59:33 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=nRs1iVC3; spf=pass (domain: bootlin.com, ip: 217.70.183.200, mailfrom: alexis.lothore@bootlin.com) Received: by mail.gandi.net (Postfix) with ESMTPSA id 28A7E20005; Fri, 8 Dec 2023 21:59:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1702072771; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3oy+Ly9wcCW1aaeixssH3thP+w+6tfq0odakzm0Wy6U=; b=nRs1iVC34YKJlGxcOHi9d1L+w4Z8+JnlVBmslLv8rkzvx8tgwBcL8cn5gqgZTeDPX3AJDH AxN7cINFXdsKNR0NiY1KMXRhbjYiD/rClWb4TV1/Mj6OfpQ3N2P267QhSnXusBrsTBHoUa qEKwIYG4csdFwURsfGQm7JFV7QUmnjqiUJrnuh/DffqU2EYfKAYCFYQURdBlUW/0zznTCm 62M8usdIM72GB+kQfT5totiUG5MKWekjlqDUzZ7s8R4FSauI3izLa98BxQnUpjHoDIIfD9 Gn6lzQ1rS9p0WYLqMV+jt/I74SSqCopItJvhXYbYEVv+AkcmD4ted9qru1664w== From: =?utf-8?q?Alexis_Lothor=C3=A9?= To: Cc: Thomas Petazzoni , Alexandre Belloni Subject: [yocto-autobuilder-helper][mickledore][PATCH 3/3] scripts/test_utils.py: update test after BUILD_HISTORY_DIRECTPUSH removal Date: Fri, 8 Dec 2023 22:59:15 +0100 Message-ID: <20231208215915.225182-4-alexis.lothore@bootlin.com> X-Mailer: git-send-email 2.42.1 In-Reply-To: <20231208215915.225182-1-alexis.lothore@bootlin.com> References: <20231208215915.225182-1-alexis.lothore@bootlin.com> MIME-Version: 1.0 X-GND-Sasl: alexis.lothore@bootlin.com List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 08 Dec 2023 21:59:36 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto/message/61848 From: Alexis Lothoré Update getcomparisonbranch unit tests by removing BUILD_HISTORY_DIRECTPUSH entry in fake configuration Signed-off-by: Alexis Lothoré Signed-off-by: Richard Purdie --- scripts/test_utils.py | 29 +++++++---------------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/scripts/test_utils.py b/scripts/test_utils.py index d02e9b2a5bb3..d149dc946ccd 100755 --- a/scripts/test_utils.py +++ b/scripts/test_utils.py @@ -7,22 +7,7 @@ import utils class TestGetComparisonBranch(unittest.TestCase): TEST_CONFIG = { - "BUILD_HISTORY_DIRECTPUSH": [ - "poky:morty", - "poky:pyro", - "poky:rocko", - "poky:sumo", - "poky:thud", - "poky:warrior", - "poky:zeus", - "poky:dunfell", - "poky:gatesgarth", - "poky:hardknott", - "poky:honister", - "poky:kirkstone", - "poky:langdale", - "poky:master" - ], "BUILD_HISTORY_FORKPUSH": { + "BUILD_HISTORY_FORKPUSH": { "poky-contrib:ross/mut": "poky:master", "poky:master-next": "poky:master", "poky-contrib:abelloni/master-next": "poky:master" @@ -35,9 +20,9 @@ class TestGetComparisonBranch(unittest.TestCase): basebranch, comparebranch = utils.getcomparisonbranch( self.TEST_CONFIG, repo, branch) self.assertEqual( - basebranch, "master", msg="Repo/branch pair present in BUILD_HISTORY_DIRECTPUSH must return corresponding base branch") + basebranch, "master", msg="Release branch in poky must return corresponding base branch") self.assertEqual( - comparebranch, None, msg="Repo/branch pair present in BUILD_HISTORY_DIRECTPUSH must return corresponding compare branch") + comparebranch, None, msg="Release branch in poky must return corresponding compare branch") def test_release_kirkstone(self): repo = "ssh://git@push.yoctoproject.org/poky" @@ -45,9 +30,9 @@ class TestGetComparisonBranch(unittest.TestCase): basebranch, comparebranch = utils.getcomparisonbranch( self.TEST_CONFIG, repo, branch) self.assertEqual(basebranch, "kirkstone", - msg="Repo/branch pair present in BUILD_HISTORY_DIRECTPUSH must return corresponding base branch") + msg="Release branch in poky must return corresponding base branch") self.assertEqual( - comparebranch, None, msg="Repo/branch pair present in BUILD_HISTORY_DIRECTPUSH must return corresponding compare branch") + comparebranch, None, msg="Release branch in poky must return corresponding compare branch") def test_release_langdale(self): repo = "ssh://git@push.yoctoproject.org/poky" @@ -55,9 +40,9 @@ class TestGetComparisonBranch(unittest.TestCase): basebranch, comparebranch = utils.getcomparisonbranch( self.TEST_CONFIG, repo, branch) self.assertEqual(basebranch, "langdale", - msg="Repo/branch pair present in BUILD_HISTORY_DIRECTPUSH must return corresponding base branch") + msg="Release branch in poky must return corresponding base branch") self.assertEqual( - comparebranch, None, msg="Repo/branch pair present in BUILD_HISTORY_DIRECTPUSH must return corresponding compare branch") + comparebranch, None, msg="Release branch in poky must return corresponding compare branch") def test_master_next(self): repo = "ssh://git@push.yoctoproject.org/poky"