fix: require current-main deploy desired state

This commit is contained in:
unidesk-code-queue-runner
2026-05-23 04:22:19 +00:00
committed by Code Queue Review
parent b9b625c4e8
commit fff45edf4c
11 changed files with 198 additions and 166 deletions
@@ -277,6 +277,18 @@ test("target tag review is read-only promotion_pending when current state is uni
assert.match(plan.services[0].promotion.deployImage, /:def5678$/u);
});
test("target check blocks when current desired-state is uniformly older", async () => {
const repoRoot = await makeFixture();
const plan = await buildDesiredStatePlan({ repoRoot, targetTag: "def5678", requireTargetConvergence: true });
assert.equal(plan.status, "blocked");
assert.equal(plan.target.convergence.state, "target_mismatch");
assert.equal(plan.target.convergenceRequirement, "target-check");
assert.ok(plan.diagnostics.some((diagnostic) =>
diagnostic.code === "target_desired_state_mismatch" &&
diagnostic.message.includes("stale desired-state is not pinned")
));
});
test("promotion commit check blocks when current desired-state is uniformly older", async () => {
const repoRoot = await makeFixture();
const plan = await buildDesiredStatePlan({ repoRoot, promotionCommit: "def5678" });