Skip to content

Commit 4e74763

Browse files
authored
Add depends_on for all steps when necessary (#2086)
1 parent 72a7794 commit 4e74763

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

buildkite/bazel-central-registry/bcr_presubmit.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,14 @@ def should_wait_bcr_maintainer_review(modules):
451451
def upload_jobs_to_pipeline(pipeline_steps):
452452
"""Upload jobs to Buildkite in batches."""
453453
BATCH_SIZE = 2000
454+
455+
# Make sure all jobs depends on the block step explicitly
456+
# if we need multiple batches and the first step is a block step.
457+
if len(pipeline_steps) > BATCH_SIZE and "block" in pipeline_steps[0]:
458+
pipeline_steps[0]["key"] = "wait_for_approval"
459+
for step in pipeline_steps[1:]:
460+
step["depends_on"] = "wait_for_approval"
461+
454462
for i in range(0, len(pipeline_steps), BATCH_SIZE):
455463
batch = pipeline_steps[i:i + BATCH_SIZE]
456464
# Upload the batch to Buildkite

0 commit comments

Comments
 (0)