feat: add JD01 YAML-first deployment support

This commit is contained in:
Codex
2026-06-29 08:13:34 +00:00
parent fe917bec4a
commit 076c4b643d
49 changed files with 10909 additions and 5223 deletions
+23
View File
@@ -54,6 +54,7 @@ export interface AgentRunLaneSpec {
readonly nodeKubeRoute: string;
readonly version: string;
readonly source: {
readonly statusMode: "host-worktree" | "k3s-git-mirror";
readonly repository: string;
readonly branch: string;
readonly bootstrapFromBranch: string | null;
@@ -76,6 +77,7 @@ export interface AgentRunLaneSpec {
readonly serviceAccountName: string;
readonly registryPrefix: string;
readonly toolsImage: string;
readonly buildkitImage: string | null;
};
readonly gitops: {
readonly branch: string;
@@ -123,6 +125,10 @@ export interface AgentRunLaneSpec {
readonly image: string | null;
readonly storage: string | null;
readonly port: number | null;
readonly database: string | null;
readonly user: string | null;
readonly passwordSourceRef: string | null;
readonly passwordSourceKey: string | null;
};
};
readonly gitMirror: {
@@ -271,6 +277,7 @@ export function agentRunLaneSummary(spec: AgentRunLaneSpec): Record<string, unkn
source: {
repository: spec.source.repository,
branch: spec.source.branch,
statusMode: spec.source.statusMode,
bootstrapFromBranch: spec.source.bootstrapFromBranch,
bootstrapTimeoutSeconds: spec.source.bootstrapTimeoutSeconds,
bootstrapPollSeconds: spec.source.bootstrapPollSeconds,
@@ -289,6 +296,7 @@ export function agentRunLaneSummary(spec: AgentRunLaneSpec): Record<string, unkn
pipelineRunPrefix: spec.ci.pipelineRunPrefix,
serviceAccountName: spec.ci.serviceAccountName,
registryPrefix: spec.ci.registryPrefix,
buildkitImage: spec.ci.buildkitImage,
},
gitops: {
branch: spec.gitops.branch,
@@ -491,6 +499,7 @@ function parseLane(lane: string, node: AgentRunNodeSpec, input: Record<string, u
nodeKubeRoute: node.kubeRoute,
version: stringField(input, "version", path),
source: {
statusMode: sourceStatusModeField(optionalStringField(source, "statusMode", `${path}.source`) ?? "host-worktree", `${path}.source.statusMode`),
repository: stringField(source, "repository", `${path}.source`),
branch: stringField(source, "branch", `${path}.source`),
bootstrapFromBranch: optionalStringField(source, "bootstrapFromBranch", `${path}.source`) ?? null,
@@ -513,6 +522,7 @@ function parseLane(lane: string, node: AgentRunNodeSpec, input: Record<string, u
serviceAccountName: stringField(ci, "serviceAccountName", `${path}.ci`),
registryPrefix: stringField(ci, "registryPrefix", `${path}.ci`),
toolsImage: stringField(ci, "toolsImage", `${path}.ci`),
buildkitImage: optionalStringField(ci, "buildkitImage", `${path}.ci`) ?? null,
},
gitops: {
branch: stringField(gitops, "branch", `${path}.gitops`),
@@ -544,6 +554,11 @@ function parseLane(lane: string, node: AgentRunNodeSpec, input: Record<string, u
};
}
function sourceStatusModeField(value: string, path: string): "host-worktree" | "k3s-git-mirror" {
if (value !== "host-worktree" && value !== "k3s-git-mirror") throw new Error(`${path} must be host-worktree or k3s-git-mirror`);
return value;
}
function parseDeployment(input: Record<string, unknown>, path: string): AgentRunLaneSpec["deployment"] {
const argocd = recordField(input, "argocd", path);
const manager = recordField(input, "manager", path);
@@ -660,6 +675,10 @@ function parseLocalPostgres(input: Record<string, unknown>, path: string): Agent
image: optionalStringField(input, "image", path) ?? null,
storage: optionalStringField(input, "storage", path) ?? null,
port: optionalIntegerField(input, "port", path) ?? null,
database: optionalStringField(input, "database", path) ?? null,
user: optionalStringField(input, "user", path) ?? null,
passwordSourceRef: optionalStringField(input, "passwordSourceRef", path) ?? null,
passwordSourceKey: optionalStringField(input, "passwordSourceKey", path) ?? null,
};
}
return {
@@ -668,6 +687,10 @@ function parseLocalPostgres(input: Record<string, unknown>, path: string): Agent
image: stringField(input, "image", path),
storage: stringField(input, "storage", path),
port: integerField(input, "port", path),
database: stringField(input, "database", path),
user: stringField(input, "user", path),
passwordSourceRef: secretSourceRefField(input, "passwordSourceRef", path),
passwordSourceKey: stringField(input, "passwordSourceKey", path),
};
}