Skip to content

Commit 6472d22

Browse files
authored
fix(ci): budget expanded survivor groups (#122058)
1 parent 5c52666 commit 6472d22

6 files changed

Lines changed: 72 additions & 8 deletions

‎.github/workflows/openclaw-live-and-e2e-checks-reusable.yml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1538,6 +1538,7 @@ jobs:
15381538
LANES: ${{ inputs.docker_lanes }}
15391539
GROUP_SIZE: ${{ inputs.targeted_docker_lane_group_size }}
15401540
OPENCLAW_UPGRADE_SURVIVOR_BASELINE_SPECS: ${{ inputs.published_upgrade_survivor_baselines }}
1541+
OPENCLAW_UPGRADE_SURVIVOR_SCENARIOS: ${{ inputs.published_upgrade_survivor_scenarios }}
15411542
run: |
15421543
set -euo pipefail
15431544
groups_json="$(node scripts/plan-targeted-docker-lane-groups.mjs)"
@@ -1555,7 +1556,7 @@ jobs:
15551556
name: Docker E2E targeted lanes (${{ matrix.group.label }})
15561557
continue-on-error: ${{ inputs.advisory }}
15571558
runs-on: ${{ inputs.use_github_hosted_runners && 'ubuntu-24.04' || 'blacksmith-32vcpu-ubuntu-2404' }}
1558-
timeout-minutes: 60
1559+
timeout-minutes: ${{ matrix.group.timeout_minutes || 60 }}
15591560
strategy:
15601561
fail-fast: false
15611562
matrix:

‎scripts/plan-targeted-docker-lane-groups.mjs‎

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,20 @@ function sanitizeLabel(value) {
3131
* groupSize?: number | string;
3232
* lanes?: string;
3333
* upgradeSurvivorBaselines?: string;
34+
* upgradeSurvivorScenarios?: string;
3435
* }} [options]
3536
* @returns {{
3637
* docker_lanes: string;
3738
* label: string;
3839
* published_upgrade_survivor_baselines?: string;
40+
* timeout_minutes?: number;
3941
* }[]}
4042
*/
4143
export function planTargetedDockerLaneGroups({
4244
groupSize = 1,
4345
lanes,
4446
upgradeSurvivorBaselines = "",
47+
upgradeSurvivorScenarios = "",
4548
} = {}) {
4649
const selectedLanes = splitTokens(lanes);
4750
if (selectedLanes.length === 0) {
@@ -50,25 +53,37 @@ export function planTargetedDockerLaneGroups({
5053

5154
const parsedGroupSize = parsePositiveInt(groupSize, "groupSize");
5255
const baselineSpecs = splitTokens(upgradeSurvivorBaselines);
56+
const hasExpandedSurvivorScenarios = splitTokens(upgradeSurvivorScenarios).length > 0;
5357
const groups = [];
5458
let pendingLanes = [];
5559

60+
const addGroup = (group) => {
61+
const groupLanes = splitTokens(group.docker_lanes);
62+
if (
63+
hasExpandedSurvivorScenarios &&
64+
groupLanes.some((lane) => BASELINE_SHARDED_LANES.has(lane))
65+
) {
66+
group.timeout_minutes = 90;
67+
}
68+
groups.push(group);
69+
};
70+
5671
const flushPending = () => {
5772
if (pendingLanes.length === 0) {
5873
return;
5974
}
6075
const first = sanitizeLabel(pendingLanes[0]);
6176
const last = sanitizeLabel(pendingLanes[pendingLanes.length - 1]);
6277
const label = pendingLanes.length === 1 ? first : `${first}--${last}`;
63-
groups.push({ docker_lanes: pendingLanes.join(" "), label });
78+
addGroup({ docker_lanes: pendingLanes.join(" "), label });
6479
pendingLanes = [];
6580
};
6681

6782
for (const lane of selectedLanes) {
6883
if (BASELINE_SHARDED_LANES.has(lane) && baselineSpecs.length > 1) {
6984
flushPending();
7085
for (const baselineSpec of baselineSpecs) {
71-
groups.push({
86+
addGroup({
7287
docker_lanes: lane,
7388
label: `${sanitizeLabel(lane)}-${sanitizeLabel(baselineSpec)}`,
7489
published_upgrade_survivor_baselines: baselineSpec,
@@ -96,6 +111,7 @@ if (isMain) {
96111
groupSize: process.env.GROUP_SIZE,
97112
lanes: process.env.LANES,
98113
upgradeSurvivorBaselines: process.env.OPENCLAW_UPGRADE_SURVIVOR_BASELINE_SPECS,
114+
upgradeSurvivorScenarios: process.env.OPENCLAW_UPGRADE_SURVIVOR_SCENARIOS,
99115
}),
100116
),
101117
);

‎test/scripts/ci-workflow-guards.test.ts‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3127,6 +3127,15 @@ NODE
31273127
OPENCLAW_BUILD_PRIVATE_QA: "1",
31283128
OPENCLAW_ENABLE_PRIVATE_QA_CLI: "1",
31293129
});
3130+
const targetedGroupStep = releaseChecks.jobs.plan_docker_lane_groups.steps.find(
3131+
(step: WorkflowStep) => step.name === "Build targeted Docker lane groups",
3132+
);
3133+
expect(targetedGroupStep.env.OPENCLAW_UPGRADE_SURVIVOR_SCENARIOS).toBe(
3134+
"${{ inputs.published_upgrade_survivor_scenarios }}",
3135+
);
3136+
expect(releaseChecks.jobs.validate_docker_lanes["timeout-minutes"]).toBe(
3137+
"${{ matrix.group.timeout_minutes || 60 }}",
3138+
);
31303139
});
31313140

31323141
it("persists Node 22 declarations through trusted bounded artifacts", () => {

‎test/scripts/package-acceptance-workflow.test.ts‎

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,9 @@ function timeoutForProfile(
219219
if (typeof timeout === "number") {
220220
return timeout;
221221
}
222+
if (timeout === "${{ matrix.group.timeout_minutes || 60 }}") {
223+
return 60;
224+
}
222225
const match = timeout?.match(
223226
/^\$\{\{ inputs\.(?:release_profile|release_test_profile) == 'full' && ([0-9]+) \|\| ([0-9]+) \}\}$/u,
224227
);
@@ -238,6 +241,9 @@ function evaluatedJobTimeouts(path: string, jobName: string, job: WorkflowJob):
238241
timeoutForProfile(timeout, profile),
239242
);
240243
}
244+
if (timeout === "${{ matrix.group.timeout_minutes || 60 }}") {
245+
return [60, 90];
246+
}
241247
if (timeout !== "${{ matrix.timeout_minutes }}") {
242248
throw new Error(`Unsupported timeout for ${path}:${jobName}: ${String(timeout)}`);
243249
}
@@ -6342,16 +6348,22 @@ wait_for_run plugin-clawhub-new.yml 123 "${expectedSha}" || status=$?
63426348
timeoutForProfile(liveE2e.jobs?.validate_selected_ref?.["timeout-minutes"], profile),
63436349
timeoutForProfile(liveE2e.jobs?.prepare_docker_e2e_image?.["timeout-minutes"], profile),
63446350
timeoutForProfile(liveE2e.jobs?.docker_e2e_image_ready?.["timeout-minutes"], profile),
6345-
timeoutForProfile(liveE2e.jobs?.validate_docker_lanes?.["timeout-minutes"], profile),
6351+
Math.max(
6352+
...evaluatedJobTimeouts(
6353+
LIVE_E2E_WORKFLOW,
6354+
"validate_docker_lanes",
6355+
workflowJob(LIVE_E2E_WORKFLOW, "validate_docker_lanes"),
6356+
),
6357+
),
63466358
timeoutForProfile(packageAcceptance.jobs?.summary?.["timeout-minutes"], profile),
63476359
timeoutForProfile(releaseChecks.jobs?.summary?.["timeout-minutes"], profile),
63486360
],
63496361
]),
63506362
) as Record<(typeof profiles)[number], number[]>;
63516363
expect(releasePackagePaths).toEqual({
6352-
beta: [30, 15, 60, 10, 30, 60, 5, 60, 5, 5],
6353-
stable: [30, 15, 60, 10, 30, 60, 5, 60, 5, 5],
6354-
full: [30, 15, 60, 10, 30, 90, 5, 60, 5, 5],
6364+
beta: [30, 15, 60, 10, 30, 60, 5, 90, 5, 5],
6365+
stable: [30, 15, 60, 10, 30, 60, 5, 90, 5, 5],
6366+
full: [30, 15, 60, 10, 30, 90, 5, 90, 5, 5],
63556367
});
63566368
const releaseChecksParent = workflowJob(FULL_RELEASE_VALIDATION_WORKFLOW, "release_checks");
63576369
expect(releaseChecksParent["runs-on"]).toBe("blacksmith-4vcpu-ubuntu-2404");
@@ -6361,7 +6373,7 @@ wait_for_run plugin-clawhub-new.yml 123 "${expectedSha}" || status=$?
63616373
stable: releasePackagePaths.stable.reduce((total, timeout) => total + timeout, 0),
63626374
full: releasePackagePaths.full.reduce((total, timeout) => total + timeout, 0),
63636375
};
6364-
expect(releasePackageTimeouts).toEqual({ beta: 280, stable: 280, full: 310 });
6376+
expect(releasePackageTimeouts).toEqual({ beta: 310, stable: 310, full: 340 });
63656377
for (const [profile, childTimeout] of Object.entries(releasePackageTimeouts)) {
63666378
expect(childTimeout, `release-package:${profile}`).toBeLessThanOrEqual(420);
63676379
expect(420 - childTimeout, `release-package:${profile}`).toBeGreaterThanOrEqual(60);

‎test/scripts/plugin-prerelease-test-plan.test.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ function timeoutForProfile(
5353
if (typeof timeout === "number") {
5454
return timeout;
5555
}
56+
if (timeout === "${{ matrix.group.timeout_minutes || 60 }}") {
57+
return 60;
58+
}
5659
const match = timeout?.match(
5760
/^\$\{\{ inputs\.(?:release_profile|release_test_profile) == 'full' && ([0-9]+) \|\| ([0-9]+) \}\}$/u,
5861
);

‎test/scripts/targeted-docker-lane-groups.test.ts‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,29 @@ describe("scripts/plan-targeted-docker-lane-groups", () => {
6767
]);
6868
});
6969

70+
it("extends only groups containing expanded survivor lanes", () => {
71+
expect(
72+
planTargetedDockerLaneGroups({
73+
groupSize: 2,
74+
lanes:
75+
"doctor-switch published-upgrade-survivor plugins-offline update-migration plugin-update",
76+
upgradeSurvivorScenarios: "base plugin-deps-cleanup",
77+
}),
78+
).toEqual([
79+
{
80+
docker_lanes: "doctor-switch published-upgrade-survivor",
81+
label: "doctor-switch--published-upgrade-survivor",
82+
timeout_minutes: 90,
83+
},
84+
{
85+
docker_lanes: "plugins-offline update-migration",
86+
label: "plugins-offline--update-migration",
87+
timeout_minutes: 90,
88+
},
89+
{ docker_lanes: "plugin-update", label: "plugin-update" },
90+
]);
91+
});
92+
7093
it("rejects malformed group size values", () => {
7194
expect(() =>
7295
planTargetedDockerLaneGroups({

0 commit comments

Comments
 (0)