forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[eem] update builtin definitions (elastic#188351)
## Summary Update built in definitions on plugin start. The update overwrites index templates and ingest pipelines with the latest versions but has to delete the transforms since we can only update a subset of settings in the [update api](https://www.elastic.co/guide/en/elasticsearch/reference/current/update-transform.html) which does not include the aggregations. ## Testing ### api tests Since the upgrade logic happens in plugin startup method we cannot directly trigger it from api tests without some tweaks. I've added a [fixture plugin](https://github.com/elastic/kibana/blob/a87ae8b2109bbbbe24e99638782fd73b165289f2/x-pack/test/api_integration/apis/entity_manager/fixture_plugin/server/plugin.ts) that is launched in the entity manager test server, this plugin creates a test route exposing the upgrade api which can then be called in api tests. ### manual - install builtin definitions `PUT kbn:/internal/api/entities/managed/enablement` - bump builtin [service definition](https://github.com/elastic/kibana/blob/main/x-pack/plugins/observability_solution/entity_manager/server/lib/entities/built_in/services.ts#L23) version - restart kibana server - logs should output `[INFO ][plugins.entityManager] Updating built-in entity definition [builtin_services] from v0.1.0 to v<new version>` - `GET kbn:/internal/api/entities/definition` should output the new definition - verify latest version of definition components are installed --------- Co-authored-by: kibanamachine <[email protected]>
- Loading branch information
1 parent
66a1080
commit ae6c1f6
Showing
51 changed files
with
1,160 additions
and
478 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
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
22 changes: 0 additions & 22 deletions
22
x-pack/plugins/observability_solution/entity_manager/common/helpers.test.ts
This file was deleted.
Oops, something went wrong.
19 changes: 0 additions & 19 deletions
19
x-pack/plugins/observability_solution/entity_manager/common/helpers.ts
This file was deleted.
Oops, something went wrong.
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
24 changes: 24 additions & 0 deletions
24
...solution/entity_manager/server/lib/entities/helpers/fixtures/builtin_entity_definition.ts
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,24 @@ | ||
/* | ||
* 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 { entityDefinitionSchema } from '@kbn/entities-schema'; | ||
export const builtInEntityDefinition = entityDefinitionSchema.parse({ | ||
id: 'builtin_mock_entity_definition', | ||
version: '1.0.0', | ||
name: 'Mock builtin definition', | ||
type: 'service', | ||
indexPatterns: ['kbn-data-forge-fake_stack.*'], | ||
managed: true, | ||
history: { | ||
timestampField: '@timestamp', | ||
interval: '1m', | ||
}, | ||
identityFields: ['log.logger', { field: 'event.category', optional: true }], | ||
displayNameTemplate: '{{log.logger}}{{#event.category}}:{{.}}{{/event.category}}', | ||
metadata: ['tags', 'host.name', 'host.os.name', { source: '_index', destination: 'sourceIndex' }], | ||
metrics: [], | ||
}); |
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
2 changes: 1 addition & 1 deletion
2
...erver/lib/entities/ingest_pipeline/__snapshots__/generate_history_processors.test.ts.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...server/lib/entities/ingest_pipeline/__snapshots__/generate_latest_processors.test.ts.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.