Skip to content

Commit

Permalink
savePackage fixup
Browse files Browse the repository at this point in the history
Always pass in SAVED_PACKAGE_BRANCHES where it makes sense
  • Loading branch information
cvicentiu committed Dec 3, 2024
1 parent e495f57 commit 9fe23e5
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 28 deletions.
16 changes: 9 additions & 7 deletions common_factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from buildbot.steps.mtrlogobserver import MTR

# Local
from constants import MTR_ENV, test_type_to_mtr_arg
from constants import MTR_ENV, SAVED_PACKAGE_BRANCHES, test_type_to_mtr_arg
from utils import (
createVar,
dockerfile,
Expand Down Expand Up @@ -140,7 +140,7 @@ def addPostTests(factory):
steps.SetPropertyFromCommand(
command="basename mariadb-*-linux-*.tar.gz",
property="mariadb_binary",
doStepIf=savePackage,
doStepIf=lambda step: savePackage(step, SAVED_PACKAGE_BRANCHES),
)
)
factory.addStep(
Expand All @@ -156,7 +156,7 @@ def addPostTests(factory):
&& sync /packages/%(prop:tarbuildnum)s
"""
),
doStepIf=savePackage,
doStepIf=lambda step: savePackage(step, SAVED_PACKAGE_BRANCHES),
)
)
factory.addStep(
Expand All @@ -166,7 +166,8 @@ def addPostTests(factory):
waitForFinish=False,
updateSourceStamp=False,
set_properties=properties,
doStepIf=lambda step: savePackage(step) and hasEco(step),
doStepIf=lambda step: savePackage(step, SAVED_PACKAGE_BRANCHES)
and hasEco(step),
)
)
factory.addStep(
Expand Down Expand Up @@ -737,7 +738,8 @@ def getRpmAutobakeFactory(mtrDbPool):
sync /packages/%(prop:tarbuildnum)s
"""
),
doStepIf=lambda step: hasFiles(step) and savePackage(step),
doStepIf=lambda step: hasFiles(step)
and savePackage(step, SAVED_PACKAGE_BRANCHES),
descriptionDone=util.Interpolate(
"""
Repository available with: curl %(kw:url)s/%(prop:tarbuildnum)s/%(prop:buildername)s/MariaDB.repo -o /etc/yum.repos.d/MariaDB.repo""",
Expand Down Expand Up @@ -775,7 +777,7 @@ def getRpmAutobakeFactory(mtrDbPool):
"parentbuildername": Property("buildername"),
},
doStepIf=lambda step: hasInstall(step)
and savePackage(step)
and savePackage(step, SAVED_PACKAGE_BRANCHES)
and hasFiles(step),
)
)
Expand All @@ -792,7 +794,7 @@ def getRpmAutobakeFactory(mtrDbPool):
"parentbuildername": Property("buildername"),
},
doStepIf=lambda step: hasUpgrade(step)
and savePackage(step)
and savePackage(step, SAVED_PACKAGE_BRANCHES)
and hasFiles(step),
)
)
Expand Down
2 changes: 1 addition & 1 deletion master-bintars/master.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ def getBintarFactory(
+ " && sync /packages/"
+ "%(prop:tarbuildnum)s"
),
doStepIf=savePackage,
doStepIf=lambda step: savePackage(step, SAVED_PACKAGE_BRANCHES),
)
)

