Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion scripts/ci/pr_runner_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -1835,7 +1835,13 @@ def choose(
# Blacksmith is unavailable while the record exists. Keep the
# normal owned split/root/GUI placement, but never emit an
# ephemeral candidate or a retry target back onto the dead pool.
limits = dataclasses.replace(limits, order=tuple(label for label in limits.order if persistent(label)))
owned_order = tuple(label for label in limits.order if persistent(label))
if not owned_order:
# A hand-set Blacksmith-only order must not turn the failover
# into a direct, unmeasured MACOS_RUNNER_PR route. Rebuild the
# owned default for the pinned Xcode instead.
owned_order = owned_pools(xcode_pins.get(PR_XCODE_VARIABLE))
limits = dataclasses.replace(limits, order=owned_order)
if not limits.order:
return Choice("", "", "cloud overflow is off; no owned pool is in the picker order"), None
else:
Expand Down
6 changes: 6 additions & 0 deletions tests/test_ci_pr_runner_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,12 @@ def test_cloud_overflow_record_never_selects_blacksmith(self):
self.assertTrue(not choice.runner or choice.runner.startswith("glaeda-"), choice)
self.assertTrue(not choice.retry_runner or choice.retry_runner.startswith("glaeda-"), choice)

def test_cloud_overflow_replaces_a_blacksmith_only_order(self):
record = json.dumps({"changed": {"MACOS_RUNNER_PR": {"before": SMALL, "after": MINI}}})
choice = owned_choice(fleet(busy=0), default=MINI, order=f"{LARGE},{SMALL}",
cloud_overflow=record)
self.assertEqual(choice.runner, MINI)

def test_unrelated_or_malformed_cloud_record_does_not_enable_picker(self):
unrelated = json.dumps({"changed": {"LINUX_RUNNER": {"before": "blacksmith-4vcpu-ubuntu-2404",
"after": "ubuntu-24.04"}}})
Expand Down
Loading