From patchwork Mon Jun 26 08:05:58 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: 26399 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 8A959EB64DA for ; Mon, 26 Jun 2023 08:05:42 +0000 (UTC) Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by mx.groups.io with SMTP id smtpd.web10.2968.1687766739019175651 for ; Mon, 26 Jun 2023 01:05:39 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=euIFI9Xn; spf=pass (domain: bootlin.com, ip: 217.70.183.197, mailfrom: alexis.lothore@bootlin.com) X-GND-Sasl: alexis.lothore@bootlin.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1687766737; 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=wBXZ+sofh/rxamRCCj5myE3gf0FiT93UJNw3F/hzR10=; b=euIFI9Xn6JjkAkVkIiNTn2LdebuJ4iTz7xJ/5HfQV3Ir+Clp1GG4UyyELK+uimjvyCHpHv 6LgwCC+4zwluodhw6jQumNaMFj99PtlnuZ6iIoHztEVbcmMhpHrHlTpGPZTUGRYtn9EBau MbYSFnZUMgz7bV0NjKXBMz98sco/qT0ffpoBLMI4zFY2rWrch6ZTlpBQ0CAAxHAPl+j66t 2ekABISQoj0aWQd9urV5oVC5+aG/v+b0ARfOLkdekmniMLNIXpgqHAgyT9ELnkGBnvQbi8 zsgkQrn/Y5RJmjwyFOS7fWZr9DMu2meKwEUZ1FvCAJqpvvhkzQ3HfOXpLA5wdw== X-GND-Sasl: alexis.lothore@bootlin.com X-GND-Sasl: alexis.lothore@bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id 18D641C000D; Mon, 26 Jun 2023 08:05:37 +0000 (UTC) From: alexis.lothore@bootlin.com To: Cc: Thomas Petazzoni , Alexandre Belloni Subject: [yocto-autobuilder-helper][PATCH 1/3] scripts/utils.py: replace BUILD_HISTORY_DIRECTPUSH with hardcoded condition Date: Mon, 26 Jun 2023 10:05:58 +0200 Message-ID: <20230626080600.17359-2-alexis.lothore@bootlin.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230626080600.17359-1-alexis.lothore@bootlin.com> References: <20230626080600.17359-1-alexis.lothore@bootlin.com> MIME-Version: 1.0 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 ; Mon, 26 Jun 2023 08:05:42 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto/message/60442 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é --- 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 Mon Jun 26 08:05:59 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: 26398 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 89295EB64DD for ; Mon, 26 Jun 2023 08:05:42 +0000 (UTC) Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by mx.groups.io with SMTP id smtpd.web10.2969.1687766739031253169 for ; Mon, 26 Jun 2023 01:05:39 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=P5z3dI69; spf=pass (domain: bootlin.com, ip: 217.70.183.197, mailfrom: alexis.lothore@bootlin.com) X-GND-Sasl: alexis.lothore@bootlin.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1687766737; 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=3zGZJc43e7XPKx0gwKHuWDUt13zsH8sf9Y+ngpUREQU=; b=P5z3dI69h0IulRra6o8cx2vY4SEgxGGGDRZKlq4Rd4+H1tqxS678lR7kS62kBXmb+Z+qB0 gqmVvZPW3X7aWqY5lZUFZkrDr7rx3Lm6C8C1M4cJtRUZwmv7+GqtcXnzcjXtI/jG9eJitk HUWFnQrN1XWKaMFy2wxobX6lr6J6J1Cg7d9iFG2G3OAM2/YZTPgNY4gCaI72bkh02u4HaK meV03RJptLuIUi0wPv6UgGRwQj8plfsmMDEzFWvu3siQO73FrGFHQZnvvfPs3vfN8n7fkX kZ3+PGE2K8I7SbP+eCNMNKEmaO30aevl4B455TtMRrKlO8Ur5JN+6vqyM5LtsA== X-GND-Sasl: alexis.lothore@bootlin.com X-GND-Sasl: alexis.lothore@bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id 737601C001B; Mon, 26 Jun 2023 08:05:37 +0000 (UTC) From: alexis.lothore@bootlin.com To: Cc: Thomas Petazzoni , Alexandre Belloni Subject: [yocto-autobuilder-helper][PATCH 2/3] config.json: remove BUILD_HISTORY_DIRECTPUSH Date: Mon, 26 Jun 2023 10:05:59 +0200 Message-ID: <20230626080600.17359-3-alexis.lothore@bootlin.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230626080600.17359-1-alexis.lothore@bootlin.com> References: <20230626080600.17359-1-alexis.lothore@bootlin.com> MIME-Version: 1.0 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 ; Mon, 26 Jun 2023 08:05:42 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto/message/60441 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é --- config.json | 1 - 1 file changed, 1 deletion(-) diff --git a/config.json b/config.json index e7f308d0a3f6..f271ffaa402a 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:mickledore", "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 Mon Jun 26 08:06:00 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: 26397 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 96910C0015E for ; Mon, 26 Jun 2023 08:05:42 +0000 (UTC) Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by mx.groups.io with SMTP id smtpd.web10.2970.1687766739468767443 for ; Mon, 26 Jun 2023 01:05:39 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=jZeBZ6QO; spf=pass (domain: bootlin.com, ip: 217.70.183.197, mailfrom: alexis.lothore@bootlin.com) X-GND-Sasl: alexis.lothore@bootlin.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1687766738; 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=PNGJsIqs0Rit57xLPCINTCDHfJXtsNyBPD3uhxayhtk=; b=jZeBZ6QOec7ntP7ykxFSOOJpFUlY7FR/YDXbKN6LpkT1w4H183EHspP/QZXRY3qd/TdtUX WKw3tmtS9wGYLvAGJt62HnIYHGUOlh7F0SwvWk8wBv4/qw+bif1B/YQW/zmUZmbx525CaL p9YdGDGOJFFW8EXZCsZ6bUliemOU7qxWHao2fSOLHvwibIMoD4drFAZxwuWJ490EER1GNj fW2KogJgIpRhmsSKY2jlGdZWnl5VSqYnGDxljP5dvxdq5cV9HCKi93b+nC7zLBydbrOjDU 8kP8Vy6tQ0dLaSSZJVaXrU/WPLQ3HecJpumK4DVYAlb4F+eReRwu7tbO0/8/8g== X-GND-Sasl: alexis.lothore@bootlin.com X-GND-Sasl: alexis.lothore@bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id C5E561C000F; Mon, 26 Jun 2023 08:05:37 +0000 (UTC) From: alexis.lothore@bootlin.com To: Cc: Thomas Petazzoni , Alexandre Belloni Subject: [yocto-autobuilder-helper][PATCH 3/3] scripts/test_utils.py: update test after BUILD_HISTORY_DIRECTPUSH removal Date: Mon, 26 Jun 2023 10:06:00 +0200 Message-ID: <20230626080600.17359-4-alexis.lothore@bootlin.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230626080600.17359-1-alexis.lothore@bootlin.com> References: <20230626080600.17359-1-alexis.lothore@bootlin.com> MIME-Version: 1.0 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 ; Mon, 26 Jun 2023 08:05:42 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto/message/60443 From: Alexis Lothoré Update getcomparisonbranch unit tests by removing BUILD_HISTORY_DIRECTPUSH entry in fake configuration Signed-off-by: Alexis Lothoré --- 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"