-
Notifications
You must be signed in to change notification settings - Fork 244
feat(compass-assistant): connection error entrypoint COMPASS-9605 #7224
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
packages/compass-connections/src/components/connection-status-notifications.tsx
Outdated
Show resolved
Hide resolved
| > | ||
| <Home {...props}></Home> | ||
| </CompassConnections> | ||
| <CompassAssistantProvider> |
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.
CompassAssistantProvider has to wrap CompassConnections so that CompassConnections has access to it.
| const connectionString = redactConnectionString( | ||
| connectionInfo.connectionOptions.connectionString | ||
| ); | ||
| const connectionError = error.toString(); |
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.
Do we want more than just the error as a string?
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.
Seems fine to me
03c03c2 to
c5288cf
Compare
| .$(Selectors.ConnectionModal) | ||
| .waitForDisplayed({ reverse: true }); | ||
|
|
||
| // TODO(COMPASS-9746) the toasts should be swapped around before this can work |
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.
I thought I could write this test and just swap the assertions for now, but the problem is the debug toast breaks the connect custom commands which look for the connection success/failure toast.
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 an AI assistant entrypoint for debugging connection errors in MongoDB Compass. When a connection attempt fails and the assistant is enabled, users will see a debug toast offering to help analyze the connection error using the assistant.
Key changes:
- Integration of the compass-assistant service into the connection flow
- New connection error prompt builder for the assistant
- UI changes to support the debug toast functionality
Reviewed Changes
Copilot reviewed 16 out of 17 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/connection-storage/package.json | Adds compass-assistant dependency |
| packages/compass/src/app/components/home.tsx | Moves CompassAssistantProvider to wrap connection components |
| packages/compass-explain-plan/package.json | Updates compass-assistant version |
| packages/compass-e2e-tests/tests/connection.test.ts | Adds test for connection error debug functionality |
| packages/compass-e2e-tests/helpers/selectors.ts | Adds selectors for assistant UI components |
| packages/compass-connections/src/stores/connections-store-redux.ts | Integrates assistant service to show debug toast on connection errors |
| packages/compass-connections/src/stores/connections-store-redux.spec.tsx | Adds test for debug toast behavior |
| packages/compass-connections/src/index.tsx | Adds compass assistant service dependency |
| packages/compass-connections/src/components/connection-status-notifications.tsx | Implements debug toast UI component |
| packages/compass-connections/package.json | Adds compass-assistant dependency |
| packages/compass-assistant/src/prompts.ts | Adds connection error prompt builder |
| packages/compass-assistant/src/index.tsx | Exports service locator and types |
| packages/compass-assistant/src/compass-assistant-provider.tsx | Implements connection error interpretation functionality |
| packages/compass-assistant/src/compass-assistant-provider.spec.tsx | Updates test data-testid references |
| packages/compass-assistant/src/compass-assistant-drawer.tsx | Adds test id to confirmation modal |
| packages/compass-assistant/package.json | Adds connection-info and mongodb-connection-string-url dependencies |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
packages/compass-connections/src/components/connection-status-notifications.tsx
Outdated
Show resolved
Hide resolved
gagik
left a comment
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.
I assume a lot of these tests will break with the latest main. Maybe I can open a refactor PR and we can rebase this?
Some known issues with follow-up tickets: