Kibana Sustainable Architecture: Force visibility: 'private' for solutions in manifest (#199452)

## Summary

Small improvements for the JSON schema for `kibana.jsonc` manifests:
* Allow `visibility: 'shared'` only when `group: 'platform'` (thanks
@dgieselaar!)
* Remove `group: 'common'` option. We don't want users categorising
modules as `'common'` (it has the semantic meaning of "not
categorised").
This commit is contained in:
Gerard Soldevila 2024-11-08 15:36:07 +01:00 committed by GitHub
parent 3c976c0b93
commit 6cb3447acc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -49,18 +49,10 @@ export const MANIFEST_V2: JSONSchema = {
`,
},
group: {
enum: ['common', 'platform', 'observability', 'security', 'search'],
enum: ['platform', 'observability', 'security', 'search'],
description: desc`
Specifies the group to which this module pertains.
`,
default: 'common',
},
visibility: {
enum: ['private', 'shared'],
description: desc`
Specifies the visibility of this module, i.e. whether it can be accessed by everybody or only modules in the same group
`,
default: 'shared',
},
devOnly: {
type: 'boolean',
@ -112,6 +104,37 @@ export const MANIFEST_V2: JSONSchema = {
type: 'string',
},
},
allOf: [
{
if: {
properties: { group: { const: 'platform' } },
},
then: {
properties: {
visibility: {
enum: ['private', 'shared'],
description: desc`
Specifies the visibility of this module, i.e. whether it can be accessed by everybody or only modules in the same group
`,
default: 'shared',
},
},
required: ['visibility'],
},
else: {
properties: {
visibility: {
const: 'private',
description: desc`
Specifies the visibility of this module, i.e. whether it can be accessed by everybody or only modules in the same group
`,
default: 'private',
},
},
required: ['visibility'],
},
},
],
oneOf: [
{
type: 'object',