-
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
[Cases] Fix plugin lifecycle inconsistencies #177132
Conversation
bdb91e2
to
3c07cc0
Compare
/ci |
/ci |
1 similar comment
/ci |
Pinging @elastic/response-ops (Team:ResponseOps) |
Pinging @elastic/response-ops-cases (Feature:Cases) |
/ci |
Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services) |
Pinging @elastic/obs-ux-management-team (Team:obs-ux-management) |
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.
What about the storage
dependency? It shows up on the print screen but you don't mention it in the description. Is it maybe part of kibanaUtils
?
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.
LGTM
Good observation. I forgot about it. I added a paragraph about it. |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
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.
ML changes LGTM
💛 Build succeeded, but was flaky
Failed CI Steps
Test Failures
Metrics [docs]
History
To update your PR or re-run it, just comment with: cc @cnasikas |
## 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]>
## 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]>
Summary
The script from #171483 can identify inconsistencies and untyped dependencies in Kibana plugins. This PR fixes:
esUiShared
,kibanaReact
,kibanaUtils
, andsavedObjectsFinder
torequiredBundles
CasesUiSetup
toCasesPublicSetup
CasesUiStart
toCasesPublicStart
CasesSetup
toCasesServerSetup
CasesStart
toCasesServerStart
CasesPluginSetup
(public) toCasesPublicSetupDependencies
CasesPluginStart
(public) toCasesPublicStartDependencies
PluginsSetup
fromserver/plugin.ts
toserver/types.ts
and rename it toCasesServerSetupDependencies
PluginsStart
fromserver/plugin.ts
toserver/types.ts
and rename it toCasesServerStartDependencies
I could not add the
apm
to optional plugins because I get an error due to circular dependencies. Observability and Secuirty solution haveapm
andcases
as a dependency and probably this cause the following error.Error
Also, the
storage
is passed by thecases
plugin to the Kibana context and is not a dependency to another plugin. The script assumes that thestorage
is a plugin dependency and reports it. Neverthelss, this demonstrates that we should stop passingstorage
to the Kibana context and use hooks likeuseLocalStorage
.Lastly, ML uses cases but does not pass the
licensing
plugin to the KibanaContext. For that reason, I left it as optional in the Cases types. When #168178 is done we can change the type of thelicensing
service to required.Results from the script
For maintainers