kibana/x-pack/plugins/serverless/server
Clint Andrew Hall 1c99f40f2c
[chore] Make plugin dependencies explicit; point out lifecycle inconsistencies (#173297)
> Changes identified using the script from
https://github.com/elastic/kibana/pull/171483

## Summary

The script from https://github.com/elastic/kibana/pull/171483 can
identify inconsistencies and untyped dependencies in Kibana plugins.
This PR fixes the obvious:

- `notifications` - move `actions` and `licensing` to `optionalPlugins`.
- `serverless` - move `kibanaReact` to `requiredBundles`.
- `serverlessObservability` - delete dead code and `kibanaReact`
dependency.
- `reporting` - move `esUiShared` and `embeddable` plugins to
`requiredBundles`.
- `uiActions` - remove `dataViews` dependency, (only a type is being
used).
- `urlDrilldowns` - move `uiActions` to `requiredBundles`.
- Type all plugins using the `Setup` and `Start` generics on the core
`Plugin` interface.
- Consistently name them.
- The exports needed to be named their original names; this will be
addressed in follow up work, (to avoid pinging teams)
- Add a `_` to unused parameters.

## Remaining Issues

### `licensing` and `licensingApiGuard`

Both of these plugins introduce side-effects, rather than dependent
logic. These need to be refactored to be consumed instead.

<img width="735" alt="Screenshot 2023-12-13 at 10 08 00 AM"
src="57916ffd-299d-4ca8-b796-dea2d06dca4a">
<img width="740" alt="Screenshot 2023-12-13 at 10 08 08 AM"
src="a2af254f-adec-4bf9-869a-8acf34c0c9b4">

## Resolved issues

### `reporting`

~~The `reporting` plugin requires `embeddable` and `esUiShared`, but
it's unclear if these still apply, or if they are required for
side-effects. Perhaps @tsullivan can help clarify?~~

Both are being used for static code. Moving to `requiredBundles`, and
need to follow-up to create packages.

<img width="800" alt="Screenshot 2023-12-13 at 10 08 23 AM"
src="7629fb92-d28e-43de-bfeb-97410cff424e">

### `uiActions`

~~The `uiActions` plugin requires `dataViews`. We need to determine if
this is a side-effect dependency, or a direct dependency, and remove or
refactor as necessary.~~

It's only using a type. Removing the dependency entirely,
(`requiredBundles` requires actual code be used).

<img width="622" alt="Screenshot 2023-12-13 at 10 08 33 AM"
src="39916f05-dafc-4f42-b5d8-1abcb1267b5b">

### urlDrilldown

~~The `urlDrilldown` plugin requires `uiActions`. We need to determine
if this is a side-effect dependency, or a direct dependency, and remove
or refactor as necessary.~~

Static code usage-- moving to `requiredBundles`.

<img width="732" alt="Screenshot 2023-12-13 at 10 13 13 AM"
src="af32f939-f866-483d-8dd0-aab962397dbb">

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-12-18 16:44:15 -05:00
..
config.ts
index.ts [chore] Make plugin dependencies explicit; point out lifecycle inconsistencies (#173297) 2023-12-18 16:44:15 -05:00
mocks.ts [Advanced settings] Add settings allowlist (#164471) 2023-09-11 21:12:53 +01:00
plugin.test.ts [Advanced settings] Add settings allowlist (#164471) 2023-09-11 21:12:53 +01:00
plugin.ts [chore] Make plugin dependencies explicit; point out lifecycle inconsistencies (#173297) 2023-12-18 16:44:15 -05:00
types.ts [chore] Make plugin dependencies explicit; point out lifecycle inconsistencies (#173297) 2023-12-18 16:44:15 -05:00