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
+8 -3
View File
@@ -349,7 +349,7 @@ function bindCallParameters(callable, argumentsList, callerEnvironment, callerFi
return environment;
}
export function createStyleWitnesses(sources, { entry = 'App' } = {}) {
export function createStyleWitnesses(sources, { entry = 'App', recursionLimits = {} } = {}) {
const files = sources.map(({ file, source }) => ({ file, source, parsed: parseWitnessFile(file, source) }));
const { definitions, definitionNodes } = componentDefinitions(files);
const entryDefinition = definitions.get(entry);
@@ -361,7 +361,11 @@ export function createStyleWitnesses(sources, { entry = 'App' } = {}) {
const dynamicByFile = dynamicClassBindings(files);
const witnesses = [];
const expand = (definition, ancestors, ancestorUnknown, environment, stack) => {
if (stack.includes(definition)) throw new TypeError(`Recursive JSX witness component: ${definition.node.id?.name || definition.file}`);
if (stack.includes(definition)) {
const limit = recursionLimits[definition.node.id?.name];
if (!Number.isInteger(limit) || limit < 1) throw new TypeError(`Recursive JSX witness component: ${definition.node.id?.name || definition.file}`);
if (stack.filter((item) => item === definition).length >= limit) return;
}
const nextStack = [...stack, definition];
const entryEnvironment = withLocalJsxBindings(definition.node.body, environment, definitionNodes, definition.file);
const visit = (
@@ -474,7 +478,8 @@ export function readStyleWitnesses(root) {
file,
source: fs.readFileSync(file, 'utf8'),
}));
return createStyleWitnesses(files);
// History has exactly service/domain/hostname/IP levels, not arbitrary JSX recursion.
return createStyleWitnesses(files, { recursionLimits: { HistoryRows: 4, HistoryBranch: 3 } });
}
const OBSERVED_PROPERTIES = new Set(`