Skip to content

Commit d3fc198

Browse files
committed
ci: keep runner fallback label specific
1 parent a880135 commit d3fc198

3 files changed

Lines changed: 5 additions & 14 deletions

File tree

docs/ci.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ gh workflow run full-release-validation.yml --ref main -f ref=<branch-or-sha>
103103
| `blacksmith-6vcpu-macos-latest` | `macos-node` on `openclaw/openclaw`; forks fall back to `macos-latest` |
104104
| `blacksmith-12vcpu-macos-latest` | `macos-swift` on `openclaw/openclaw`; forks fall back to `macos-latest` |
105105

106-
Canonical-repo CI keeps Blacksmith as the default runner path. During `preflight`, `scripts/ci-runner-labels.mjs` checks recent queued and in-progress Actions runs for queued Blacksmith jobs. If a specific Blacksmith label already has queued jobs, downstream jobs that would use that label fall back to the matching GitHub-hosted runner (`ubuntu-24.04`, `windows-2025`, or `macos-latest`) for that run only. If the API probe fails, no fallback is applied.
106+
Canonical-repo CI keeps Blacksmith as the default runner path. During `preflight`, `scripts/ci-runner-labels.mjs` checks recent queued and in-progress Actions runs for queued Blacksmith jobs. If a specific Blacksmith label already has queued jobs, downstream jobs that would use that exact label fall back to the matching GitHub-hosted runner (`ubuntu-24.04`, `windows-2025`, or `macos-latest`) for that run only. Other Blacksmith sizes in the same OS family stay on their primary labels. If the API probe fails, no fallback is applied.
107107

108108
## Local equivalents
109109

scripts/ci-runner-labels.mjs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,19 +66,10 @@ export function selectRunnerLabels({
6666
queueThreshold = DEFAULT_QUEUE_THRESHOLD,
6767
} = {}) {
6868
const selected = {};
69-
const queuedCountsByFamily = {};
70-
for (const [label, count] of Object.entries(queuedCountsByLabel)) {
71-
const family = Object.values(RUNNER_LABELS).find((runner) => runner.primary === label)?.family;
72-
if (family) {
73-
queuedCountsByFamily[family] = (queuedCountsByFamily[family] ?? 0) + count;
74-
}
75-
}
7669
for (const [outputName, label] of Object.entries(RUNNER_LABELS)) {
7770
const queuedCount = queuedCountsByLabel[label.primary] ?? 0;
78-
const familyQueuedCount = queuedCountsByFamily[label.family] ?? 0;
7971
selected[outputName] =
80-
!canonicalRepository ||
81-
(fallbackEnabled && (queuedCount >= queueThreshold || familyQueuedCount >= queueThreshold))
72+
!canonicalRepository || (fallbackEnabled && queuedCount >= queueThreshold)
8273
? label.fallback
8374
: label.primary;
8475
}

test/scripts/ci-runner-labels.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ describe("scripts/ci-runner-labels.mjs", () => {
1010
});
1111
});
1212

13-
it("falls back within backed-up Blacksmith runner families", () => {
13+
it("falls back only for backed-up Blacksmith runner labels", () => {
1414
expect(
1515
selectRunnerLabels({
1616
queuedCountsByLabel: {
@@ -21,8 +21,8 @@ describe("scripts/ci-runner-labels.mjs", () => {
2121
}),
2222
).toMatchObject({
2323
runner_4vcpu_ubuntu: "ubuntu-24.04",
24-
runner_8vcpu_ubuntu: "ubuntu-24.04",
25-
runner_16vcpu_ubuntu: "ubuntu-24.04",
24+
runner_8vcpu_ubuntu: "blacksmith-8vcpu-ubuntu-2404",
25+
runner_16vcpu_ubuntu: "blacksmith-16vcpu-ubuntu-2404",
2626
runner_16vcpu_windows: "blacksmith-16vcpu-windows-2025",
2727
});
2828
});

0 commit comments

Comments
 (0)