Skip to content

Conversation

gagik
Copy link
Contributor

@gagik gagik commented Jul 29, 2025

Since we're removing the signin requirement from the AI features we do not hacve any components in need of the Atlas sign-in flows. As it's also built using a pattern we have deviated from, it's best to remove it now and re-add it through a different structure later if needed.

I'm relying on tests to ensure no unintentional functionality breaks but let me know if this has unintended effects on parts of Compass or DE that depend on auth for different reasons.

@gagik gagik changed the base branch from main to gagik/opt-in-ai July 29, 2025 08:53
@@ -60,18 +53,6 @@ export function configureStore(
)
);

options.atlasAuthService.on('signed-in', () => {
void store.dispatch(getUserInfo());
Copy link
Contributor Author

Choose a reason for hiding this comment

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

sanity check: this isn't necessary for data explorer-related thing is it?

Copy link
Collaborator

@mabaasit mabaasit Jul 30, 2025

Choose a reason for hiding this comment

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

On cloud we are always in logged in state, plus we don't have settings feature there.

I don't think we are now listening for these events anywhere else, so probably should be safe to clean that as well.

// because oidc options overlap with atlas login used for ai feature
isAIFeatureEnabled
) {
if (isOIDCEnabled) {
Copy link
Contributor Author

@gagik gagik Jul 29, 2025

Choose a reason for hiding this comment

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

if I understand right we still have OIDC logins(?). I'm not sure if any of the removed code may have been an unintentional dependency there.

@gagik gagik marked this pull request as ready for review July 29, 2025 08:57
@gagik gagik requested a review from a team as a code owner July 29, 2025 08:57
@gagik gagik changed the title WIP chore: remove Atlas Sign-In logic COMPASS-9595 chore: remove Atlas Sign-In logic COMPASS-9595 Jul 29, 2025
@mabaasit
Copy link
Collaborator

With this change, would Compass AI features work with the current atlas apis? Or does this change need api endpoint updates and backend in production?

@gagik
Copy link
Contributor Author

gagik commented Jul 30, 2025

@mabaasit Yeah, this change will need to use a different endpoint (the upcoming no-auth one @lerouxb is working on with MMS) so all of it will live in a feature branch for a while

@mabaasit
Copy link
Collaborator

@mabaasit Yeah, this change will need to use a different endpoint (the upcoming no-auth one @lerouxb is working on with MMS) so all of it will live in a feature branch for a while

Great, totally missed the target part in your comment. I see that you've removed atlas-login.test.ts in another PR, can you also clean up process.env.COMPASS_E2E_SKIP_ATLAS_SIGNIN now that we removed login.

@gagik
Copy link
Contributor Author

gagik commented Aug 4, 2025

@mabaasit I rename the environment variable to be about the AI opt-in, does that sound good?

@gagik gagik changed the base branch from gagik/opt-in-ai to main August 4, 2025 08:53
@gagik gagik changed the base branch from main to gagik/opt-in-ai August 4, 2025 08:53
@gagik
Copy link
Contributor Author

gagik commented Aug 4, 2025

I added a feature flag now so we will only want to do this cleanup after we actually release the feature.

@gagik gagik marked this pull request as draft August 4, 2025 14:57
Base automatically changed from gagik/opt-in-ai to main August 11, 2025 12:26
@lerouxb
Copy link
Contributor

lerouxb commented Aug 12, 2025

We also have to wait for the new endpoints to be released to production and enabled, probably on staging and QA: https://wiki.corp.mongodb.com/spaces/MMS/pages/285087612/Config+Service+Application+Property+Admin+UI

@gagik gagik force-pushed the gaigk/cleanup-atlas-login branch from be37538 to 080b6d3 Compare September 1, 2025 15:34
@gagik gagik marked this pull request as ready for review September 1, 2025 15:35
@Copilot Copilot AI review requested due to automatic review settings September 1, 2025 15:35
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 removes the Atlas Sign-In logic and UI components from Compass to support the removal of authentication requirements for AI features. The changes eliminate the sign-in modal, authentication state management, and related telemetry events while updating environment variable names to reflect the new opt-in only approach.

  • Removes Atlas sign-in modal components and authentication state management
  • Updates environment variables from COMPASS_E2E_SKIP_ATLAS_SIGNIN to COMPASS_E2E_SKIP_AI_OPT_IN
  • Eliminates sign-in related telemetry events and test files

Reviewed Changes

Copilot reviewed 22 out of 23 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/compass-telemetry/src/telemetry-events.ts Removes AI sign-in modal telemetry event types
packages/compass-settings/src/stores/settings.ts Removes atlas login attempt cancellation on modal close
packages/compass-settings/src/stores/index.ts Removes atlas login reducer and auth service event handlers
packages/compass-settings/src/stores/atlas-login.ts Completely removes atlas login state management
packages/compass-settings/src/components/settings/gen-ai-settings.tsx Removes atlas login UI component from Gen AI settings
packages/compass-settings/src/components/settings/gen-ai-settings.spec.tsx Removes atlas login related tests
packages/compass-settings/src/components/settings/atlas-login.tsx Removes entire atlas login settings component
packages/compass-settings/src/components/settings/atlas-login.spec.tsx Removes all atlas login component tests
packages/compass-settings/src/components/modal.tsx Removes atlas login initialization and AI feature condition
packages/compass-query-bar/src/stores/ai-query-reducer.ts Updates environment variable name for AI feature access
packages/compass-generative-ai/src/store/atlas-signin-reducer.ts Removes atlas sign-in state management reducer
packages/compass-generative-ai/src/store/atlas-signin-reducer.spec.ts Removes all atlas sign-in reducer tests
packages/compass-generative-ai/src/store/atlas-ai-store.ts Removes sign-in reducer and auth service event handlers
packages/compass-generative-ai/src/components/plugin.tsx Removes AI sign-in modal component
packages/compass-generative-ai/src/components/ai-signin-modal.tsx Removes entire AI sign-in modal component
packages/compass-generative-ai/src/atlas-ai-service.ts Updates environment variable name for AI feature check
packages/compass-e2e-tests/tests/collection-ai-query.test.ts Updates environment variable name in tests
packages/compass-e2e-tests/tests/atlas-login.test.ts Removes entire atlas login e2e test suite
packages/compass-e2e-tests/helpers/selectors.ts Removes atlas login related selectors
packages/compass-aggregations/src/modules/pipeline-builder/pipeline-ai.ts Updates environment variable name for AI feature access
docs/tracking-plan.md Removes AI sign-in modal telemetry events from documentation
docs/security-test-summary.md Removes atlas login integration test documentation

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

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