mirror of
https://github.com/openclaw/openclaw.git
synced 2026-10-03 01:29:56 +00:00
refactor(scripts): deslop update parsing and provider routing (#163098)
Reuse the existing package-version resolver, metadata parser, and log-version reader. Combine the identical CI provider branches while retaining provider ordering and platform policy. Validation: 162 tests across three focused suites passed on Blacksmith Testbox; both import-cycle checks reported zero. The committed patch matches the reviewed and remote-tested patch.
This commit is contained in:
parent
b7b57578d6
commit
f25b0f6d52
2 changed files with 3 additions and 21 deletions
|
|
@ -48,7 +48,6 @@ export function crabboxProviderChain({
|
|||
const cloudFallback = ["azure", "aws"];
|
||||
switch (workload) {
|
||||
case "ci-fast":
|
||||
return available(["blacksmith-testbox", "daytona", ...cloudFallback], providers);
|
||||
case "ci-proof":
|
||||
case "release-proof":
|
||||
return available(["blacksmith-testbox", "daytona", ...cloudFallback], providers);
|
||||
|
|
|
|||
|
|
@ -574,14 +574,6 @@ function openClawVersionFamily(version: string): string {
|
|||
return /^(\d{4}\.\d{1,2}\.\d{1,2})(?:[-.]|$)/u.exec(version.trim())?.[1] ?? "";
|
||||
}
|
||||
|
||||
function parseOpenClawPackageSpecVersion(spec: string): string {
|
||||
const value = spec.trim();
|
||||
if (!value) {
|
||||
return "";
|
||||
}
|
||||
return resolveOpenClawRegistryVersion(value) || "";
|
||||
}
|
||||
|
||||
export function parseRegistryPackageMetadata(raw: string): {
|
||||
gitHead: string;
|
||||
tarball: string;
|
||||
|
|
@ -979,10 +971,7 @@ export class NpmUpdateSmoke {
|
|||
const output = run("npm", ["view", spec, "version", "dist.tarball", "gitHead", "--json"], {
|
||||
check: false,
|
||||
quiet: true,
|
||||
}).stdout.trim();
|
||||
if (!output) {
|
||||
return { gitHead: "", tarball: "", version: "" };
|
||||
}
|
||||
}).stdout;
|
||||
return parseRegistryPackageMetadata(output);
|
||||
}
|
||||
|
||||
|
|
@ -1005,7 +994,7 @@ export class NpmUpdateSmoke {
|
|||
const platform = this.platformFromLabel(job.label);
|
||||
const status = (await job.promise) === 0 ? "pass" : "fail";
|
||||
this.updateStatus[platform] = status;
|
||||
this.updateVersion[platform] = await this.extractLastVersion(job.logPath);
|
||||
this.updateVersion[platform] = await extractLastOpenClawVersionFromLog(job.logPath);
|
||||
this.recordTiming("update", job, status);
|
||||
if (status !== "pass") {
|
||||
this.dumpLogTail(job.logPath);
|
||||
|
|
@ -1434,10 +1423,6 @@ export class NpmUpdateSmoke {
|
|||
return label.toLowerCase() as Platform;
|
||||
}
|
||||
|
||||
private async extractLastVersion(logPath: string): Promise<string> {
|
||||
return await extractLastOpenClawVersionFromLog(logPath);
|
||||
}
|
||||
|
||||
private dumpLogTail(logPath: string): void {
|
||||
const log = run("tail", ["-n", "80", logPath], { check: false, quiet: true }).stdout;
|
||||
if (log) {
|
||||
|
|
@ -1565,9 +1550,7 @@ export class NpmUpdateSmoke {
|
|||
}
|
||||
const candidateVersion =
|
||||
this.targetTarballVersion ||
|
||||
(this.freshTargetSpec
|
||||
? parseOpenClawPackageSpecVersion(this.freshTargetSpec)
|
||||
: parseOpenClawPackageSpecVersion(this.options.updateTarget));
|
||||
resolveOpenClawRegistryVersion(this.freshTargetSpec || this.options.updateTarget);
|
||||
const targetFamily = openClawVersionFamily(candidateVersion);
|
||||
if (!targetFamily) {
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue