Migrate Harbor state and traffic history to SQLite
Build and Deploy Gateway / build-and-push (push) Successful in 1m22s
Build and Deploy Gateway / deploy (push) Successful in 16s

This commit is contained in:
2026-09-10 19:21:21 +03:00
parent ab14fc979e
commit 1ae23d848b
48 changed files with 1703 additions and 446 deletions
+13 -1
View File
@@ -108,6 +108,13 @@ test('compiled dispatcher starts and stops control and dataplane contracts', asy
assert.equal(page.status, 200);
assert.match(page.type, /^text\/html/);
assert.match(page.body, /<div id="root"><\/div>/);
const historyResponse = await fetch(`http://127.0.0.1:${port}/api/traffic/history?range=90d`);
const history = await historyResponse.json();
assert.equal(historyResponse.status, 200);
assert.equal(history.storage.status, 'ready');
assert.equal(history.period.retentionDays, 90);
assert.deepEqual(history.rows, []);
assert.equal(fs.existsSync(path.join(controlData, 'harbor.sqlite')), true);
await stop(control.child);
const dataplane = start({
@@ -123,6 +130,11 @@ test('compiled dispatcher starts and stops control and dataplane contracts', asy
return response.status === 200 ? response.body : null;
}, dataplane.child, dataplane.stderr);
assert.equal(status.ready, true);
const gatewayHistory = await socketRequest(socketPath, '/traffic/history?range=7d');
assert.equal(gatewayHistory.status, 200);
assert.equal(gatewayHistory.body.storage.status, 'ready');
assert.equal(gatewayHistory.body.query.range, '7d');
assert.equal(fs.existsSync(path.join(dataplaneData, 'traffic.sqlite')), true);
await stop(dataplane.child);
});
@@ -148,7 +160,7 @@ test('production paths use only the compiled dispatcher', () => {
assert.doesNotMatch(entrypoint, /\/app\/src/);
}
assert.match(workflow, /npm run build:production/);
assert.match(workflow, /NODE_BUILD_IMAGE: mirror\.gcr\.io\/library\/node:20\.19-bookworm/);
assert.match(workflow, /NODE_BUILD_IMAGE: mirror\.gcr\.io\/library\/node:24\.21\.0-bookworm/);
assert.match(workflow, /command -v npm[^']+command -v git[^']+test -x \/bin\/bash/);
assert.doesNotMatch(workflow, /docker image inspect "\$\{\{ env\.NODE_BUILD_IMAGE \}\}"/);
assert.match(legacyBuild, /npm run build:production && docker build/);