-
Notifications
You must be signed in to change notification settings - Fork 229
chore(compass-preferences-model): use optInGenAIFeatures for Compass COMPASS-9593 #7129
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
base: feature/no-auth-ai
Are you sure you want to change the base?
Conversation
)}`; | ||
} | ||
|
||
describe('Atlas Login', function () { |
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 could also skip these if re-introducing is likely enough.
I also assume we're not going to delete stores/atlas-login
.
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 think you should clean it up, but I don't think you necessarily need to do it in this PR. This plugin was the first attempt at this sort of hight level cross plugin interface and implementation and so contains some patterns that we moved away from, it's probably for the better if we can completely drop it from the codebase
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.
added #7150 to handle the cleanup
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 standardizes the naming of the opt-in preference for AI features across Compass and Data Explorer by renaming optInDataExplorerGenAIFeatures
to optInGenAIFeatures
. This aligns the naming convention between the two products and makes the preference more generic and reusable.
- Renames preference key from
optInDataExplorerGenAIFeatures
tooptInGenAIFeatures
- Updates preference description to be more generic
- Changes default value from
true
tofalse
- Updates all references and tests to use the new preference name
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
packages/compass-web/src/preferences.tsx | Updates preference name in default preferences object |
packages/compass-web/sandbox/sandbox-atlas-sign-in.tsx | Updates type definition and variable assignment for the new preference name |
packages/compass-web/sandbox/index.tsx | Updates preference name in sandbox configuration |
packages/compass-preferences-model/src/preferences-schema.tsx | Defines the new preference schema with updated name, description, and default value |
packages/compass-preferences-model/src/compass-web-preferences-access.ts | Updates editable preferences list with new name |
packages/compass-generative-ai/src/store/atlas-optin-reducer.ts | Updates preference checks and method calls to use new naming |
packages/compass-generative-ai/src/store/atlas-optin-reducer.spec.ts | Updates all test cases to use new preference and method names |
packages/compass-generative-ai/src/atlas-ai-service.ts | Refactors opt-in method and removes unnecessary imports |
packages/compass-generative-ai/src/atlas-ai-service.spec.ts | Adds comprehensive tests for the new opt-in method |
packages/compass-e2e-tests/tests/atlas-login.test.ts | Removes entire test file |
packages/compass-e2e-tests/tests/atlas-cloud/collection-ai-query.test.ts | Updates feature flag references to use new preference name |
// Performs a post request to Atlas to set the user opt in preference to true. | ||
await this.atlasService.authenticatedFetch( | ||
this.atlasService.cloudEndpoint( | ||
'settings/optInDataExplorerGenAIFeatures' |
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.
The URL path still references 'optInDataExplorerGenAIFeatures' but the preference has been renamed to 'optInGenAIFeatures'. Consider updating the API endpoint to match the new naming convention for consistency.
'settings/optInDataExplorerGenAIFeatures' | |
'settings/optInGenAIFeatures' |
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.
This is how we ensure backwards-compatibility
}, | ||
validator: z.boolean().default(true), | ||
validator: z.boolean().default(false), |
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.
Changing the default value from true
to false
is a breaking change that could affect existing users who had the feature enabled by default. This could disable AI features for users who were previously opted in.
validator: z.boolean().default(false), | |
validator: z.boolean().default(true), |
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.
This was likely an unintentional default which always gets overriden by the 'settings/optInDataExplorerGenAIFeatures'
fetch
}, | ||
validator: z.boolean().default(true), | ||
validator: z.boolean().default(false), |
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.
correct me if not so but this change shouldn't have any side effects on DE. The state of this was always being overriden by the API request and we'd likely not have wanted this to be true anyhow.
This is targetted against a feature branch: https://github.com/mongodb-js/compass/tree/feature/no-auth-ai
Aligns Compass and DE in their opt-in requirements for AI features.
This might need to be merged into a feature flag branch