-
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
add feature flags to apm config and serverless.oblt.yml #159136
Changes from 7 commits
35422ce
f40dd45
cc554c2
3c8b968
97c1182
eca126c
33ad69e
42fb17a
fd927d2
85c56fe
2091bf7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -180,6 +180,13 @@ export default function ({ getService }: PluginFunctionalProviderContext) { | |
'xpack.apm.managedServiceUrl (any)', | ||
'xpack.apm.serverlessOnboarding (any)', | ||
'xpack.apm.latestAgentVersionsUrl (string)', | ||
'xpack.apm.featureFlags.agentConfigurationAvailable (any)', | ||
'xpack.apm.featureFlags.configurableIndicesAvailable (any)', | ||
'xpack.apm.featureFlags.infrastructureTabAvailable (any)', | ||
'xpack.apm.featureFlags.infraUiAvailable (any)', | ||
'xpack.apm.featureFlags.migrationToFleetAvailable (any)', | ||
'xpack.apm.featureFlags.sourcemapApiAvailable (any)', | ||
'xpack.apm.featureFlags.storageExplorerAvailable (any)', | ||
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. I think these should be booleans 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. hi @thomheymann, 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. That's strange. Maybe the renderer doesn't infer the type correctly because of the context conditional: 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. Yes if we use a conditional rendering, the renderer is currently unable to infer the type based on provided default value. Hence it will always result in |
||
'xpack.cases.files.allowedMimeTypes (array)', | ||
'xpack.cases.files.maxSize (number)', | ||
'xpack.cases.markdownPlugins.lens (boolean)', | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,6 +69,64 @@ const configSchema = schema.object({ | |
schema.string({ defaultValue: '' }), | ||
schema.never() | ||
), | ||
featureFlags: schema.object({ | ||
achyutjhunjhunwala marked this conversation as resolved.
Show resolved
Hide resolved
|
||
agentConfigurationAvailable: schema.conditional( | ||
schema.contextRef('serverless'), | ||
true, | ||
schema.boolean({ | ||
defaultValue: false, | ||
}), | ||
schema.oneOf([schema.literal(true)], { defaultValue: true }) | ||
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. I didn't understand the Basically, if we are not running in serverless context, its being enforced to a 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. Yes, it's like and if/else 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. Yes, i understand the schema.conditional. This config means If we are running in serverless mode, then default value is false, but it would give If we are not running in serverless mode, it will always be true. is this the expected behaviour ? 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. Reason for asking this is, since you are setting it as true in non serverless mode, you will have to update the security teams tests also where they check for exposed settings. This might also need documentation update for these exposed settings. The moment you update the security tests, someone from the security team will provide more details 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.
Yes, we want these values to be true when we are not in serverless
As you said I needed to update the security test and the team was ping to review these changes, I'm waiting for them for more details |
||
), | ||
configurableIndicesAvailable: schema.conditional( | ||
schema.contextRef('serverless'), | ||
true, | ||
schema.boolean({ | ||
defaultValue: false, | ||
}), | ||
schema.oneOf([schema.literal(true)], { defaultValue: true }) | ||
), | ||
MiriamAparicio marked this conversation as resolved.
Show resolved
Hide resolved
|
||
infrastructureTabAvailable: schema.conditional( | ||
schema.contextRef('serverless'), | ||
true, | ||
schema.boolean({ | ||
defaultValue: false, | ||
}), | ||
schema.oneOf([schema.literal(true)], { defaultValue: true }) | ||
), | ||
infraUiAvailable: schema.conditional( | ||
schema.contextRef('serverless'), | ||
true, | ||
schema.boolean({ | ||
defaultValue: false, | ||
}), | ||
schema.oneOf([schema.literal(true)], { defaultValue: true }) | ||
), | ||
migrationToFleetAvailable: schema.conditional( | ||
schema.contextRef('serverless'), | ||
true, | ||
schema.boolean({ | ||
defaultValue: false, | ||
}), | ||
schema.oneOf([schema.literal(true)], { defaultValue: true }) | ||
), | ||
sourcemapApiAvailable: schema.conditional( | ||
schema.contextRef('serverless'), | ||
true, | ||
schema.boolean({ | ||
defaultValue: false, | ||
}), | ||
schema.oneOf([schema.literal(true)], { defaultValue: true }) | ||
), | ||
storageExplorerAvailable: schema.conditional( | ||
schema.contextRef('serverless'), | ||
true, | ||
schema.boolean({ | ||
defaultValue: false, | ||
}), | ||
schema.oneOf([schema.literal(true)], { defaultValue: true }) | ||
), | ||
}), | ||
}); | ||
|
||
// plugin config | ||
|
@@ -129,6 +187,7 @@ export const config: PluginConfigDescriptor<APMConfig> = { | |
latestAgentVersionsUrl: true, | ||
managedServiceUrl: true, | ||
serverlessOnboarding: true, | ||
featureFlags: true, | ||
}, | ||
schema: configSchema, | ||
}; | ||
|
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.
NIT: we could also use the YAML tree format to avoid repetition 😇