Skip to content

Conversation

gagik
Copy link
Contributor

@gagik gagik commented Sep 4, 2025

Screenshot 2025-09-04 at 11 55 25 AM

Local Testing

If you want to test this locally, you can add
127.0.0.1 docdb-elastic.amazonaws.com
to your /etc/hosts/
and connect to mongodb://docdb-elastic.amazonaws.com:27017

@Copilot Copilot AI review requested due to automatic review settings September 4, 2025 09:55
@gagik gagik requested a review from a team as a code owner September 4, 2025 09:55
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds functionality to warn users when connected to non-genuine MongoDB hosts (like DocumentDB or CosmosDB) in the Compass Assistant. The warning message persists even when the chat is cleared to ensure users are consistently informed about limitations when using non-genuine MongoDB servers.

  • Adds a preset warning message for non-genuine MongoDB connections
  • Implements logic to automatically show/hide warnings based on connection status
  • Modifies chat clearing behavior to preserve permanent warning messages

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
preset-messages.ts Defines the non-genuine MongoDB warning message with permanent metadata
compass-assistant-provider.tsx Adds isPermanent metadata field and updates clear chat logic to preserve permanent messages
compass-assistant-provider.spec.tsx Updates test structure and adds test for persistent warning messages during chat clearing
assistant-chat.tsx Implements automatic warning message management based on connection genuineness
assistant-chat.spec.tsx Adds comprehensive tests for non-genuine host warning behavior

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines 255 to 265
atlastAiService,
}: {
chat: Chat<AssistantMessage>;
atlastAiService?: Partial<AtlasAiService>;
},
{ connections }: { connections?: ConnectionInfo[] } = {}
): Promise<ReturnType<typeof render>> {
const result = render(
<TestComponent
chat={mockChat}
mockAtlasAiService={mockAtlasAiService}
chat={chat}
mockAtlasAiService={atlastAiService}
Copy link

Copilot AI Sep 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable name has a typo: 'atlastAiService' should be 'atlasAiService' (missing 's' in 'atlas').

Copilot uses AI. Check for mistakes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hehe atlastAiService

@gagik gagik marked this pull request as draft September 4, 2025 10:41
@gagik gagik marked this pull request as ready for review September 4, 2025 11:27
@gagik gagik force-pushed the gagik/assistant-non-genuine branch from 09c39e2 to 126d5c6 Compare September 4, 2025 11:27
Copy link
Contributor

@lerouxb lerouxb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Once the circular deps and check issues are resolved.

@gagik gagik merged commit 115830e into main Sep 4, 2025
49 of 50 checks passed
@gagik gagik deleted the gagik/assistant-non-genuine branch September 4, 2025 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants