From afa901b383c4f4011be8da45cad173f21db5abef Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Tue, 27 Aug 2024 19:10:15 +0200 Subject: [PATCH 1/2] fix(connection-storage): store `useApplicationLevelProxy` flag to disk COMPASS-8219 (#6158) --- .../compass-main-connection-storage.spec.ts | 30 +++++++++++++++++++ .../src/compass-main-connection-storage.ts | 1 + 2 files changed, 31 insertions(+) diff --git a/packages/connection-storage/src/compass-main-connection-storage.spec.ts b/packages/connection-storage/src/compass-main-connection-storage.spec.ts index c7ed59e02e9..ddd518c16cd 100644 --- a/packages/connection-storage/src/compass-main-connection-storage.spec.ts +++ b/packages/connection-storage/src/compass-main-connection-storage.spec.ts @@ -786,6 +786,36 @@ describe('ConnectionStorage', function () { expect(JSON.parse(content).connectionInfo.id).to.be.equal(id); }); + it('saves a connection with all ConnectionOptions set', async function () { + const id = new UUID().toString(); + const connectionOptions: Required = { + connectionString: 'mongodb://localhost:27017/', + sshTunnel: { host: 'localhost', port: 2222, username: 'foobar' }, + useApplicationLevelProxy: true, + oidc: {}, + fleOptions: { storeCredentials: false }, + lookup: () => ({} as any), + }; + await connectionStorage.save({ + connectionInfo: { + id, + connectionOptions, + }, + }); + delete (connectionOptions as any).lookup; // intentionally not stored + + const content = await fs.readFile( + getConnectionFilePath(tmpDir, id), + 'utf-8' + ); + expect( + JSON.parse(content).connectionInfo.connectionOptions + ).to.deep.equal(connectionOptions); + expect( + (await connectionStorage.load({ id }))?.connectionOptions + ).to.deep.equal(connectionOptions); + }); + it('saves a connection with arbitrary authMechanism', async function () { const id = new UUID().toString(); await connectionStorage.save({ diff --git a/packages/connection-storage/src/compass-main-connection-storage.ts b/packages/connection-storage/src/compass-main-connection-storage.ts index 3a6233f4a75..ea88376b7e8 100644 --- a/packages/connection-storage/src/compass-main-connection-storage.ts +++ b/packages/connection-storage/src/compass-main-connection-storage.ts @@ -77,6 +77,7 @@ const ConnectionSchema: z.Schema = z useSystemCA: z.boolean().optional(), // Unused but may be present in legacy files oidc: z.any().optional(), fleOptions: z.any().optional(), + useApplicationLevelProxy: z.boolean().optional(), }), }) .optional(), From 63c3e196a39879a3d25b8d653f9b399b4065d820 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Tue, 27 Aug 2024 21:43:49 +0200 Subject: [PATCH 2/2] fix(compass-e2e-tests): skip failing search index test COMPASS-8220 (#6160) --- packages/compass-e2e-tests/tests/search-indexes.test.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/compass-e2e-tests/tests/search-indexes.test.ts b/packages/compass-e2e-tests/tests/search-indexes.test.ts index 8a35bcd535b..dbe41df9ada 100644 --- a/packages/compass-e2e-tests/tests/search-indexes.test.ts +++ b/packages/compass-e2e-tests/tests/search-indexes.test.ts @@ -234,7 +234,10 @@ describe('Search Indexes', function () { await browser.dropIndex(indexName); }); - it('renders search indexes tab disabled', async function () { + // TODO(COMPASS-8220): Un-skip this test + (name === 'Atlas Free Cluster' + ? it.skip + : it)('renders search indexes tab disabled', async function () { const searchTab = await browser.$( Selectors.indexesSegmentedTab('search-indexes') );