Skip to content

Commit 9efa069

Browse files
committed
refactor: buildkite: rename decorate to depends_on_build
Name more clearly indicate what the parameter does (adding `depends_on` steps for the shared compilation, and adapting the step commands with an artifact download). Signed-off-by: Patrick Roy <[email protected]>
1 parent 19e9051 commit 9efa069

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

.buildkite/common.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -259,21 +259,21 @@ def __init__(self, with_build_step=True, **kwargs):
259259
if with_build_step:
260260
build_cmds, self.shared_build = shared_build()
261261
self.build_group_per_arch(
262-
"🏗️ Build", build_cmds, decorate=False, key_prefix="build"
262+
"🏗️ Build", build_cmds, depends_on_build=False, key_prefix="build"
263263
)
264264
else:
265265
self.shared_build = None
266266

267-
def add_step(self, step, decorate=True):
267+
def add_step(self, step, depends_on_build=True):
268268
"""
269269
Add a step to the pipeline.
270270
271271
https://buildkite.com/docs/pipelines/step-reference
272272
273273
:param step: a Buildkite step
274-
:param decorate: inject needed commands for sharing builds
274+
:param depends_on_build: inject needed commands for sharing builds
275275
"""
276-
if decorate and isinstance(step, dict):
276+
if depends_on_build and isinstance(step, dict):
277277
step = self._adapt_group(step)
278278
self.steps.append(step)
279279
return step
@@ -308,15 +308,17 @@ def build_group(self, *args, **kwargs):
308308
309309
https://buildkite.com/docs/pipelines/group-step
310310
"""
311-
decorate = kwargs.pop("decorate", True)
311+
depends_on_build = kwargs.pop("depends_on_build", True)
312312
combined = overlay_dict(self.per_instance, kwargs)
313-
return self.add_step(group(*args, **combined), decorate=decorate)
313+
return self.add_step(
314+
group(*args, **combined), depends_on_build=depends_on_build
315+
)
314316

315317
def build_group_per_arch(self, label, *args, **kwargs):
316318
"""
317319
Build a group, parametrizing over the architectures only.
318320
"""
319-
decorate = kwargs.pop("decorate", True)
321+
depends_on_build = kwargs.pop("depends_on_build", True)
320322
key_prefix = kwargs.pop("key_prefix", None)
321323
combined = overlay_dict(self.per_arch, kwargs)
322324
grp = group(label, *args, **combined)
@@ -325,7 +327,7 @@ def build_group_per_arch(self, label, *args, **kwargs):
325327
step["key"] = (
326328
key_prefix + "_" + DEFAULT_INSTANCES[step["agents"]["instance"]]
327329
)
328-
return self.add_step(grp, decorate=decorate)
330+
return self.add_step(grp, depends_on_build=depends_on_build)
329331

330332
def to_dict(self):
331333
"""Render the pipeline as a dictionary."""

.buildkite/pipeline_pr.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"label": "🪶 Style",
3131
"depends_on": None,
3232
},
33-
decorate=False,
33+
depends_on_build=False,
3434
)
3535

3636
# run sanity build of devtool if Dockerfile is changed
@@ -61,7 +61,7 @@
6161
platforms=[("al2", "linux_5.10")],
6262
timeout_in_minutes=300,
6363
**DEFAULTS_PERF,
64-
decorate=False,
64+
depends_on_build=False,
6565
)
6666
# modify Kani steps' label
6767
for step in kani_grp["steps"]:
@@ -72,7 +72,7 @@
7272
pipeline.build_group(
7373
"📦 Build",
7474
pipeline.devtool_test(pytest_opts="integration_tests/build/"),
75-
decorate=False,
75+
depends_on_build=False,
7676
)
7777

7878
pipeline.build_group(

0 commit comments

Comments
 (0)