Expand Down
9 changes: 4 additions & 5 deletions master-docker-nonstandard-2/master.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,6 @@ f_big_test.addStep(
command="basename mariadb-*-linux-*.tar.gz", property="mariadb_binary"
)
)
# f_big_test.addStep(steps.ShellCommand(name='save_packages', timeout=7200, haltOnFailure=True, command=util.Interpolate('mkdir -p ' + '/packages/' + '%(prop:tarbuildnum)s' + '/' + '%(prop:buildername)s'+ ' && sha256sum %(prop:mariadb_binary)s >> sha256sums.txt && cp ' + '%(prop:mariadb_binary)s sha256sums.txt' + ' /packages/' + '%(prop:tarbuildnum)s' + '/' + '%(prop:buildername)s' + '/' + ' && sync /packages/' + '%(prop:tarbuildnum)s'), doStepIf=savePackage))
f_big_test.addStep(
steps.ShellCommand(
name="cleanup", command="rm -r * .* 2> /dev/null || true", alwaysRun=True
Expand Down Expand Up @@ -755,7 +754,7 @@ f_without_server.addStep(
+ " && sync /packages/"
+ "%(prop:tarbuildnum)s"
),
doStepIf=savePackage,
doStepIf=lambda step: savePackage(step, SAVED_PACKAGE_BRANCHES),
)
)
f_without_server.addStep(
Expand Down Expand Up @@ -1042,7 +1041,7 @@ f_bintar.addStep(
steps.SetPropertyFromCommand(
command="basename mariadb-*-linux-*.tar.gz",
property="mariadb_binary",
doStepIf=savePackage,
doStepIf=lambda step: savePackage(step, SAVED_PACKAGE_BRANCHES),
)
)
f_bintar.addStep(
Expand All @@ -1066,7 +1065,7 @@ f_bintar.addStep(
+ " && sync /packages/"
+ "%(prop:tarbuildnum)s"
),
doStepIf=savePackage,
doStepIf=lambda step: savePackage(step, SAVED_PACKAGE_BRANCHES),
)
)
f_bintar.addStep(
Expand All @@ -1083,7 +1082,7 @@ f_bintar.addStep(
"master_branch": Property("master_branch"),
"parentbuildername": Property("buildername"),
},
doStepIf=lambda step: savePackage(step) and hasEco(step),
doStepIf=lambda step: savePackage(step, SAVED_PACKAGE_BRANCHES) and hasEco(step),
)
)
f_bintar.addStep(
Expand Down
10 changes: 5 additions & 5 deletions master-docker-nonstandard/master.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ from common_factories import (
getRpmAutobakeFactory,
getSourceTarball,
)
from constants import MTR_ENV
from constants import MTR_ENV, SAVED_PACKAGE_BRANCHES
from locks import getLocks
from master_common import base_master_config
from utils import (
Expand Down Expand Up @@ -1098,7 +1098,7 @@ f_without_server.addStep(
+ " && sync /packages/"
+ "%(prop:tarbuildnum)s"
),
doStepIf=savePackage,
doStepIf=lambda step: savePackage(step, SAVED_PACKAGE_BRANCHES),
)
)
f_without_server.addStep(
Expand Down Expand Up @@ -1386,7 +1386,7 @@ f_bintar.addStep(
steps.SetPropertyFromCommand(
command="basename mariadb-*-linux-*.tar.gz",
property="mariadb_binary",
doStepIf=savePackage,
doStepIf=lambda step: savePackage(step, SAVED_PACKAGE_BRANCHES),
)
)
f_bintar.addStep(
Expand All @@ -1410,7 +1410,7 @@ f_bintar.addStep(
+ " && sync /packages/"
+ "%(prop:tarbuildnum)s"
),
doStepIf=savePackage,
doStepIf=lambda step: savePackage(step, SAVED_PACKAGE_BRANCHES),
)
)
f_bintar.addStep(
Expand All @@ -1427,7 +1427,7 @@ f_bintar.addStep(
"master_branch": Property("master_branch"),
"parentbuildername": Property("buildername"),
},
doStepIf=lambda step: savePackage(step) and hasEco(step),
doStepIf=lambda step: savePackage(step, SAVED_PACKAGE_BRANCHES) and hasEco(step),
)
)
f_bintar.addStep(
Expand Down
10 changes: 5 additions & 5 deletions master-galera/master.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ c["buildbotNetUsageData"] = None
# Configure the Schedulers, which decide how to react to incoming changes.

BRANCHES_MAIN = ["mariadb-3.x", "mariadb-4.x", "bb-*"]
savedPackageBranches = ["mariadb-3.x", "mariadb-4.x", "bb-*"]
SAVED_PACKAGE_BRANCHES = ["mariadb-3.x", "mariadb-4.x", "bb-*"]

# git branch filter using fnmatch
import fnmatch
Expand Down Expand Up @@ -262,7 +262,7 @@ def dpkgDeb():
"""
),
],
doStepIf=savePackage,
doStepIf=lambda step: savePackage(step, SAVED_PACKAGE_BRANCHES),
)


Expand All @@ -281,7 +281,7 @@ def rpmSave():
"""
),
],
doStepIf=savePackage,
doStepIf=lambda step: savePackage(step, SAVED_PACKAGE_BRANCHES),
)


Expand Down Expand Up @@ -363,7 +363,7 @@ EOF
""",
url=os.getenv("ARTIFACTS_URL", default="https://ci.mariadb.org"),
),
doStepIf=savePackage,
doStepIf=lambda step: savePackage(step, SAVED_PACKAGE_BRANCHES),
)
)
f_deb_build.addStep(
Expand Down Expand Up @@ -420,7 +420,7 @@ EOF
""",
url=os.getenv("ARTIFACTS_URL", default="https://ci.mariadb.org"),
),
doStepIf=savePackage,
doStepIf=lambda step: savePackage(step, SAVED_PACKAGE_BRANCHES),
)
)
f_rpm_build.addStep(
Expand Down
4 changes: 2 additions & 2 deletions master-nonlatent/master.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ f_windows_msi.addStep(
'/'

),
doStepIf=savePackage,
doStepIf=lambda step: savePackage(step, SAVED_PACKAGE_BRANCHES),
)
)
f_windows_msi.addStep(
Expand All @@ -557,7 +557,7 @@ f_windows_msi.addStep(
'%(prop:buildername)s'
'/'
),
doStepIf=savePackage,
doStepIf=lambda step: savePackage(step, SAVED_PACKAGE_BRANCHES),
)
)
f_windows_msi.addStep(
Expand Down
8 changes: 5 additions & 3 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,8 @@ def createDebRepo() -> steps.ShellCommand:
"""
),
],
doStepIf=lambda step: hasFiles(step) and savePackage(step),
doStepIf=lambda step: hasFiles(step)
and savePackage(step, SAVED_PACKAGE_BRANCHES),
)


Expand Down Expand Up @@ -252,7 +253,8 @@ def uploadDebArtifacts() -> steps.ShellCommand:
"""
),
],
doStepIf=lambda step: hasFiles(step) and savePackage(step),
doStepIf=lambda step: hasFiles(step)
and savePackage(step, SAVED_PACKAGE_BRANCHES),
descriptionDone=util.Interpolate(
"""
Use """
Expand Down Expand Up @@ -497,7 +499,7 @@ def hasCompat(step: BuildStep) -> bool:

def hasDockerLibrary(step: BuildStep) -> bool:
# Can only build with a saved package
if not savePackage(step):
if not savePackage(step, SAVED_PACKAGE_BRANCHES):
return False

branch = step.getProperty("master_branch")
Expand Down

0 comments on commit 9fe23e5

Please sign in to comment.