Remove legacy runtime deployment paths
This commit is contained in:
@@ -320,26 +320,9 @@ function validateDependencyPlans(manifest: unknown): string[] {
|
||||
}
|
||||
|
||||
function validateServerDeploymentProfiles(manifest: unknown): string[] {
|
||||
if (typeof manifest !== "object" || manifest === null || !("server" in manifest)) return [];
|
||||
const record = manifest as { server?: { createFields?: Array<{ key?: string }> }; runtimeProfiles?: { serverDeployments?: Array<any> } };
|
||||
const declaredFields = new Set((record.server?.createFields ?? []).map((field) => field.key).filter((key): key is string => Boolean(key)));
|
||||
const errors: string[] = [];
|
||||
for (const [index, profile] of (record.runtimeProfiles?.serverDeployments ?? []).entries()) {
|
||||
const location = `manifest.runtimeProfiles.serverDeployments[${index}]`;
|
||||
const mappingKeys = new Set<string>();
|
||||
for (const [mappingIndex, mapping] of (profile.configMappings ?? []).entries()) {
|
||||
const mappingLocation = `${location}.configMappings[${mappingIndex}]`;
|
||||
if (!declaredFields.has(mapping.fieldKey)) errors.push(`${mappingLocation}.fieldKey: must reference a declared server.createFields key`);
|
||||
if (mappingKeys.has(mapping.fieldKey)) errors.push(`${mappingLocation}.fieldKey: duplicate mapping`);
|
||||
mappingKeys.add(mapping.fieldKey);
|
||||
}
|
||||
const requiredChecks = new Set(["executable.present", "port.bound", "config.readable", "process.healthy"]);
|
||||
for (const check of profile.verificationChecks ?? []) {
|
||||
if (check.required) requiredChecks.delete(check.kind);
|
||||
}
|
||||
for (const missing of requiredChecks) errors.push(`${location}.verificationChecks: required check ${missing} is missing`);
|
||||
}
|
||||
return errors;
|
||||
if (typeof manifest !== "object" || manifest === null || !("server" in manifest)) return [];
|
||||
const record = manifest as { runtimeProfiles?: { serverDeployments?: unknown } };
|
||||
return record.runtimeProfiles?.serverDeployments === undefined ? [] : ["manifest.runtimeProfiles.serverDeployments: legacy server deployment profiles are no longer supported"];
|
||||
}
|
||||
|
||||
function validateUnsupportedLegacyClientManagerDeclarations(manifest: unknown): string[] {
|
||||
@@ -380,7 +363,7 @@ function validateDLLExtensionProfiles(manifest: unknown): string[] {
|
||||
targetKey?: string;
|
||||
modKey?: string;
|
||||
dllRef?: string;
|
||||
scumExecutableChecksum?: string;
|
||||
targetExecutableChecksum?: string;
|
||||
ue4ssAbi?: string;
|
||||
supportedTargets?: Array<{ os?: string; arch?: string }>;
|
||||
updateOnStart?: boolean;
|
||||
@@ -415,8 +398,8 @@ function validateDLLExtensionProfiles(manifest: unknown): string[] {
|
||||
errors.push(`${location}.releaseState: must be ready or unpublished`);
|
||||
}
|
||||
if (profile.releaseState === "ready") {
|
||||
if (!checksumPattern.test(profile.checksum ?? "") || !checksumPattern.test(profile.scumExecutableChecksum ?? "")) {
|
||||
errors.push(`${location}: release and SCUM executable SHA-256 checksums are required`);
|
||||
if (!checksumPattern.test(profile.checksum ?? "") || !checksumPattern.test(profile.targetExecutableChecksum ?? "")) {
|
||||
errors.push(`${location}: release and target executable SHA-256 checksums are required`);
|
||||
}
|
||||
if (!Number.isInteger(profile.sizeBytes) || (profile.sizeBytes ?? 0) < 1 || (profile.sizeBytes ?? 0) > 128 * 1024 * 1024) {
|
||||
errors.push(`${location}.sizeBytes: must be a bounded DLL size`);
|
||||
|
||||
Reference in New Issue
Block a user