Update Harbor client and gateway functionality
Build and Deploy Gateway / build-and-push (push) Successful in 35s
Build and Deploy Gateway / deploy (push) Successful in 14s

This commit is contained in:
2026-08-17 15:23:16 +03:00
parent 0b39211fbd
commit 7c255192b0
41 changed files with 1443 additions and 218 deletions
+24
View File
@@ -67,6 +67,30 @@ test('typed Harbor client validates unknown state and isolates wire compatibilit
assert.equal(failed.transport.bootStatus, 'incompatible-api');
});
test('an old rules snapshot remains readable but keeps the mutation capability absent', () => {
const current = createStateSnapshot({
storedState: {
routeRules: [{ type: 'domain', value: 'example.com', enabled: true, outbound: 'direct' }],
appliedRouteRules: [{ type: 'domain', value: 'example.com', enabled: true, outbound: 'direct' }],
},
runtime: { running: true },
gatewayAuto: null,
appMode: 'client',
configExists: true,
now: new Date('2026-08-17T12:00:00.000Z'),
});
const legacy = structuredClone(current);
delete legacy.route.rulesContractVersion;
for (const rule of [...legacy.route.localRules, ...legacy.route.activeLocalRules]) delete rule.outbound;
const parsed = parseHarborState(legacy);
assert.equal(parsed.route.rulesContractVersion, undefined);
assert.deepEqual(parsed.route.localRules, [
{ type: 'domain', value: 'example.com', enabled: true, outbound: 'direct' },
]);
assert.equal(parseHarborState(current).route.rulesContractVersion, 2);
});
test('data invariant: an older polling promise cannot replace a newer mutation snapshot', async () => {
let state = receive(initialHarborState, snapshot(1, 'one'));
const poll = deferred();