refactor: reuse common ops primitives

This commit is contained in:
Codex
2026-06-14 17:59:45 +00:00
parent aa90eadfb2
commit 0c9735024e
4 changed files with 53 additions and 64 deletions
+2 -2
View File
@@ -1,4 +1,3 @@
import { createHash } from "node:crypto";
import { chmodSync, copyFileSync, existsSync, readFileSync, statSync, writeFileSync } from "node:fs";
import { join } from "node:path";
import { spawnSync } from "node:child_process";
@@ -25,6 +24,7 @@ import {
renderAgentRunGitopsFiles,
type AgentRunArtifactService,
} from "./agentrun-manifests";
import { sha256Fingerprint } from "./platform-infra-ops-library";
export function agentRunHelp(): unknown {
return {
@@ -3669,7 +3669,7 @@ function readSecretSourceValue(spec: AgentRunLaneSpec, source: LaneSecretSource)
redactedPath: sourceRef.startsWith("/") ? redactAbsoluteSecretPath(sourceRef) : `.state/secrets/${sourceRef}`,
value,
valueBytes: Buffer.byteLength(value, "utf8"),
fingerprint: `sha256:${createHash("sha256").update(value).digest("hex")}`,
fingerprint: sha256Fingerprint(value),
};
}