Skip to content
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

Kibana Platform plugins cannot access available features in start method #65461

Closed
azasypkin opened this issue May 6, 2020 · 6 comments · Fixed by #65611 or #66524
Closed

Kibana Platform plugins cannot access available features in start method #65461

azasypkin opened this issue May 6, 2020 · 6 comments · Fixed by #65611 or #66524
Assignees
Labels
Feature:New Platform Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc

Comments

@azasypkin
Copy link
Member

azasypkin commented May 6, 2020

Summary

Currently if KP plugin accesses available features in its start method (via features.getFeatures()) it breaks legacy plugins that try to register new features since feature registry is frozen as soon as it's accessed for the first time (e.g XPack Main plugin registers all OSS features in its init method).

This issue turned out to be blocking migration of the Security plugin to Kibana Platform since in start method we need to access all available features, validate feature privileges and register these privileges with Elasticsearch.

@azasypkin azasypkin added Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc Feature:New Platform labels May 6, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-platform (Team:Platform)

@mshustov
Copy link
Contributor

we still register legacy features

featuresPlugin.registerLegacyAPI({
xpackInfo: setupXPackMain(server),
savedObjectTypes: server.savedObjects.types,
});
in x-pack_main plugin
registerLegacyAPI: (legacyAPI: LegacyAPI) => {
this.legacyAPI = legacyAPI;
// Register OSS features.
for (const feature of buildOSSFeatures({
savedObjectTypes: this.legacyAPI.savedObjectTypes,
includeTimelion: visTypeTimelion !== undefined && visTypeTimelion.uiEnabled,
})) {
this.featureRegistry.register(feature);
}
},

@mshustov mshustov reopened this May 12, 2020
@mshustov
Copy link
Contributor

It's currently blocked by timelion and maps SO registration in the LP.
@joshdover it seems we have to push for timelion migration.

@mshustov
Copy link
Contributor

blocked by #66203 and #66057

@joshdover
Copy link
Contributor

It's currently blocked by timelion and maps SO registration in the LP.
@joshdover it seems we have to push for timelion migration.

Can we just migrate the SO registration for now?

@mshustov
Copy link
Contributor

@joshdover yes, I ended up with it. forgot to update the comment #66203

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:New Platform Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
Projects
None yet
4 participants