Merge branch 'main' into merge-scan-into-ingest-v1

This commit is contained in:
Andrey Avtomonov 2026-05-14 01:24:27 +02:00 committed by GitHub
commit 2fd2bfde98
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 273 additions and 21 deletions

View file

@ -54,6 +54,7 @@
"@types/better-sqlite3": "^7.6.13",
"@types/node": "^25.7.0",
"@types/react": "^19.2.14",
"@vitest/coverage-v8": "^4.1.6",
"better-sqlite3": "^12.10.0",
"ink-testing-library": "^4.0.0",
"typescript": "^6.0.3",

View file

@ -281,7 +281,7 @@ describe('runKtxDoctor', () => {
});
it('runs project checks against a valid ktx.yaml', async () => {
process.env.ANTHROPIC_API_KEY = 'test-key';
process.env.ANTHROPIC_API_KEY = 'test-key'; // pragma: allowlist secret
await writeFile(
join(tempDir, 'ktx.yaml'),
[
@ -306,7 +306,7 @@ describe('runKtxDoctor', () => {
].join('\n'),
'utf-8',
);
process.env.OPENAI_API_KEY = 'test-key';
process.env.OPENAI_API_KEY = 'test-key'; // pragma: allowlist secret
const testIo = makeIo();
await expect(
@ -419,7 +419,7 @@ describe('runKtxDoctor', () => {
});
it('warns when semantic-search embeddings are not configured', async () => {
process.env.ANTHROPIC_API_KEY = 'test-key';
process.env.ANTHROPIC_API_KEY = 'test-key'; // pragma: allowlist secret
await writeFile(
join(tempDir, 'ktx.yaml'),
[

View file

@ -1144,13 +1144,13 @@ describe('setup sources step', () => {
});
expect(discoverMetabaseDatabases).toHaveBeenCalledWith({
sourceUrl: 'https://metabase-new.example.com',
sourceApiKeyRef: 'env:METABASE_API_KEY',
sourceApiKeyRef: 'env:METABASE_API_KEY', // pragma: allowlist secret
sourceConnectionId: 'metabase-main',
});
expect((await readConfig()).connections['metabase-main']).toMatchObject({
driver: 'metabase',
api_url: 'https://metabase-new.example.com',
api_key_ref: 'env:METABASE_API_KEY',
api_key_ref: 'env:METABASE_API_KEY', // pragma: allowlist secret
mappings: {
databaseMappings: { '2': 'warehouse' },
syncEnabled: { '2': true },

View file

@ -168,9 +168,13 @@ describe('standalone built ktx CLI smoke', () => {
it('runs doctor setup through the built binary', async () => {
const result = await runBuiltCli(['status', '--no-input']);
expect(result.stdout).toMatch(/KTX (setup|project) doctor/);
expect(result.stdout).toContain('Node 22+');
expect(result.stdout).toContain('Workspace-local CLI');
expect(result.stdout).toMatch(/KTX (setup doctor|project doctor|status)/);
if (result.stdout.includes('No project here yet.')) {
expect(result.stdout).toContain('Before you can run ktx setup');
} else {
expect(result.stdout).toContain('Node 22+');
expect(result.stdout).toContain('Workspace-local CLI');
}
expect(result.stderr === '' || result.stderr.startsWith('Project: ')).toBe(true);
expect([0, 1]).toContain(result.code);
});