Skip to content

Commit 9507cde

Browse files
committed
buildkite: eliminate initial_steps
The point of these is to run in parallel with the compilation steps, and not block the wait step if they fail. However, since we use `depends_on: null` for these, it doesn't matter whether they are initial or not, so just add them via `add_step` with `decorate=False`, as we do for normal steps. Signed-off-by: Patrick Roy <[email protected]>
1 parent 9e89f46 commit 9507cde

File tree

2 files changed

+10
-19
lines changed

2 files changed

+10
-19
lines changed

.buildkite/common.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ class BKPipeline:
233233

234234
parser = COMMON_PARSER
235235

236-
def __init__(self, initial_steps=None, with_build_step=True, **kwargs):
236+
def __init__(self, with_build_step=True, **kwargs):
237237
self.steps = []
238238
self.args = args = self.parser.parse_args()
239239
# Retry one time if agent was lost. This can happen if we terminate the
@@ -263,18 +263,6 @@ def __init__(self, initial_steps=None, with_build_step=True, **kwargs):
263263
else:
264264
self.shared_build = None
265265

266-
# If we run initial_steps before the "wait" step above, then a failure of the initial steps
267-
# would result in the build not progressing past the "wait" step (as buildkite only proceeds past a wait step
268-
# if everything before it passed). Thus put the initial steps after the "wait" step, but set `"depends_on": null`
269-
# to start running them immediately (e.g. without waiting for the "wait" step to unblock).
270-
#
271-
# See also https://buildkite.com/docs/pipelines/dependencies#explicit-dependencies-in-uploaded-steps
272-
if initial_steps:
273-
for step in initial_steps:
274-
step["depends_on"] = None
275-
276-
self.steps += initial_steps
277-
278266
def add_step(self, step, decorate=True):
279267
"""
280268
Add a step to the pipeline.

.buildkite/pipeline_pr.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,18 @@
2121
pipeline = BKPipeline(
2222
priority=DEFAULT_PRIORITY,
2323
timeout_in_minutes=45,
24-
initial_steps=[
25-
{
26-
"command": "./tools/devtool -y checkstyle",
27-
"label": "🪶 Style",
28-
},
29-
],
3024
with_build_step=not DOC_ONLY_CHANGE,
3125
)
3226

27+
pipeline.add_step(
28+
{
29+
"command": "./tools/devtool -y checkstyle",
30+
"label": "🪶 Style",
31+
"depends_on": None,
32+
},
33+
decorate=False,
34+
)
35+
3336
# run sanity build of devtool if Dockerfile is changed
3437
if any(x.parent.name == "devctr" for x in changed_files):
3538
pipeline.build_group_per_arch(

0 commit comments

Comments
 (0)