-
Notifications
You must be signed in to change notification settings - Fork 237
fix(preferences): use one enableGenAISampleDocumentPassing preference CLOUDP-346490 #7351
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
fix(preferences): use one enableGenAISampleDocumentPassing preference CLOUDP-346490 #7351
Conversation
…ct preferences, only use enableGenAISampleDocumentPassing
'ENABLE_DATA_EXPLORER_GEN_AI_SAMPLE_DOCUMENT_PASSING' | ||
enableGenAISampleDocumentPassing: | ||
!groupEnabledFeatureFlags.includes( | ||
'DISABLE_DATA_EXPLORER_GEN_AI_SAMPLE_DOCUMENT_PASSING' |
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.
We use DISABLE_DATA_EXPLORER_GEN_AI_SAMPLE_DOCUMENT_PASSING
on web instead of ENABLE_DATA_EXPLORER_GEN_AI_SAMPLE_DOCUMENT_PASSING
. (Feature flags would only exist if they're set to true by default. Otherwise it would error in the backend, so we made the logic inverse 🙃 .)
https://jira.mongodb.org/browse/CLOUDP-290870
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 refactors the Gen AI sample document passing preference naming by consolidating from the verbose enableGenAISampleDocumentPassingOnAtlasProject
to the simpler enableGenAISampleDocumentPassing
, aligning with the original design intention.
- Simplifies preference naming by removing redundant "OnAtlasProject" suffix
- Updates preference references across multiple files and test cases
- Inverts the feature flag logic from "ENABLE" to "DISABLE" pattern
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
packages/compass-web/src/preferences.tsx | Updates default preference property name |
packages/compass-web/sandbox/sandbox-atlas-sign-in.tsx | Updates parameter type and inverts feature flag check logic |
packages/compass-web/sandbox/index.tsx | Updates parameter destructuring and preference property assignment |
packages/compass-preferences-model/src/preferences-schema.tsx | Removes the verbose preference definition from schema |
packages/compass-preferences-model/src/compass-web-preferences-access.ts | Updates editable preference key name |
packages/compass-generative-ai/src/components/ai-optin-modal.tsx | Updates usePreference call to use new preference name |
packages/compass-generative-ai/src/components/ai-optin-modal.spec.tsx | Updates test cases to use new preference name |
packages/compass-e2e-tests/tests/atlas-cloud/collection-ai-query.test.ts | Updates e2e test feature flag calls |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
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.
LGTM. Since we fixed the TS for compass web, next bump will have a compile error for the enableGenAISampleDocumentPassing
change in the props
CLOUDP-346490
Looks like we didn't follow having the
enableGenAISampleDocumentPassing
preference derivedenableGenAISampleDocumentPassingOnAtlasProject
as it was originally intended. This pr r. That should simplify things.This will require we update the preferences we pass in the props to
CompassWeb
:https://github.com/10gen/mms/blob/8552f2bc333a928a2c161e24a768f14cd60d02c6/client/packages/project/dataExplorerCompassWeb/router.tsx#L401