-
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
Remove legacy plugin discovery #71927
Comments
Pinging @elastic/kibana-platform (Team:Platform) |
We are very close to being able to remove the legacy optimizer, however we still got some work to do before we will be able to totally drop legacy plugin discovery, as there are some remaining. oss
|
async init(server: any) { | |
_legacyEsConfig = await server.newPlatform.__internals.elasticsearch.legacy.config$ | |
.pipe(first()) | |
.toPromise(); | |
}, | |
uiExports: { | |
injectDefaultVars: () => ({ | |
elasticsearchUrl: url.format( | |
Object.assign(url.parse(head(_legacyEsConfig.hosts) as any), { auth: false }) | |
), | |
}), |
I thought it could be done by exposing an endpoint that would access elasticsearch.legacy.config$
, but I was wrong, as this property is only exposed on the internal / legacy contract. I moved #68497 back to 7.10
, this removal is blocked by it.
cc @elastic/es-ui
elasticsearch
It's exposing things like createCluster
and getCluster
, which may be removed if no more legacy plugins are using them (did not check usages in the legacy server code itself), but it's also exposing waitUntilReady
which is tightly coupled with the legacy server itself. I guess this plugin will have to stay until the end of legacy.
EDIT: it seems it is also registering proxy routes to ES
server.route({ | |
method: 'POST', | |
path: '/elasticsearch/_msearch', | |
config: { | |
payload: { | |
parse: 'gunzip', | |
}, | |
}, |
Not sure who is consuming these, does anyone have an idea?
kibana
Still doing a few things:
-
Exporting the
src/legacy/core_plugins/kibana/public/index.scss
asstyleSheetPaths
. This seems closely related to Migrate ui/styles to New Platform #58369 -
Exporting some uiSettingDefaults
kibana/src/legacy/core_plugins/kibana/index.js
Lines 42 to 45 in d1a6fa2
uiExports: { | |
styleSheetPaths: resolve(__dirname, 'public/index.scss'), | |
uiSettingDefaults: getUiSettingDefaults(), | |
}, |
Not sure if related to #22779 or #59755
- Registering the
csp
usage collector
kibana/src/legacy/core_plugins/kibana/index.js
Lines 59 to 62 in d1a6fa2
init: async function (server) { | |
const { usageCollection } = server.newPlatform.setup.plugins; | |
registerCspCollector(usageCollection, server); | |
}, |
Not sure I saw this one listed anywhere. csp
config is now in core
, so I guess this should probably be moved there, but we need a way to access usageCollection
plugin from within core. Seems related to #56762 (comment)
- create the
data
folder
created #73002
status_page
Done in #72017.
The empty app plugin left should safely be removed once the legacy optimizer is no more.
tests_bundle
I have no idea what this is for. I see some karma
references, is this only used for karma testing @elastic/kibana-operations?
x-pack
beats_management
Covered by #70930
Monitoring
Used to bridge the legacy status
API to the KP plugin
kibana/x-pack/legacy/plugins/monitoring/index.ts
Lines 21 to 34 in 06b1820
init(server: Hapi.Server) { | |
const npMonitoring = server.newPlatform.setup.plugins.monitoring as object & { | |
registerLegacyAPI: (api: unknown) => void; | |
}; | |
if (npMonitoring) { | |
const kbnServerStatus = this.kbnServer.status; | |
npMonitoring.registerLegacyAPI({ | |
getServerStatus: () => { | |
const status = kbnServerStatus.toJSON(); | |
return status?.overall?.state; | |
}, | |
}); | |
} | |
}, |
Depends on #41983
security
Only here to expose some hacks (x-pack/legacy/plugins/security/public/hacks/legacy.ts
) for the legacy apps. Should be good to remove as we no longer have any legacy apps? Or is this still used for management tabs @elastic/kibana-security
spaces
- Used to register some redirection routes
kibana/x-pack/legacy/plugins/spaces/public/legacy.ts
Lines 8 to 18 in 7ab38ff
import routes from 'ui/routes'; | |
import { SpacesPluginSetup } from '../../../../plugins/spaces/public'; | |
const spaces = (npSetup.plugins as any).spaces as SpacesPluginSetup; | |
if (spaces) { | |
routes.when('/management/spaces/list', { redirectTo: '/management/kibana/spaces' }); | |
routes.when('/management/spaces/create', { redirectTo: '/management/kibana/spaces/create' }); | |
routes.when('/management/spaces/edit/:spaceId', { | |
redirectTo: '/management/kibana/spaces/edit/:spaceId', | |
}); | |
} |
Not sure if these are still really used now that we don't have any app running in legacy mode? @elastic/kibana-security
- expose the
replaceInjectedVars
inuiExports
.
Seems to be used to add the activeSpace
var. Not sure if this is still relevant @elastic/kibana-security?
- expose things such as
getSpaceId
andgetActiveSpace
on the server
This seems fine to remove once we no longer have any other xpack server-side legacy plugin.
xpack_main
This one is doing quite a few things. I guess this will be the last xpack plugin to be removed.
I think that
I'm not sure if |
Yea, we are only talking about legacy removal here ( |
Once we don't have any Angular based plugins then we can get rid of this completely. Maintaining
Since these redirects don't seem to work right now anyway (likely because Management plugin migrated away from
It seems Infra is still using this. I believe they can switch to the contract Spaces KP plugins exposes now.
Sounds good to me. |
@elastic/logs-metrics-ui do you have an issue to replace these space injectedVars with the spaces plugin API? |
Yeah, this will go along with karma and the legacy optimizer |
elasticsearch@pgayvallet It looks like https://github.com/elastic/kibana/blob/master/src/plugins/home/public/application/components/tutorial/tutorial.js#L206 makes a request to |
Yes, we track it in #68142 |
@elastic/kibana-telemetry any problems with us moving the CSP usage collector directly to the telemetry plugin for the time being? |
@joshdover seems like the issue in the kibana app section is actually on core UI, can you confirm? |
@joshdover after reviewing the collector, it looks like it only accesses to core public values. No problem on my end to move it to the core-but-outside-core collectors in the plugin |
No objections here either. I wasn't aware that CSP even had a usage collector :) |
@weltenwort Not that I am aware of, thanks Felix |
Added #76416 to the list of blockers. |
All blockers have been addressed. #77599 is the final PR that is going to close this issue. |
Related to #56205
Once all 1st party legacy plugins have been removed or migrated, we should disable legacy plugin discovery altogether, even for 3rd party plugins.
When we make this change, we also need to add a note to the "breaking changes" doc for 7.10
Blockers by team
@elastic/stack-monitoring-ui
/api/settings
route to Kibana platform #76416@elastic/kibana-app-arch
/elasticsearch/_msearch
endpoint in Index Pattern Management UI #73993@elastic/kibana-core-ui
/elasticsearch/_msearch
endpoint in tutorials #73992@elastic/es-ui
@elastic/logs-metrics-ui
@elastic/kibana-gis
@elastic/kibana-security
@elastic/kibana-platform
The text was updated successfully, but these errors were encountered: