Skip to content

Commit

Permalink
[8.x] Kibana Sustainable Architecture: Force `visibility: '…
Browse files Browse the repository at this point in the history
…private'` for solutions in manifest (elastic#199452) (elastic#199488)

# Backport

This will backport the following commits from `main` to `8.x`:
- [Kibana Sustainable Architecture: Force `visibility:
'private'` for solutions in manifest
(elastic#199452)](elastic#199452)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Gerard
Soldevila","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-08T14:36:07Z","message":"Kibana
Sustainable Architecture: Force `visibility: 'private'` for solutions in
manifest (elastic#199452)\n\n## Summary\r\n\r\nSmall improvements for the JSON
schema for `kibana.jsonc` manifests:\r\n* Allow `visibility: 'shared'`
only when `group: 'platform'` (thanks\r\n@dgieselaar!)\r\n* Remove
`group: 'common'` option. We don't want users categorising\r\nmodules as
`'common'` (it has the semantic meaning of
\"not\r\ncategorised\").","sha":"6cb3447acc1614b58f6a1f88e9ccbd5d1b0e85e7","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Core","release_note:skip","v9.0.0","backport:prev-minor"],"title":"Kibana
Sustainable Architecture: Force `visibility: 'private'` for solutions in
manifest","number":199452,"url":"https://github.com/elastic/kibana/pull/199452","mergeCommit":{"message":"Kibana
Sustainable Architecture: Force `visibility: 'private'` for solutions in
manifest (elastic#199452)\n\n## Summary\r\n\r\nSmall improvements for the JSON
schema for `kibana.jsonc` manifests:\r\n* Allow `visibility: 'shared'`
only when `group: 'platform'` (thanks\r\n@dgieselaar!)\r\n* Remove
`group: 'common'` option. We don't want users categorising\r\nmodules as
`'common'` (it has the semantic meaning of
\"not\r\ncategorised\").","sha":"6cb3447acc1614b58f6a1f88e9ccbd5d1b0e85e7"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/199452","number":199452,"mergeCommit":{"message":"Kibana
Sustainable Architecture: Force `visibility: 'private'` for solutions in
manifest (elastic#199452)\n\n## Summary\r\n\r\nSmall improvements for the JSON
schema for `kibana.jsonc` manifests:\r\n* Allow `visibility: 'shared'`
only when `group: 'platform'` (thanks\r\n@dgieselaar!)\r\n* Remove
`group: 'common'` option. We don't want users categorising\r\nmodules as
`'common'` (it has the semantic meaning of
\"not\r\ncategorised\").","sha":"6cb3447acc1614b58f6a1f88e9ccbd5d1b0e85e7"}}]}]
BACKPORT-->

Co-authored-by: Gerard Soldevila <[email protected]>
  • Loading branch information
kibanamachine and gsoldevila authored Nov 8, 2024
1 parent db88603 commit 4b4bd24
Showing 1 changed file with 32 additions and 9 deletions.
41 changes: 32 additions & 9 deletions packages/kbn-kibana-manifest-schema/src/kibana_json_v2_schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down

0 comments on commit 4b4bd24

Please sign in to comment.