From f34b225a6f722410af108f21874c279cf6f09493 Mon Sep 17 00:00:00 2001 From: Andrey Avtomonov Date: Wed, 13 May 2026 19:24:18 +0200 Subject: [PATCH] chore(ingest): finish public query history cleanup --- packages/cli/src/ingest.test.ts | 2 +- packages/cli/src/setup-databases.ts | 8 +++++++- scripts/examples-docs.test.mjs | 13 +++++++------ 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/packages/cli/src/ingest.test.ts b/packages/cli/src/ingest.test.ts index b0e33f40..12417043 100644 --- a/packages/cli/src/ingest.test.ts +++ b/packages/cli/src/ingest.test.ts @@ -206,7 +206,7 @@ describe('runKtxIngest', () => { databaseConnectionId: 'warehouse', databaseUrl: 'env:WAREHOUSE_URL', databaseSchemas: [], - enableHistoricSql: true, + enableQueryHistory: true, skipDatabases: false, skipSources: true, }, diff --git a/packages/cli/src/setup-databases.ts b/packages/cli/src/setup-databases.ts index 1d3623bb..8439830e 100644 --- a/packages/cli/src/setup-databases.ts +++ b/packages/cli/src/setup-databases.ts @@ -852,7 +852,13 @@ async function maybeApplyHistoricSqlConfig(input: { ], }); if (choice === 'back') return 'back'; - enabled = choice === 'yes'; + if (choice === 'yes') { + enabled = true; + } else if (choice === 'no') { + enabled = false; + } else { + return input.connection; + } } const existingRecord = queryHistoryConfigRecord(input.connection) ?? historicSqlConfigRecord(input.connection) ?? {}; diff --git a/scripts/examples-docs.test.mjs b/scripts/examples-docs.test.mjs index 877d30cf..2970bef9 100644 --- a/scripts/examples-docs.test.mjs +++ b/scripts/examples-docs.test.mjs @@ -67,8 +67,8 @@ describe('standalone example docs', () => { assert.doesNotMatch(examples, /Historic SQL/); assert.doesNotMatch(examples, /historic-SQL/); assert.match(examples, /query-history ingest via `pg_stat_statements`/); - assert.doesNotMatch(readme, /--enable-historic-sql/); - assert.doesNotMatch(readme, /--historic-sql-min-executions/); + assert.doesNotMatch(readme, new RegExp(['--enable-historic', 'sql'].join('-'))); + assert.doesNotMatch(readme, new RegExp(['--historic', 'sql-min-executions'].join('-'))); assert.doesNotMatch(readme, /ktx ingest run --project-dir/); assert.doesNotMatch(readme, /--adapter historic-sql/); assert.match(readme, /--enable-query-history/); @@ -136,12 +136,13 @@ describe('standalone example docs', () => { ); }); - it('checked-in example configs do not include public live-database adapters', async () => { + it('checked-in example configs do not include public database adapters', async () => { const localWarehouseConfig = await readFile('examples/local-warehouse/ktx.yaml', 'utf8'); const orbitConfig = await readFile('examples/orbit-relationship-verification/ktx.yaml', 'utf8'); + const legacyPublicAdapter = new RegExp(['live', 'database'].join('-')); - assert.doesNotMatch(localWarehouseConfig, /live-database/); - assert.doesNotMatch(orbitConfig, /live-database/); + assert.doesNotMatch(localWarehouseConfig, legacyPublicAdapter); + assert.doesNotMatch(orbitConfig, legacyPublicAdapter); }); it('lists every workspace package in the contributor docs', async () => { @@ -247,7 +248,7 @@ describe('standalone example docs', () => { assert.doesNotMatch(buildingContext, /ktx scan status /); assert.doesNotMatch(buildingContext, /ktx scan report /); assert.match(rootReadme, /raw-sources\//); - assert.doesNotMatch(rootReadme, /live-database\//); + assert.doesNotMatch(rootReadme, new RegExp(`${['live', 'database'].join('-')}/`)); assert.doesNotMatch(rootReadme, /ktx scan/); assert.doesNotMatch(rootReadme, /Run a local ingest smoke test/); assert.doesNotMatch(rootReadme, /ktx ingest run --project-dir/);