Skip to content

Conversation

@lerouxb
Copy link
Contributor

@lerouxb lerouxb commented Aug 22, 2025

Some known issues with follow-up tickets:

@lerouxb lerouxb added the feature flagged PRs labeled with this label will not be included in the release notes of the next release label Aug 22, 2025
@github-actions github-actions bot added the feat label Aug 22, 2025
>
<Home {...props}></Home>
</CompassConnections>
<CompassAssistantProvider>
Copy link
Contributor Author

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();
Copy link
Contributor Author

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?

Copy link
Contributor

Choose a reason for hiding this comment

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

Seems fine to me

@lerouxb lerouxb force-pushed the connection-error-entrypoint branch from 03c03c2 to c5288cf Compare August 25, 2025 15:30
.$(Selectors.ConnectionModal)
.waitForDisplayed({ reverse: true });

// TODO(COMPASS-9746) the toasts should be swapped around before this can work
Copy link
Contributor Author

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.

@lerouxb lerouxb marked this pull request as ready for review August 25, 2025 15:32
Copilot AI review requested due to automatic review settings August 25, 2025 15:32
@lerouxb lerouxb requested a review from a team as a code owner August 25, 2025 15:32
Copy link
Contributor

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 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.

Copy link
Contributor

@gagik gagik left a 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?

@lerouxb lerouxb merged commit bb7cdac into main Aug 27, 2025
56 of 60 checks passed
@lerouxb lerouxb deleted the connection-error-entrypoint branch August 27, 2025 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat feature flagged PRs labeled with this label will not be included in the release notes of the next release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants