fix(ci): support current QuickStack app write contract
Nuvisphere/Platform-CI: Immutable QuickStack OCI deployment / Build once and deploy exact digest (push) Successful in 4s
Platform CI tests / QuickStack deploy action tests (push) Successful in 6s

This commit is contained in:
2026-10-09 12:28:57 +02:00
parent ed7a5c0ff8
commit ac0ecb4181
2 changed files with 41 additions and 4 deletions
+35 -2
View File
@@ -297,6 +297,32 @@ test("preserves response-only fields and existing environment secrets safely", (
});
});
test("uses the current QuickStack write contract and preserves network policy rules", () => {
const policy = {
id: "policy-one", appId: "app-one", allowInternetAccess: false,
rules: [
{ id: "rule-app", type: "APP", targetAppId: "database", targetAgentId: null, port: 5432, protocol: "TCP", targetApp: {} },
{ id: "rule-agent", type: "AGENT", targetAppId: null, targetAgentId: "agent-one", port: 9000, protocol: "TCP", policyId: "policy-one" },
{ type: "APP", targetAppId: "dns", port: 53, protocol: "UDP" },
],
};
const payload = toSavePayload(app({ appNetworkPolicy: policy, networkPolicyMode: "legacy" }));
assert.deepEqual(payload.appNetworkPolicy, {
id: "policy-one", allowInternetAccess: false,
rules: [
{ id: "rule-app", type: "APP", targetAppId: "database", targetAgentId: null, port: 5432, protocol: "TCP" },
{ id: "rule-agent", type: "AGENT", targetAppId: null, targetAgentId: "agent-one", port: 9000, protocol: "TCP" },
{ type: "APP", targetAppId: "dns", port: 53, protocol: "UDP" },
],
});
for (const field of ["appPorts", "ingressNetworkPolicy", "egressNetworkPolicy", "networkPolicyMode"]) {
assert.equal(Object.hasOwn(payload, field), false);
}
assert.equal(toSavePayload(app()).appNetworkPolicy, null);
assert.deepEqual(toSavePayload(app({ appNetworkPolicy: { allowInternetAccess: true, rules: [] } })).appNetworkPolicy,
{ allowInternetAccess: true, rules: [] });
});
test("overrides only declared existing QuickStack volume mount paths", () => {
const volumes = [
{ id: "volume-local", sharedVolumeId: "shared-volume", containerMountPath: "/old" },
@@ -348,12 +374,19 @@ test("postflight waits for the exact expected identity", async () => {
});
test("failed public verification restores and redeploys the previous source", async () => {
const original = app();
const original = app({ appNetworkPolicy: {
id: "policy-one", allowInternetAccess: false,
rules: [{ id: "rule-one", type: "APP", targetAppId: "database", port: 5432, protocol: "TCP" }],
} });
let current = original;
let deployments = 0;
const client = {
getApp: async () => current,
saveApp: async (payload) => { current = { ...current, ...payload }; },
saveApp: async (payload) => {
assert.deepEqual(payload.appNetworkPolicy, original.appNetworkPolicy);
assert.equal(Object.hasOwn(payload, "appPorts"), false);
current = { ...current, ...payload };
},
deployApp: async () => ({ deploymentId: `deployment-${++deployments}` }),
getDeployment: async (_appId, deploymentId) => ({ deploymentId, status: "DEPLOYED" }),
};