-
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
Migrate core domain services to packages: Dependency analysis on remaining server-side services #134137
Comments
Pinging @elastic/kibana-core (Team:Core) |
The next step (and the main difficulty) will be the splitting / ordering of the Regarding - Both domains import mocks from the other oneE.g
and
- Both domains import types from the other onee.g
and kibana/src/core/server/http/types.ts Line 9 in a02c00b
- The
|
export interface PrebootDeps { | |
context: InternalContextPreboot; | |
} |
In theory, given the http
service has a direct dependency on the context
service, the dependencies should only be in that order, and no context
type should depends on http
types.
In practice, the some types of the two domains are tightly coupled around the 'request handler' context. The http
domain exposes the RequestHandlerContext
type, and the context
domain exposes the IContextProvider
types.
In short, we have a terrible isolation between those two services, and at the moment I don't see a clear path toward splitting them.
This is actually a bit worse than that. I actually missed that kibana/src/core/server/context/container/context.ts Lines 28 to 29 in 9b75efd
And and this type is the whole context exposed to plugins via the router handler context: kibana/src/core/server/index.ts Lines 522 to 539 in 9398abc
Meaning that the
At this point, I don't really see any other option that starting by creating the public type packages for all the domains that are referenced from An alternative would be to stop this per-domain public type separation, and to have a single public type package for core browser/shared/server areas... |
I created #135703 to track the migration of the server-side |
There are 4 services remaining on the server-side:
Dependency analysisOnly listing the unmigrated domains dependencies: httpResourcesDepends on
|
import type { UiPlugins } from '../plugins'; |
plugins
No dependencies, except the core lifecycle contracts, both public and internal, that aren't migrated yet.
coreApp
Depends on httpResources
import { HttpResources, HttpResourcesServiceToolkit } from '../http_resources'; |
Depends on plugins
import { UiPlugins } from '../plugins'; |
Topological ordering
plugins
-> rendering
-> httpResources
-> coreApp
Will create the remaining issues and update #134112 accordingly.
Keeping this issue open just in case, but we should likely be able to close it right now.
Okay, it would have been too easy, it's not actually as trivial as I described it... The
which, and I missed it, have references to services that are higher in the dependency chain ( kibana/src/core/server/internal_types.ts Lines 77 to 96 in d697729
Which introduces a cyclic dependency via these internal types.... |
I think we should consider that We will probably have to introduce a |
@pgayvallet can you remember why the Jira issue for this is marked as blocked? |
IIRC it was more marked as 'awaiting' than blocked. But I think we should be good closing this issue now, WDYT? |
Part of #134112
After doing the initial work of moving server-side service types to packages, let's stop and come up with a plan for migrating the remaining services. The obvious next step will be to tackle the HTTP service, as it's used by all remaining plugins. We’ll need to handle the isolation issues between http/elasticsearch/context. Once this part is done, the next services should be way easier.
Remaining services:
The task here is to do a dependency analysis and come up with a clear plan for migrating the remaining items.
The text was updated successfully, but these errors were encountered: