From 29b3e53094d42e98ad6fa4e6c29b2ed82867427a Mon Sep 17 00:00:00 2001 From: Razvan-Liviu Varzaru Date: Fri, 10 Jan 2025 15:00:39 +0200 Subject: [PATCH] Renamed hasFiles function to highlight its purpose The function is used only for checking that packages were generated for both RPM and DEB. Returns True if "packages" property is not empty. If the packages are generated, several further actions can take place: -> publish the packages on CI -> trigger Install / Upgrade builders which in turn install the packages from CI --- common_factories.py | 8 ++++---- master.cfg | 4 ++-- utils.py | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/common_factories.py b/common_factories.py index 09ef8096..579c37bb 100644 --- a/common_factories.py +++ b/common_factories.py @@ -23,9 +23,9 @@ hasDockerLibrary, hasEco, hasFailed, - hasFiles, hasGalera, hasInstall, + hasPackagesGenerated, hasRpmLint, hasS3, hasUpgrade, @@ -755,7 +755,7 @@ def getRpmAutobakeFactory(mtrDbPool): """ ), doStepIf=( - lambda step: hasFiles(step) + lambda step: hasPackagesGenerated(step) and savePackageIfBranchMatch(step, SAVED_PACKAGE_BRANCHES) ), descriptionDone=util.Interpolate( @@ -797,7 +797,7 @@ def getRpmAutobakeFactory(mtrDbPool): doStepIf=( lambda step: hasInstall(step) and savePackageIfBranchMatch(step, SAVED_PACKAGE_BRANCHES) - and hasFiles(step) + and hasPackagesGenerated(step) ), ) ) @@ -816,7 +816,7 @@ def getRpmAutobakeFactory(mtrDbPool): doStepIf=( lambda step: hasUpgrade(step) and savePackageIfBranchMatch(step, SAVED_PACKAGE_BRANCHES) - and hasFiles(step) + and hasPackagesGenerated(step) ), ) ) diff --git a/master.cfg b/master.cfg index af0579d7..27dc0b7b 100644 --- a/master.cfg +++ b/master.cfg @@ -258,7 +258,7 @@ f_deb_autobake.addStep( doStepIf=( lambda step: hasInstall(step) and savePackageIfBranchMatch(step, SAVED_PACKAGE_BRANCHES) - and hasFiles(step) + and hasPackagesGenerated(step) ), ) ) @@ -277,7 +277,7 @@ f_deb_autobake.addStep( doStepIf=( lambda step: hasUpgrade(step) and savePackageIfBranchMatch(step, SAVED_PACKAGE_BRANCHES) - and hasFiles(step) + and hasPackagesGenerated(step) ), ) ) diff --git a/utils.py b/utils.py index 86fbaab8..0a9ff479 100644 --- a/utils.py +++ b/utils.py @@ -207,7 +207,7 @@ def createDebRepo() -> steps.ShellCommand: ), ], doStepIf=( - lambda step: hasFiles(step) + lambda step: hasPackagesGenerated(step) and savePackageIfBranchMatch(step, SAVED_PACKAGE_BRANCHES) ), ) @@ -249,7 +249,7 @@ def uploadDebArtifacts() -> steps.ShellCommand: ), ], doStepIf=( - lambda step: hasFiles(step) + lambda step: hasPackagesGenerated(step) and savePackageIfBranchMatch(step, SAVED_PACKAGE_BRANCHES) ), descriptionDone=util.Interpolate( @@ -444,7 +444,7 @@ def dockerfile(props: IProperties) -> str: # checks if the list of files is empty -def hasFiles(step: BuildStep) -> bool: +def hasPackagesGenerated(step: BuildStep) -> bool: return len(step.getProperty("packages")) >= 1