Skip to content

Commit 1eba5e1

Browse files
committed
Enables toggling new GenAI features for project settings
1 parent be63411 commit 1eba5e1

File tree

6 files changed

+670
-624
lines changed

6 files changed

+670
-624
lines changed

docs/command/atlas-projects-settings-describe.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ If the command succeeds, the CLI returns output similar to the following sample.
7171

7272
.. code-block::
7373

74-
COLLECT DATABASE SPECIFICS STATISTICS ENABLED DATA EXPLORER ENABLED PERFORMANCE ADVISOR ENABLED REALTIME PERFORMANCE PANEL ENABLED SCHEMA ADVISOR ENABLED
75-
<IsCollectDatabaseSpecificsStatisticsEnabled> <IsDataExplorerEnabled> <IsPerformanceAdvisorEnabled> <IsRealtimePerformancePanelEnabled> <IsSchemaAdvisorEnabled>
74+
COLLECT DATABASE SPECIFICS STATISTICS ENABLED DATA EXPLORER ENABLED DATA EXPLORER GEN AI FEATURES ENABLED DATA EXPLORER GEN AI SAMPLE DOCUMENT PASSING ENABLED PERFORMANCE ADVISOR ENABLED REALTIME PERFORMANCE PANEL ENABLED SCHEMA ADVISOR ENABLED
75+
<IsCollectDatabaseSpecificsStatisticsEnabled> <IsDataExplorerEnabled> <IsDataExplorerGenAIFeaturesEnabled> <IsDataExplorerGenAISampleDocumentPassingEnabled> <IsPerformanceAdvisorEnabled> <IsRealtimePerformancePanelEnabled> <IsSchemaAdvisorEnabled>
7676

7777

7878
Examples

docs/command/atlas-projects-settings-update.txt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,18 @@ Options
4747
- Flag that disables the Data Explorer project setting.
4848

4949
Mutually exclusive with --enableDataExplorer.
50+
* - --disableDataExplorerGenAIFeatures
51+
-
52+
- false
53+
- Flag that disables the Data Explorer GenAI Features project setting.
54+
55+
Mutually exclusive with --enableDataExplorerGenAIFeatures.
56+
* - --disableDataExplorerGenAISampleDocumentPassing
57+
-
58+
- false
59+
- Flag that disables the Data Explorer GenAI Sample Document Passing project setting.
60+
61+
Mutually exclusive with --enableDataExplorerGenAISampleDocumentPassing.
5062
* - --disablePerformanceAdvisor
5163
-
5264
- false
@@ -77,6 +89,18 @@ Options
7789
- Flag that enables the Data Explorer project setting.
7890

7991
Mutually exclusive with --disableDataExplorer.
92+
* - --enableDataExplorerGenAIFeatures
93+
-
94+
- false
95+
- Flag that enables the Data Explorer GenAI Features project setting.
96+
97+
Mutually exclusive with --disableDataExplorerGenAIFeatures.
98+
* - --enableDataExplorerGenAISampleDocumentPassing
99+
-
100+
- false
101+
- Flag that enables the Data Explorer GenAI Features project setting.
102+
103+
Mutually exclusive with --disableDataExplorerGenAISampleDocumentPassing.
80104
* - --enablePerformanceAdvisor
81105
-
82106
- false

internal/cli/projects/settings/describe.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ func (opts *DescribeOpts) initStore(ctx context.Context) func() error {
3838
}
3939
}
4040

