[buildbot] phase1: deduplicate 'git' step

LEDE Commits lede-commits at lists.infradead.org
Mon May 15 08:39:00 PDT 2023


ynezz pushed a commit to buildbot.git, branch master:
https://git.openwrt.org/9f65a44ce2023fe9c55fdaebcfe79b8b92a2f3b2

commit 9f65a44ce2023fe9c55fdaebcfe79b8b92a2f3b2
Author: Thibaut VARÈNE <hacks at slashdirt.org>
AuthorDate: Thu Oct 20 12:47:05 2022 +0200

    phase1: deduplicate 'git' step
    
    method renderers are supported now.
    
    Signed-off-by: Thibaut VARÈNE <hacks at slashdirt.org>
---
 phase1/master.cfg | 28 ++--------------------------
 1 file changed, 2 insertions(+), 26 deletions(-)

diff --git a/phase1/master.cfg b/phase1/master.cfg
index ecd06a1..10fd530 100644
--- a/phase1/master.cfg
+++ b/phase1/master.cfg
@@ -397,16 +397,6 @@ def IsExpireRequested(step):
 	else:
 		return not IsCleanupRequested(step)
 
-def IsGitFreshRequested(step):
-	do_cleanup = step.getProperty("do_cleanup")
-	if do_cleanup:
-		return True
-	else:
-		return False
-
-def IsGitCleanRequested(step):
-	return not IsGitFreshRequested(step)
-
 def IsTaggingRequested(step):
 	val = step.getProperty("tag")
 	if val and re.match(r"^[0-9]+\.[0-9]+\.[0-9]+(?:-rc[0-9]+)?$", val):
@@ -658,28 +648,14 @@ for target in targets:
 	  # if repo doesn't exist: 'git clone repourl'
 	  # method 'clean' runs 'git clean -d -f', method fresh runs 'git clean -d -f x'. Only works with mode='full'
 	  # 'git fetch -t repourl branch; git reset --hard revision'
-	# Git() parameters can't take a renderer until buildbot 0.8.10, so we have to split the fresh and clean cases
-	# if buildbot is updated, one can use: method = Interpolate('%(prop:do_cleanup:#?|fresh|clean)s')
-	factory.addStep(Git(
-		name = "gitclean",
-		repourl = repo_url,
-		branch = repo_branch,
-		mode = 'full',
-		method = 'clean',
-		locks = NetLockDl,
-		haltOnFailure = True,
-		doStepIf = IsGitCleanRequested,
-	))
-
 	factory.addStep(Git(
-		name = "gitfresh",
+		name = "git",
 		repourl = repo_url,
 		branch = repo_branch,
 		mode = 'full',
-		method = 'fresh',
+		method = Interpolate("%(prop:do_cleanup:#?|fresh|clean)s"),
 		locks = NetLockDl,
 		haltOnFailure = True,
-		doStepIf = IsGitFreshRequested,
 	))
 
 	# update remote refs




More information about the lede-commits mailing list