Skip to content

Commit 9fe23e5

Browse files
committed
savePackage fixup
Always pass in SAVED_PACKAGE_BRANCHES where it makes sense
1 parent e495f57 commit 9fe23e5

File tree

7 files changed

+31
-28
lines changed

7 files changed

+31
-28
lines changed

common_factories.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from buildbot.steps.mtrlogobserver import MTR
1111

1212
# Local
13-
from constants import MTR_ENV, test_type_to_mtr_arg
13+
from constants import MTR_ENV, SAVED_PACKAGE_BRANCHES, test_type_to_mtr_arg
1414
from utils import (
1515
createVar,
1616
dockerfile,
@@ -140,7 +140,7 @@ def addPostTests(factory):
140140
steps.SetPropertyFromCommand(
141141
command="basename mariadb-*-linux-*.tar.gz",
142142
property="mariadb_binary",
143-
doStepIf=savePackage,
143+
doStepIf=lambda step: savePackage(step, SAVED_PACKAGE_BRANCHES),
144144
)
145145
)
146146
factory.addStep(
@@ -156,7 +156,7 @@ def addPostTests(factory):
156156
&& sync /packages/%(prop:tarbuildnum)s
157157
"""
158158
),
159-
doStepIf=savePackage,
159+
doStepIf=lambda step: savePackage(step, SAVED_PACKAGE_BRANCHES),
160160
)
161161
)
162162
factory.addStep(
@@ -166,7 +166,8 @@ def addPostTests(factory):
166166
waitForFinish=False,
167167
updateSourceStamp=False,
168168
set_properties=properties,
169-
doStepIf=lambda step: savePackage(step) and hasEco(step),
169+
doStepIf=lambda step: savePackage(step, SAVED_PACKAGE_BRANCHES)
170+
and hasEco(step),
170171
)
171172
)
172173
factory.addStep(
@@ -737,7 +738,8 @@ def getRpmAutobakeFactory(mtrDbPool):
737738
sync /packages/%(prop:tarbuildnum)s
738739
"""
739740
),
740-
doStepIf=lambda step: hasFiles(step) and savePackage(step),
741+
doStepIf=lambda step: hasFiles(step)
742+
and savePackage(step, SAVED_PACKAGE_BRANCHES),
741743
descriptionDone=util.Interpolate(
742744
"""
743745
Repository available with: curl %(kw:url)s/%(prop:tarbuildnum)s/%(prop:buildername)s/MariaDB.repo -o /etc/yum.repos.d/MariaDB.repo""",
@@ -775,7 +777,7 @@ def getRpmAutobakeFactory(mtrDbPool):
775777
"parentbuildername": Property("buildername"),
776778
},
777779
doStepIf=lambda step: hasInstall(step)
778-
and savePackage(step)
780+
and savePackage(step, SAVED_PACKAGE_BRANCHES)
779781
and hasFiles(step),
780782
)
781783
)
@@ -792,7 +794,7 @@ def getRpmAutobakeFactory(mtrDbPool):
792794
"parentbuildername": Property("buildername"),
793795
},
794796
doStepIf=lambda step: hasUpgrade(step)
795-
and savePackage(step)
797+
and savePackage(step, SAVED_PACKAGE_BRANCHES)
796798
and hasFiles(step),
797799
)
798800
)

master-bintars/master.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ def getBintarFactory(
265265
+ " && sync /packages/"
266266
+ "%(prop:tarbuildnum)s"
267267
),
268-
doStepIf=savePackage,
268+
doStepIf=lambda step: savePackage(step, SAVED_PACKAGE_BRANCHES),
269269
)
270270
)
271271

