-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[RAM] [Rule Form v2] Add feature flag #179184
Merged
Merged
Changes from 2 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
1e132fa
[RAM] [Rule Form v2] Add feature flag
Zacqary 90f13ab
Merge remote-tracking branch 'upstream/main' into 179110-ruleform-v2-…
Zacqary 5da6ad6
Clarify experimental features arg in transform plugin
Zacqary 2b66a16
Fix ML stack management pages
Zacqary 90d4853
Fix typecheck on triggers_actions_ui
Zacqary 0fb0e34
Move experimental features out of discover customization context
Zacqary 847f959
Fix discover typecheck
Zacqary 5823995
Fix tests and typecheck
Zacqary c2a9e8a
Merge remote-tracking branch 'upstream/main' into 179110-ruleform-v2-…
Zacqary 61e0343
Add observability ruleFormV2 unsafe flag
Zacqary 18f0464
Add experimental ruleformv2 to slo
Zacqary 6b53b0e
Add RuleFormV2 feature flag to APM
Zacqary 0dccee5
Fix tests and typecheck
Zacqary 81e7e3b
Fix slo typecheck
Zacqary 6b8c09a
Remove console statement
Zacqary 0ed9b50
Merge branch 'main' into 179110-ruleform-v2-flag
kibanamachine File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import { schema, TypeOf } from '@kbn/config-schema'; | ||
|
||
export const configSchema = schema.object({ | ||
enableUiSettingsValidations: schema.boolean({ defaultValue: false }), | ||
experimental: schema.maybe( | ||
schema.object({ | ||
ruleFormV2Enabled: schema.maybe(schema.boolean({ defaultValue: false })), | ||
}) | ||
), | ||
}); | ||
|
||
export type ConfigSchema = TypeOf<typeof configSchema>; | ||
export type ExperimentalFeatures = ConfigSchema['experimental']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,12 +19,16 @@ export const ML_EXTERNAL_BASE_PATH = '/api/ml'; | |
|
||
export type MlFeatures = Record<'ad' | 'dfa' | 'nlp', boolean>; | ||
export type CompatibleModule = 'security' | 'observability' | 'search'; | ||
export type ExperimentalFeatures = Record<'ruleFormV2', boolean>; | ||
|
||
export interface ConfigSchema { | ||
ad?: { enabled: boolean }; | ||
dfa?: { enabled: boolean }; | ||
nlp?: { enabled: boolean }; | ||
compatibleModuleType?: CompatibleModule; | ||
experimental?: { | ||
ruleFormV2?: { enabled: boolean }; | ||
}; | ||
} | ||
|
||
export function initEnabledFeatures(enabledFeatures: MlFeatures, config: ConfigSchema) { | ||
|
@@ -38,3 +42,12 @@ export function initEnabledFeatures(enabledFeatures: MlFeatures, config: ConfigS | |
enabledFeatures.nlp = config.nlp.enabled; | ||
} | ||
} | ||
|
||
export function initExperimentalFeatures( | ||
experimentalFeatures: ExperimentalFeatures, | ||
config: ConfigSchema | ||
) { | ||
if (config.experimental?.ruleFormV2?.enabled !== undefined) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. super small nitpick: maybe better to check if its a boolean? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Trying to repeat the same pattern used elsewhere in this file |
||
experimentalFeatures.ruleFormV2 = config.experimental.ruleFormV2.enabled; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import type { TypeOf } from '@kbn/config-schema'; | ||
import { schema } from '@kbn/config-schema'; | ||
|
||
export const configSchema = schema.object({ | ||
experimental: schema.maybe( | ||
schema.object({ | ||
ruleFormV2Enabled: schema.maybe(schema.boolean()), | ||
}) | ||
), | ||
}); | ||
|
||
export type ConfigSchema = TypeOf<typeof configSchema>; | ||
export type ExperimentalFeatures = ConfigSchema['experimental']; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Rather than incorporating this into the customization context, which is used for a different purpose in Discover, I'd prefer we pass
ExperimentalFeatures
directly intorenderApp
instead to keep things separated. Then when we need to use it, we can introduce something like a context provider for it.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.
Sure thing, changed this in the latest commit