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.
[Cases] Fix plugin lifecycle inconsistencies (elastic#177132)
## Summary The script from elastic#171483 can identify inconsistencies and untyped dependencies in Kibana plugins. This PR fixes: - Move `esUiShared`, `kibanaReact`, `kibanaUtils`, and `savedObjectsFinder` to `requiredBundles` - Rename `CasesUiSetup` to `CasesPublicSetup` - Rename `CasesUiStart` to `CasesPublicStart` - Rename `CasesSetup` to `CasesServerSetup` - Rename `CasesStart` to `CasesServerStart` - Rename `CasesPluginSetup` (public) to `CasesPublicSetupDependencies` - Rename `CasesPluginStart` (public) to `CasesPublicStartDependencies` - Moved `PluginsSetup` from `server/plugin.ts` to `server/types.ts` and rename it to `CasesServerSetupDependencies` - Moved `PluginsStart` from `server/plugin.ts` to `server/types.ts` and rename it to `CasesServerStartDependencies` I could not add the `apm` to optional plugins because I get an error due to circular dependencies. Observability and Secuirty solution have `apm` and `cases` as a dependency and probably this cause the following error. <details> <summary>Error</summary> ``` info Running model version mapping addition checks │ info Generating field lists from registry and file │ info Loading core with all plugins enabled so that we can get all savedObject mappings... │ERROR UNHANDLED ERROR: Error: Topological ordering of plugins did not complete, these plugins have cyclic or missing dependencies: ["aiAssistantManagementObservability","aiops","apm","assetManager","cases","cloudDefend","datasetQuality","elasticAssistant","enterpriseSearch","exploratoryView","infra","kubernetesSecurity","logsShared","logstash","metricsDataAccess","ml","monitoring","observability","observabilityAIAssistant","observabilityOnboarding","observabilityShared","observabilityLogsExplorer","osquery","profiling","securitySolution","securitySolutionEss","securitySolutionServerless","serverlessObservability","sessionView","synthetics","threatIntelligence","timelines","upgradeAssistant","uptime","ux"] │ERROR at PluginsSystem.getTopologicallySortedPluginNames (plugins_system.ts:354:13) │ERROR at PluginsSystem.uiPlugins (plugins_system.ts:274:36) │ERROR at PluginsService.discover (plugins_service.ts:120:58) │ERROR at Server.preboot (server.ts:172:30) │ERROR at Root.preboot (index.ts:57:14) │ERROR at extract_field_lists_from_plugins_worker.ts:51:3 ERROR UNHANDLED ERROR ERROR Error: worker exited without sending mappings at extractFieldListsFromPlugins (extract_field_lists_from_plugins.ts:62:11) at processTicksAndRejections (node:internal/process/task_queues:95:5) at runModelVersionMappingAdditionsChecks (run_versions_mapping_additions_check.ts:28:66) at run_check_mappings_update_cli.ts:23:9 at tooling_log.ts:84:18 at description (run_check_mappings_update_cli.ts:22:7) at run.ts:73:10 at withProcRunner (with_proc_runner.ts:29:5) at run (run.ts:71:5) ``` </details> Also, the `storage` is passed by the `cases` plugin to the Kibana context and is not a dependency to another plugin. The script assumes that the `storage` is a plugin dependency and reports it. Neverthelss, this demonstrates that we should stop passing `storage` to the Kibana context and use hooks like `useLocalStorage`. ## Results from the script <img width="727" alt="Screenshot 2024-02-17 at 8 54 32 AM" src="https://github.com/elastic/kibana/assets/7871006/1c86f501-72c5-473c-92f5-7a4935da914b"> ### For maintainers - [x] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --------- Co-authored-by: Kibana Machine <[email protected]>
- Loading branch information
Showing
51 changed files
with
203 additions
and
170 deletions.
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
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
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
Oops, something went wrong.