-
Notifications
You must be signed in to change notification settings - Fork 234
chore(compass-assistant): warn about non-genuine hosts COMPASS-9675 #7280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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.
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} |
Copilot
AI
Sep 4, 2025
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hehe atlastAiService
09c39e2
to
126d5c6
Compare
There was a problem hiding this 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.
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