Skip to content

Commit

Permalink
Renamed hasFiles function to highlight its purpose
Browse files Browse the repository at this point in the history
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
  • Loading branch information
RazvanLiviuVarzaru committed Jan 10, 2025
1 parent 7a24564 commit 29b3e53
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions common_factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
hasDockerLibrary,
hasEco,
hasFailed,
hasFiles,
hasGalera,
hasInstall,
hasPackagesGenerated,
hasRpmLint,
hasS3,
hasUpgrade,
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -797,7 +797,7 @@ def getRpmAutobakeFactory(mtrDbPool):
doStepIf=(
lambda step: hasInstall(step)
and savePackageIfBranchMatch(step, SAVED_PACKAGE_BRANCHES)
and hasFiles(step)
and hasPackagesGenerated(step)
),
)
)
Expand All @@ -816,7 +816,7 @@ def getRpmAutobakeFactory(mtrDbPool):
doStepIf=(
lambda step: hasUpgrade(step)
and savePackageIfBranchMatch(step, SAVED_PACKAGE_BRANCHES)
and hasFiles(step)
and hasPackagesGenerated(step)
),
)
)
Expand Down
4 changes: 2 additions & 2 deletions master.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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)
),
)
)
Expand All @@ -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)
),
)
)
Expand Down
6 changes: 3 additions & 3 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def createDebRepo() -> steps.ShellCommand:
),
],
doStepIf=(
lambda step: hasFiles(step)
lambda step: hasPackagesGenerated(step)
and savePackageIfBranchMatch(step, SAVED_PACKAGE_BRANCHES)
),
)
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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


Expand Down

0 comments on commit 29b3e53

Please sign in to comment.