deploy(ai-discovery): add safe existing-service update path
This commit is contained in:
parent
7c3c8e9238
commit
2739104088
14 changed files with 427 additions and 26 deletions
|
|
@ -7,7 +7,7 @@ const path = require("node:path");
|
|||
const { processOne } = require("./deployment-event-worker");
|
||||
test("resident deployment agent consumes only an explicit immutable event and writes a receipt", async () => {
|
||||
const root = fs.mkdtempSync(path.join(os.tmpdir(), "lake-lamp-deploy-worker-")), queue = path.join(root, "queue"), receipts = path.join(root, "receipts"), sha = "a".repeat(40);
|
||||
fs.mkdirSync(queue); fs.writeFileSync(path.join(queue, "event.json"), JSON.stringify({ schema: "guanghu.deployment-event/v1", event_id: "event-1", state: "queued_for_resident_agent", repo: "bingshuo/guanghu-ice-heart", branch: "main", commit_sha: sha, workorder_id: "order-1", resource: `GLS-0239-DEPLOY@${sha}`, manifest: "deployment/requests/GLS-0239.json" }));
|
||||
fs.mkdirSync(queue); fs.writeFileSync(path.join(queue, "event.json"), JSON.stringify({ schema: "guanghu.deployment-event/v1", event_id: "event-1", state: "queued_for_resident_agent", repo: "bingshuo/guanghu-ice-heart", branch: "main", commit_sha: sha, workorder_id: "order-1", resource: `GLS-0239-DEPLOY@${sha}`, manifest: "deployment/requests/GLS-0239-DEPLOY.json" }));
|
||||
try {
|
||||
const result = await processOne({ queueDir: queue, receiptsDir: receipts, registry: { "bingshuo/guanghu-ice-heart": { repo_url: "https://example.invalid/code.git" } }, provisionFn: async request => { assert.equal(request.resource, `GLS-0239-DEPLOY@${sha}`); return { ok: true, unit: "example.service" }; } });
|
||||
assert.equal(result.state, "DEPLOYED_AND_VERIFIED");
|
||||
|
|
@ -27,7 +27,7 @@ test("resident agent rechecks source ownership before deployment", async () => {
|
|||
commit_sha: sha,
|
||||
workorder_id: "order-2",
|
||||
resource: `HLP-PERSONAL-DEPLOY@${sha}`,
|
||||
manifest: "deployment/requests/HLP-PERSONAL.json",
|
||||
manifest: "deployment/requests/HLP-PERSONAL-DEPLOY.json",
|
||||
authorizer_id: "ICE-GL∞",
|
||||
persona_id: "AGE-TEAM-001",
|
||||
execution_runtime_id: "SYS-GLW-ZY-EXEC-0001",
|
||||
|
|
|
|||
Loading…
Reference in a new issue