fix: reconcile server deployments across repository views
ForgeFlow quality gate / quality (push) Canceled after 0s
ForgeFlow quality gate / quality (push) Canceled after 0s
This commit is contained in:
@@ -168,7 +168,7 @@ test("server workload inventory links running containers to exact Gitea checkout
|
||||
);
|
||||
});
|
||||
|
||||
test("server discovery is read-only and explicit reconciliation adopts a verified deployment", async () => {
|
||||
test("low-level inventory scan is read-only and user discovery auto-links exact provenance", async () => {
|
||||
const b64 = (value) => Buffer.from(value).toString("base64");
|
||||
const sha = "b".repeat(40);
|
||||
const container = {
|
||||
@@ -218,17 +218,15 @@ test("server discovery is read-only and explicit reconciliation adopts a verifie
|
||||
sshUrl: "git@gitea.itworx.tech:Jens/Portfolio.git",
|
||||
},
|
||||
];
|
||||
const discovery = await service.discoverServerWorkloads("unraid", repositories);
|
||||
assert.equal(discovery.adopted, 0);
|
||||
assert.equal(discovery.verified, 0);
|
||||
const readOnlyDiscovery = await service.scanServerInventory("unraid", repositories);
|
||||
assert.equal(readOnlyDiscovery.adopted, 0);
|
||||
assert.equal(readOnlyDiscovery.verified, 0);
|
||||
assert.equal(profiles.length, 0);
|
||||
assert.equal(states.size, 0);
|
||||
|
||||
const preview = await service.planServerInventoryReconciliation("unraid", repositories, { autoLink: true });
|
||||
assert.equal(preview.plan.summary.additions, 1);
|
||||
const result = await service.reconcileServerInventory("unraid", repositories, { autoLink: true, expectedPlanId: preview.plan.id });
|
||||
assert.equal(result.adopted, 1);
|
||||
assert.equal(result.verified, 1);
|
||||
const discovery = await service.discoverServerWorkloads("unraid", repositories);
|
||||
assert.equal(discovery.adopted, 1);
|
||||
assert.equal(discovery.verified, 1);
|
||||
assert.equal(profiles[0].containerName, "Portfolio");
|
||||
assert.equal(profiles[0].adoptedFromServer, true);
|
||||
assert.equal(states.get(profiles[0].id).matchesGitea, true);
|
||||
|
||||
Reference in New Issue
Block a user