fix: expose AgentRun branch-follower CI reuse evidence
This commit is contained in:
@@ -114,6 +114,21 @@ export function runtimeReuseService(config: RuntimeReuseConfig | null, ids: read
|
||||
return config.services.find((service) => wanted.has(service.id)) ?? null;
|
||||
}
|
||||
|
||||
export function requiredReuseServiceError(reuseConfig: RuntimeReuseConfig, ids: readonly string[], mode: "runtimeReuse" | "envReuse"): string | null {
|
||||
const service = runtimeReuseService(reuseConfig, ids);
|
||||
if (service === null) return `${RUNTIME_REUSE_CONFIG_PATH} must declare service ${ids.join("|")}`;
|
||||
if (mode === "runtimeReuse") {
|
||||
if (service.runtimeReuse === null) return `${RUNTIME_REUSE_CONFIG_PATH} service ${service.id} must declare runtimeReuse`;
|
||||
if (service.runtimeReuse.enabled === false) return `${RUNTIME_REUSE_CONFIG_PATH} service ${service.id} runtimeReuse is disabled`;
|
||||
if (service.runtimeReuse.codeIdentityPaths.length === 0 && service.runtimeReuse.envIdentityPaths.length === 0) return `${RUNTIME_REUSE_CONFIG_PATH} service ${service.id} runtimeReuse must declare codeIdentity or envIdentity paths`;
|
||||
return null;
|
||||
}
|
||||
if (service.envReuse === null) return `${RUNTIME_REUSE_CONFIG_PATH} service ${service.id} must declare envReuse`;
|
||||
if (service.envReuse.enabled === false) return `${RUNTIME_REUSE_CONFIG_PATH} service ${service.id} envReuse is disabled`;
|
||||
if (service.envReuse.envIdentityFiles.length === 0 && service.envReuse.nodeDepsPath === null) return `${RUNTIME_REUSE_CONFIG_PATH} service ${service.id} envReuse must declare envIdentityFiles or nodeDepsPath`;
|
||||
return null;
|
||||
}
|
||||
|
||||
function parseServices(spec: Record<string, unknown>, errors: string[]): RuntimeReuseService[] {
|
||||
const raw = spec.services;
|
||||
const items = Array.isArray(raw)
|
||||
|
||||
Reference in New Issue
Block a user