feat: declare HWLAB production release lane
This commit is contained in:
@@ -8,7 +8,7 @@ import { runCommand, type CommandResult } from "./command";
|
||||
import { resolveCliChildJsonCommandResult } from "./cli-child-json-recovery";
|
||||
import { resolveAgentRunLaneTarget, type AgentRunLaneSpec } from "./agentrun-lanes";
|
||||
import { resolveSecretSourceRoot } from "./agentrun/secrets";
|
||||
import { hwlabRuntimeLaneSpecForNode, isHwlabRuntimeLane, type HwlabRuntimeLane, type HwlabRuntimeLaneSpec } from "./hwlab-node-lanes";
|
||||
import { hwlabRuntimeLaneIds, hwlabRuntimeLaneSpecForNode, isHwlabRuntimeLane, type HwlabRuntimeLane, type HwlabRuntimeLaneSpec } from "./hwlab-node-lanes";
|
||||
import { parseEnvFile, sha256Fingerprint, shQuote } from "./platform-infra-ops-library";
|
||||
|
||||
type FakeModelProviderAction = "plan" | "materialize" | "apply" | "status" | "smoke";
|
||||
@@ -149,7 +149,7 @@ function parseFakeModelProviderOptions(args: string[]): FakeModelProviderOptions
|
||||
const node = requiredOption(args, "--node");
|
||||
if (!/^[A-Z][A-Z0-9_-]*$/u.test(node)) throw new Error("--node must be a simple node id such as NC01");
|
||||
const laneRaw = requiredOption(args, "--lane");
|
||||
if (!isHwlabRuntimeLane(laneRaw)) throw new Error(`--lane must be one of v02, v03; got ${laneRaw}`);
|
||||
if (!isHwlabRuntimeLane(laneRaw)) throw new Error(`--lane must be one of ${hwlabRuntimeLaneIds().join(", ")}; got ${laneRaw}`);
|
||||
const provider = optionValue(args, "--provider") ?? "fake-echo";
|
||||
if (!/^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/u.test(provider)) throw new Error("--provider must be a Kubernetes-safe id");
|
||||
const confirm = args.includes("--confirm");
|
||||
|
||||
@@ -78,6 +78,11 @@ export interface HwlabRuntimeExternalPostgresRuntimeAccessSpec {
|
||||
readonly port: number;
|
||||
}
|
||||
|
||||
export interface HwlabRuntimeExternalPostgresMigrationLedgerSpec {
|
||||
readonly identity: string;
|
||||
readonly table: string;
|
||||
}
|
||||
|
||||
export interface HwlabRuntimeExternalPostgresSpec {
|
||||
readonly provider: string;
|
||||
readonly configRef: string;
|
||||
@@ -87,6 +92,7 @@ export interface HwlabRuntimeExternalPostgresSpec {
|
||||
readonly runtimeAccess?: HwlabRuntimeExternalPostgresRuntimeAccessSpec;
|
||||
readonly sslmode: "require";
|
||||
readonly database: string;
|
||||
readonly migrationLedger: HwlabRuntimeExternalPostgresMigrationLedgerSpec;
|
||||
readonly cloudApi: HwlabRuntimeExternalPostgresComponentSpec;
|
||||
readonly openfga: HwlabRuntimeExternalPostgresComponentSpec;
|
||||
}
|
||||
@@ -1415,6 +1421,14 @@ function externalPostgresRuntimeAccessConfig(value: unknown, path: string): Hwla
|
||||
};
|
||||
}
|
||||
|
||||
function externalPostgresMigrationLedgerConfig(value: unknown, path: string): HwlabRuntimeExternalPostgresMigrationLedgerSpec {
|
||||
const raw = asRecord(value, path);
|
||||
return {
|
||||
identity: stringField(raw, "identity", path),
|
||||
table: stringField(raw, "table", path),
|
||||
};
|
||||
}
|
||||
|
||||
function externalPostgresConfig(value: unknown, path: string): HwlabRuntimeExternalPostgresSpec | undefined {
|
||||
if (value === undefined) return undefined;
|
||||
const raw = asRecord(value, path);
|
||||
@@ -1429,6 +1443,7 @@ function externalPostgresConfig(value: unknown, path: string): HwlabRuntimeExter
|
||||
...(raw.runtimeAccess === undefined ? {} : { runtimeAccess: externalPostgresRuntimeAccessConfig(raw.runtimeAccess, `${path}.runtimeAccess`) }),
|
||||
sslmode,
|
||||
database: stringField(raw, "database", path),
|
||||
migrationLedger: externalPostgresMigrationLedgerConfig(raw.migrationLedger, `${path}.migrationLedger`),
|
||||
cloudApi: externalPostgresComponentConfig(raw.cloudApi, `${path}.cloudApi`),
|
||||
openfga: externalPostgresComponentConfig(raw.openfga, `${path}.openfga`),
|
||||
};
|
||||
|
||||
@@ -600,7 +600,7 @@ export function parseNodeObservabilityOptions(args: string[]): NodeObservability
|
||||
const node = requiredOption(args, "--node");
|
||||
assertNodeId(node);
|
||||
const laneRaw = requiredOption(args, "--lane");
|
||||
if (!isHwlabRuntimeLane(laneRaw)) throw new Error(`--lane must be one of v02, v03; got ${laneRaw}`);
|
||||
if (!isHwlabRuntimeLane(laneRaw)) throw new Error(`--lane must be one of ${hwlabRuntimeLaneIds().join(", ")}; got ${laneRaw}`);
|
||||
const confirm = args.includes("--confirm");
|
||||
const dryRun = args.includes("--dry-run");
|
||||
if (confirm && dryRun) throw new Error("observability accepts only one of --confirm or --dry-run");
|
||||
|
||||
@@ -55,7 +55,7 @@ export function parseNodeScopedDelegatedOptions(domain: DelegatedNodeDomain, arg
|
||||
const node = requiredOption(args, "--node");
|
||||
assertNodeId(node);
|
||||
const laneRaw = requiredOption(args, "--lane");
|
||||
if (!isHwlabRuntimeLane(laneRaw)) throw new Error(`--lane must be one of v02, v03; got ${laneRaw}`);
|
||||
if (!isHwlabRuntimeLane(laneRaw)) throw new Error(`--lane must be one of ${hwlabRuntimeLaneIds().join(", ")}; got ${laneRaw}`);
|
||||
const spec = hwlabRuntimeLaneSpecForNode(laneRaw, node);
|
||||
const confirm = args.includes("--confirm");
|
||||
const dryRun = args.includes("--dry-run");
|
||||
@@ -201,6 +201,7 @@ export function nodeRuntimeExpected(spec: HwlabRuntimeLaneSpec): Record<string,
|
||||
runtimeAccess: spec.externalPostgres.runtimeAccess ?? null,
|
||||
sslmode: spec.externalPostgres.sslmode,
|
||||
database: spec.externalPostgres.database,
|
||||
migrationLedger: spec.externalPostgres.migrationLedger,
|
||||
cloudApi: {
|
||||
secretName: spec.externalPostgres.cloudApi.secretName,
|
||||
secretKey: spec.externalPostgres.cloudApi.secretKey,
|
||||
|
||||
Reference in New Issue
Block a user