41-
var describeTemplate = `COLLECT DATABASE SPECIFICS STATISTICS ENABLED DATA EXPLORER ENABLED PERFORMANCE ADVISOR ENABLED REALTIME PERFORMANCE PANEL ENABLED SCHEMA ADVISOR ENABLED
42-
{{.IsCollectDatabaseSpecificsStatisticsEnabled}} {{.IsDataExplorerEnabled}} {{.IsPerformanceAdvisorEnabled}} {{.IsRealtimePerformancePanelEnabled}} {{.IsSchemaAdvisorEnabled}}
41+
var describeTemplate = `COLLECT DATABASE SPECIFICS STATISTICS ENABLED DATA EXPLORER ENABLED DATA EXPLORER GEN AI FEATURES ENABLED DATA EXPLORER GEN AI SAMPLE DOCUMENT PASSING ENABLED PERFORMANCE ADVISOR ENABLED REALTIME PERFORMANCE PANEL ENABLED SCHEMA ADVISOR ENABLED
42+
{{.IsCollectDatabaseSpecificsStatisticsEnabled}} {{.IsDataExplorerEnabled}} {{.IsDataExplorerGenAIFeaturesEnabled}} {{.IsDataExplorerGenAISampleDocumentPassingEnabled}} {{.IsPerformanceAdvisorEnabled}} {{.IsRealtimePerformancePanelEnabled}} {{.IsSchemaAdvisorEnabled}}
4343
`
4444

4545
func (opts *DescribeOpts) Run() error {

internal/cli/projects/settings/update.go

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,21 @@ const updateTemplate = "Project settings updated.\n"
3131
type UpdateOpts struct {
3232
cli.ProjectOpts
3333
cli.OutputOpts
34-
store store.ProjectSettingsUpdater
35-
enableCollectDatabaseSpecificsStatistics bool
36-
disableCollectDatabaseSpecificsStatistics bool
37-
enableDataExplorer bool
38-
disableDataExplorer bool
39-
enablePerformanceAdvisor bool
40-
disablePerformanceAdvisor bool
41-
enableSchemaAdvisor bool
42-
disableSchemaAdvisor bool
43-
enableRealtimePerformancePanel bool
44-
disableRealtimePerformancePanel bool
34+
store store.ProjectSettingsUpdater
35+
enableCollectDatabaseSpecificsStatistics bool
36+
disableCollectDatabaseSpecificsStatistics bool
37+
enableDataExplorer bool
38+
disableDataExplorer bool
39+
enableDataExplorerGenAIFeatures bool
40+
disableDataExplorerGenAIFeatures bool
41+
enableDataExplorerGenAISampleDocumentPassing bool
42+
disableDataExplorerGenAISampleDocumentPassing bool
43+
enablePerformanceAdvisor bool
44+
disablePerformanceAdvisor bool
45+
enableSchemaAdvisor bool
46+
disableSchemaAdvisor bool
47+
enableRealtimePerformancePanel bool
48+
disableRealtimePerformancePanel bool
4549
}
4650

4751
func (opts *UpdateOpts) initStore(ctx context.Context) func() error {
@@ -63,11 +67,13 @@ func (opts *UpdateOpts) Run() error {
6367

6468
func (opts *UpdateOpts) newProjectSettings() *atlasv2.GroupSettings {
6569
return &atlasv2.GroupSettings{
66-
IsCollectDatabaseSpecificsStatisticsEnabled: cli.ReturnValueForSetting(opts.enableCollectDatabaseSpecificsStatistics, opts.disableCollectDatabaseSpecificsStatistics),
67-
IsDataExplorerEnabled: cli.ReturnValueForSetting(opts.enableDataExplorer, opts.disableDataExplorer),
68-
IsPerformanceAdvisorEnabled: cli.ReturnValueForSetting(opts.enablePerformanceAdvisor, opts.disablePerformanceAdvisor),
69-
IsRealtimePerformancePanelEnabled: cli.ReturnValueForSetting(opts.enableRealtimePerformancePanel, opts.disableRealtimePerformancePanel),
70-
IsSchemaAdvisorEnabled: cli.ReturnValueForSetting(opts.enableSchemaAdvisor, opts.disableSchemaAdvisor),
70+
IsCollectDatabaseSpecificsStatisticsEnabled: cli.ReturnValueForSetting(opts.enableCollectDatabaseSpecificsStatistics, opts.disableCollectDatabaseSpecificsStatistics),
71+
IsDataExplorerEnabled: cli.ReturnValueForSetting(opts.enableDataExplorer, opts.disableDataExplorer),
72+
IsDataExplorerGenAIFeaturesEnabled: cli.ReturnValueForSetting(opts.enableDataExplorerGenAIFeatures, opts.disableDataExplorerGenAIFeatures),
73+
IsDataExplorerGenAISampleDocumentPassingEnabled: cli.ReturnValueForSetting(opts.enableDataExplorerGenAISampleDocumentPassing, opts.disableDataExplorerGenAISampleDocumentPassing),
74+
IsPerformanceAdvisorEnabled: cli.ReturnValueForSetting(opts.enablePerformanceAdvisor, opts.disablePerformanceAdvisor),
75+
IsRealtimePerformancePanelEnabled: cli.ReturnValueForSetting(opts.enableRealtimePerformancePanel, opts.disableRealtimePerformancePanel),
76+
IsSchemaAdvisorEnabled: cli.ReturnValueForSetting(opts.enableSchemaAdvisor, opts.disableSchemaAdvisor),
7177
}
7278
}
7379

@@ -107,6 +113,14 @@ func UpdateBuilder() *cobra.Command {
107113
cmd.Flags().BoolVarP(&opts.disableDataExplorer, flag.DisableDataExplorer, "", false, usage.DisableDataExplorer)
108114
cmd.MarkFlagsMutuallyExclusive(flag.EnableDataExplorer, flag.DisableDataExplorer)
109115

116+
cmd.Flags().BoolVarP(&opts.enableDataExplorerGenAIFeatures, flag.EnableDataExplorerGenAIFeatures, "", false, usage.EnableDataExplorerGenAIFeatures)
117+
cmd.Flags().BoolVarP(&opts.disableDataExplorerGenAIFeatures, flag.DisableDataExplorerGenAIFeatures, "", false, usage.DisableDataExplorerGenAIFeatures)
118+
cmd.MarkFlagsMutuallyExclusive(flag.EnableDataExplorerGenAIFeatures, flag.DisableDataExplorerGenAIFeatures)
119+
120+
cmd.Flags().BoolVarP(&opts.enableDataExplorerGenAISampleDocumentPassing, flag.EnableDataExplorerGenAISampleDocumentPassing, "", false, usage.EnableDataExplorerGenAISampleDocumentPassing)
121+
cmd.Flags().BoolVarP(&opts.disableDataExplorerGenAISampleDocumentPassing, flag.DisableDataExplorerGenAISampleDocumentPassing, "", false, usage.DisableDataExplorerGenAISampleDocumentPassing)
122+
cmd.MarkFlagsMutuallyExclusive(flag.EnableDataExplorerGenAISampleDocumentPassing, flag.DisableDataExplorerGenAISampleDocumentPassing)
123+
110124
cmd.Flags().BoolVarP(&opts.enablePerformanceAdvisor, flag.EnablePerformanceAdvisor, "", false, usage.EnablePerformanceAdvisor)
111125
cmd.Flags().BoolVarP(&opts.disablePerformanceAdvisor, flag.DisablePerformanceAdvisor, "", false, usage.DisablePerformanceAdvisor)
112126
cmd.MarkFlagsMutuallyExclusive(flag.EnablePerformanceAdvisor, flag.DisablePerformanceAdvisor)

0 commit comments

Comments
 (0)