Skip to content

Commit 349974f

Browse files
committed
test(release): stage ACP companion for historical upgrades
1 parent 5ba4433 commit 349974f

3 files changed

Lines changed: 44 additions & 28 deletions

File tree

‎scripts/e2e/lib/upgrade-survivor/config-recipe.mts‎

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ type ConfigStep = {
1616
id: string;
1717
intent: string;
1818
argv: string[];
19+
prepublishPluginPackages?: string[];
1920
};
2021

2122
type BaselineAdaptationSummary = { skippedIntents: string[] };
@@ -178,12 +179,16 @@ const scenarioConfigSteps = new Map<string, ConfigStep[]>([
178179
[
179180
"acpx-openclaw-tools-bridge",
180181
[
181-
configSetJsonFile(
182-
"plugins-acpx-openclaw-tools-bridge",
183-
"acpx-openclaw-tools-bridge",
184-
"plugins",
185-
"plugins-acpx-openclaw-tools-bridge.json",
186-
),
182+
{
183+
...configSetJsonFile(
184+
"plugins-acpx-openclaw-tools-bridge",
185+
"acpx-openclaw-tools-bridge",
186+
"plugins",
187+
"plugins-acpx-openclaw-tools-bridge.json",
188+
),
189+
// The candidate externalizes this runtime even when the baseline bundles it.
190+
prepublishPluginPackages: ["@openclaw/acpx"],
191+
},
187192
],
188193
],
189194
[

‎scripts/lib/docker-e2e-plan.mts‎

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -528,26 +528,6 @@ function upgradeSurvivorBaselineVersionForLane(poolLane: DockerE2eLane): string
528528
return /(?:^|\/|@)(\d{4}\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?)$/u.exec(spec ?? "")?.[1] ?? null;
529529
}
530530

531-
function configuredChannelIdsForLane(poolLane: DockerE2eLane, scenario: string): Set<string> {
532-
const channelIds = new Set<string>();
533-
const baselineVersion = upgradeSurvivorBaselineVersionForLane(poolLane);
534-
const resolveConfigSteps = resolveUpgradeSurvivorConfigStepsForBaseline as (
535-
scenario: string,
536-
baselineVersion: string | null,
537-
) => ReturnType<typeof resolveUpgradeSurvivorConfigStepsForBaseline>;
538-
for (const step of resolveConfigSteps(scenario, baselineVersion)) {
539-
if (step.argv?.[0] !== "config" || step.argv?.[1] !== "set") {
540-
continue;
541-
}
542-
const match = /^channels\.([a-z0-9][a-z0-9-]*)$/u.exec(step.argv[2] ?? "");
543-
const channelId = match?.[1];
544-
if (channelId) {
545-
channelIds.add(channelId);
546-
}
547-
}
548-
return channelIds;
549-
}
550-
551531
export function requiredPrepublishPluginPackagesForLanes(poolLanes: DockerE2eLane[]): string[] {
552532
const configuredChannelIds = new Set<string>();
553533
const requiredPackages = new Set<string>();
@@ -562,8 +542,21 @@ export function requiredPrepublishPluginPackagesForLanes(poolLanes: DockerE2eLan
562542
for (const packageName of UPGRADE_SURVIVOR_RUNTIME_COMPANION_PACKAGES) {
563543
requiredPackages.add(packageName);
564544
}
565-
for (const channelId of configuredChannelIdsForLane(poolLane, scenario)) {
566-
configuredChannelIds.add(channelId);
545+
const steps = resolveUpgradeSurvivorConfigStepsForBaseline(
546+
scenario,
547+
upgradeSurvivorBaselineVersionForLane(poolLane),
548+
);
549+
for (const step of steps) {
550+
for (const packageName of step.prepublishPluginPackages ?? []) {
551+
requiredPackages.add(packageName);
552+
}
553+
if (step.argv[0] !== "config" || step.argv[1] !== "set") {
554+
continue;
555+
}
556+
const channelId = /^channels\.([a-z0-9][a-z0-9-]*)$/u.exec(step.argv[2] ?? "")?.[1];
557+
if (channelId) {
558+
configuredChannelIds.add(channelId);
559+
}
567560
}
568561
}
569562
for (const packageName of (officialExternalChannelCatalog.entries ?? [])

‎test/scripts/docker-e2e-plan.test.ts‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1735,6 +1735,24 @@ describe("scripts/lib/docker-e2e-plan", () => {
17351735
expect(requiredPrepublishPluginPackagesForLanes([selfUpgradeLane!])).toEqual([]);
17361736
});
17371737

1738+
it.each([
1739+
{
1740+
baseline: "2026.4.23",
1741+
packages: ["@openclaw/acpx", "@openclaw/codex", "@openclaw/discord", "@openclaw/whatsapp"],
1742+
},
1743+
{ baseline: "2026.4.15", packages: [] },
1744+
])(
1745+
"stages the ACP recipe companion only for supported baseline $baseline",
1746+
({ baseline, packages }) => {
1747+
const plan = planFor({
1748+
selectedLaneNames: ["published-upgrade-survivor"],
1749+
upgradeSurvivorBaselines: baseline,
1750+
upgradeSurvivorScenarios: "acpx-openclaw-tools-bridge",
1751+
});
1752+
expect(plan.requiredPrepublishPluginPackages).toEqual(packages);
1753+
},
1754+
);
1755+
17381756
it("does not request a prerelease plugin registry for unrelated lanes", () => {
17391757
const plan = planFor({ selectedLaneNames: ["doctor-switch"] });
17401758
expect(plan.requiredPrepublishPluginPackages).toEqual([]);

0 commit comments

Comments
 (0)