-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Make Core interfaces exposed to LP plugins consistent with NP plugins #47074
Conversation
💔 Build Failed |
be2b8ef
to
7d4abd9
Compare
💔 Build Failed |
7d4abd9
to
eaccab2
Compare
💔 Build Failed |
c1ab169
to
71d4ddb
Compare
💔 Build Failed |
71d4ddb
to
e7e329c
Compare
💔 Build Failed |
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
I like this idea. It's similar to how Would this solve any immediate problems? The utility of this is somewhat limited in that it requires NP plugins which have registered context and legacy plugins who use the NP router. |
One of the things being worked on is the "search" plugin which provides different search strategies to plugins. This is a new plugin that will replace courier, and the primary way plugins would consume it would be via request and mount contexts. Going with this option would give legacy plugins a way to start consuming these without having to move code over to NP yet. I am going to move forward with this idea, but keep it in a separate PR. |
b2298d8
to
c1ca31a
Compare
💔 Build Failed |
@restrry The integration tests are failing on this line: handler: kbnServer.newPlatform.setup.core.http.auth.get, Do you know if the legacy platform actually needs this still? |
@joshdover there are 2 problems:
I sent fix in you repo joshdover#29 |
290a55d
to
e5bba85
Compare
@restrry You're too kind, thanks! |
💚 Build Succeeded |
@elasticmachine merge upstream |
💚 Build Succeeded |
Summary
While working on cleaning up some type definitions, I noticed that we're not expose the same interface to the Legacy platform that will be available to New Platform plugins.
The main issue is the difference between
HttpServiceSetup
andCoreSetup['http']
. In the internal variant, we require apluginOpaqueId
argument to some functions (eg.createRouter
,registerRouteContext
).This changes that by making sure we're expose
CoreSetup
andCoreStart
rather than the internal variants of those interfaces by building an object using a fake opaqueId that the LegacyService generates.Risks
By using a single opaqueId for all legacy code, context providers registered by legacy code will be available to all legacy plugins. This does create a leak across plugin boundaries where legacy plugins could depend on other legacy code without realizing it.
I don't think this risk is too bad because:
server.ext
or via uiExports, so this doesn't quite make the problem worse, and it doesn't leak that problem to New Platform plugins.context.core
object, you should be depending on plugins that actually provide this value.Further improvements
We could take this one step further and solve a different problem: legacy plugins cannot currently get context registered by New Platform plugins. We could solve this by defining the fake "legacy plugin" as dependent on all other plugins in the system.
@elastic/kibana-platform what do y'all think?We will do this in a future PR.Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.For maintainers