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

don't register any features in LP. #65611

Merged
merged 10 commits into from
May 11, 2020

Conversation

mshustov
Copy link
Contributor

@mshustov mshustov commented May 7, 2020

Summary

Fixes #65461
It blocks security plugin migration. A list of features is locked on the first reading, which means that maps LP plugin cannot register a feature after the Security plugin reads the value in KP.

@mshustov mshustov added chore Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc Feature:New Platform [Deprecated-Use Team:Presentation]Team:Geo Former Team Label for Geo Team. Now use Team:Presentation release_note:skip Skip the PR/issue when compiling release notes v7.9.0 labels May 7, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-gis (Team:Geo)

@elasticmachine
Copy link
Contributor

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

@mshustov mshustov marked this pull request as ready for review May 7, 2020 19:51
@mshustov mshustov requested review from a team as code owners May 7, 2020 19:51
@mshustov mshustov requested a review from a team May 7, 2020 19:51
}

class NamespaceAgnosticTypePlugin implements Plugin {
setup(core: CoreSetup, plugins: SetupDeps) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@elastic/kibana-platform that's another big thing to get rid of LP: to make all tests KP-compatible. we should have done it as a part of the plugin migration effort 😅

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. Even if they are small, there is a lot of test legacy plugins we will still need to migrate to get rid of legacy...

Copy link
Contributor

@pgayvallet pgayvallet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

x-pack/plugins/maps/server/plugin.ts Outdated Show resolved Hide resolved
}

class NamespaceAgnosticTypePlugin implements Plugin {
setup(core: CoreSetup, plugins: SetupDeps) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. Even if they are small, there is a lot of test legacy plugins we will still need to migrate to get rid of legacy...

Comment on lines 139 to +140
type: string;
ignore_above?: number;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be only used in a test plugin and could probably be removed from the mapping instead (even if I did not try to launch the test suite with the mapping modified). But I guess it doesn't hurt to still add it.

Comment on lines -25 to 26
const { registerFeature, getFeatures } = server.newPlatform.setup.plugins.features;
server.expose('registerFeature', registerFeature);
const { getFeatures } = server.newPlatform.setup.plugins.features;
server.expose('getFeatures', getFeatures);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are 3rd party plugins meant to be used with a licensed version of Kibana supposed to be able to use x-pack features/apis?

If so, should we add a dev doc or anything to warn that registerFeature is no longer usable from legacy plugins?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, I will do. just in case

@legrego legrego self-requested a review May 8, 2020 11:19
Copy link
Member

@legrego legrego left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @restrry!

@mshustov
Copy link
Contributor Author

@elasticmachine merge upstream

@mshustov
Copy link
Contributor Author

@elasticmachine merge upstream

Copy link
Contributor

@nreese nreese left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maps changes lgtm
code review, tested in chrome

@mshustov
Copy link
Contributor Author

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@mshustov mshustov merged commit 4912153 into elastic:master May 11, 2020
@mshustov mshustov deleted the issue-65461-featues-in-np-only branch May 11, 2020 16:43
mshustov added a commit to mshustov/kibana that referenced this pull request May 11, 2020
* don't register any features in LP. breaks features value reading in KP

* move test plugin to NP

* fix mappings

* update docs

* migrate another test

* use contstants file for BWC with original code

Co-authored-by: Elastic Machine <[email protected]>
mshustov added a commit that referenced this pull request May 11, 2020
* don't register any features in LP. breaks features value reading in KP

* move test plugin to NP

* fix mappings

* update docs

* migrate another test

* use contstants file for BWC with original code

Co-authored-by: Elastic Machine <[email protected]>

Co-authored-by: Elastic Machine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore [Deprecated-Use Team:Presentation]Team:Geo Former Team Label for Geo Team. Now use Team:Presentation Feature:New Platform release_note:skip Skip the PR/issue when compiling release notes Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc v7.9.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Kibana Platform plugins cannot access available features in start method
6 participants