master-docker-nonstandard-2/master.cfg

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,6 @@ f_big_test.addStep(
500500
command="basename mariadb-*-linux-*.tar.gz", property="mariadb_binary"
501501
)
502502
)
503-
# 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))
504503
f_big_test.addStep(
505504
steps.ShellCommand(
506505
name="cleanup", command="rm -r * .* 2> /dev/null || true", alwaysRun=True
@@ -755,7 +754,7 @@ f_without_server.addStep(
755754
+ " && sync /packages/"
756755
+ "%(prop:tarbuildnum)s"
757756
),
758-
doStepIf=savePackage,
757+
doStepIf=lambda step: savePackage(step, SAVED_PACKAGE_BRANCHES),
759758
)
760759
)
761760
f_without_server.addStep(
@@ -1042,7 +1041,7 @@ f_bintar.addStep(
10421041
steps.SetPropertyFromCommand(
10431042
command="basename mariadb-*-linux-*.tar.gz",
10441043
property="mariadb_binary",
1045-
doStepIf=savePackage,
1044+
doStepIf=lambda step: savePackage(step, SAVED_PACKAGE_BRANCHES),
10461045
)
10471046
)
10481047
f_bintar.addStep(
@@ -1066,7 +1065,7 @@ f_bintar.addStep(
10661065
+ " && sync /packages/"
10671066
+ "%(prop:tarbuildnum)s"
10681067
),
1069-
doStepIf=savePackage,
1068+
doStepIf=lambda step: savePackage(step, SAVED_PACKAGE_BRANCHES),
10701069
)
10711070
)
10721071
f_bintar.addStep(
@@ -1083,7 +1082,7 @@ f_bintar.addStep(
10831082
"master_branch": Property("master_branch"),
10841083
"parentbuildername": Property("buildername"),
10851084
},
1086-
doStepIf=lambda step: savePackage(step) and hasEco(step),
1085+
doStepIf=lambda step: savePackage(step, SAVED_PACKAGE_BRANCHES) and hasEco(step),
10871086
)
10881087
)
10891088
f_bintar.addStep(

master-docker-nonstandard/master.cfg

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ from common_factories import (
1414
getRpmAutobakeFactory,
1515
getSourceTarball,
1616
)
17-
from constants import MTR_ENV
17+
from constants import MTR_ENV, SAVED_PACKAGE_BRANCHES
1818
from locks import getLocks
1919
from master_common import base_master_config
2020
from utils import (
@@ -1098,7 +1098,7 @@ f_without_server.addStep(
10981098
+ " && sync /packages/"
10991099
+ "%(prop:tarbuildnum)s"
11001100
),
1101-
doStepIf=savePackage,
1101+
doStepIf=lambda step: savePackage(step, SAVED_PACKAGE_BRANCHES),
11021102
)
11031103
)
11041104
f_without_server.addStep(
@@ -1386,7 +1386,7 @@ f_bintar.addStep(
13861386
steps.SetPropertyFromCommand(
13871387
command="basename mariadb-*-linux-*.tar.gz",
13881388
property="mariadb_binary",
1389-
doStepIf=savePackage,
1389+
doStepIf=lambda step: savePackage(step, SAVED_PACKAGE_BRANCHES),
13901390
)
13911391
)
13921392
f_bintar.addStep(
@@ -1410,7 +1410,7 @@ f_bintar.addStep(
14101410
+ " && sync /packages/"
14111411
+ "%(prop:tarbuildnum)s"
14121412
),
1413-
doStepIf=savePackage,
1413+
doStepIf=lambda step: savePackage(step, SAVED_PACKAGE_BRANCHES),
14141414
)
14151415
)
14161416
f_bintar.addStep(
@@ -1427,7 +1427,7 @@ f_bintar.addStep(
14271427
"master_branch": Property("master_branch"),
14281428
"parentbuildername": Property("buildername"),
14291429
},
1430-
doStepIf=lambda step: savePackage(step) and hasEco(step),
1430+
doStepIf=lambda step: savePackage(step, SAVED_PACKAGE_BRANCHES) and hasEco(step),
14311431
)
14321432
)
14331433
f_bintar.addStep(

master-galera/master.cfg

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ c["buildbotNetUsageData"] = None
6767
# Configure the Schedulers, which decide how to react to incoming changes.
6868

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

7272
# git branch filter using fnmatch
7373
import fnmatch
@@ -262,7 +262,7 @@ def dpkgDeb():
262262
"""
263263
),
264264
],
265-
doStepIf=savePackage,
265+
doStepIf=lambda step: savePackage(step, SAVED_PACKAGE_BRANCHES),
266266
)
267267

268268

@@ -281,7 +281,7 @@ def rpmSave():
281281
"""
282282
),
283283
],
284-
doStepIf=savePackage,
284+
doStepIf=lambda step: savePackage(step, SAVED_PACKAGE_BRANCHES),
285285
)
286286

287287

@@ -363,7 +363,7 @@ EOF
363363
""",
364364
url=os.getenv("ARTIFACTS_URL", default="https://ci.mariadb.org"),
365365
),
366-
doStepIf=savePackage,
366+
doStepIf=lambda step: savePackage(step, SAVED_PACKAGE_BRANCHES),
367367
)
368368
)
369369
f_deb_build.addStep(
@@ -420,7 +420,7 @@ EOF
420420
""",
421421
url=os.getenv("ARTIFACTS_URL", default="https://ci.mariadb.org"),
422422
),
423-
doStepIf=savePackage,
423+
doStepIf=lambda step: savePackage(step, SAVED_PACKAGE_BRANCHES),
424424
)
425425
)
426426
f_rpm_build.addStep(

master-nonlatent/master.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ f_windows_msi.addStep(
535535
'/'
536536

537537
),
538-
doStepIf=savePackage,
538+
doStepIf=lambda step: savePackage(step, SAVED_PACKAGE_BRANCHES),
539539
)
540540
)
541541
f_windows_msi.addStep(
@@ -557,7 +557,7 @@ f_windows_msi.addStep(
557557
'%(prop:buildername)s'
558558
'/'
559559
),
560-
doStepIf=savePackage,
560+
doStepIf=lambda step: savePackage(step, SAVED_PACKAGE_BRANCHES),
561561
)
562562
)
563563
f_windows_msi.addStep(

utils.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,8 @@ def createDebRepo() -> steps.ShellCommand:
213213
"""
214214
),
215215
],
216-
doStepIf=lambda step: hasFiles(step) and savePackage(step),
216+
doStepIf=lambda step: hasFiles(step)
217+
and savePackage(step, SAVED_PACKAGE_BRANCHES),
217218
)
218219

219220

@@ -252,7 +253,8 @@ def uploadDebArtifacts() -> steps.ShellCommand:
252253
"""
253254
),
254255
],
255-
doStepIf=lambda step: hasFiles(step) and savePackage(step),
256+
doStepIf=lambda step: hasFiles(step)
257+
and savePackage(step, SAVED_PACKAGE_BRANCHES),
256258
descriptionDone=util.Interpolate(
257259
"""
258260
Use """
@@ -497,7 +499,7 @@ def hasCompat(step: BuildStep) -> bool:
497499

498500
def hasDockerLibrary(step: BuildStep) -> bool:
499501
# Can only build with a saved package
500-
if not savePackage(step):
502+
if not savePackage(step, SAVED_PACKAGE_BRANCHES):
501503
return False
502504

503505
branch = step.getProperty("master_branch")

0 commit comments

Comments
 (0)