-
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
Proposal: Separate oss_features
out of the Features plugin
#94995
Comments
Pinging @elastic/kibana-core (Team:Core) |
Pinging @elastic/kibana-app-services (Team:AppServices) |
it doesn't scale very well: low-level plugins (such as Features) should not depend on high-level plugins (such as Reporting).
It's a remnant of the division of code into OSS and x-pack. With the new licensing model, we can move most of the cc @kobelb |
I agree with @mshustov that the correct solution is to move the bulk of the Features plugin outside of x-pack, and to have each non-x-pack feature register itself, instead of the features plugin registering these on their behalf. That said, I'm not strictly opposed to @tsullivan's solution as a stepping stone towards our ideal end state. Moving the features plugin outside of x-pack makes complete sense, but I haven't dealt with the licensing implications of such a move yet. The interfaces for features and sub-feature privileges allow plugins to state which license level they require. The features plugin doesn't do much to enforce license levels, but is that alone enough to warrant concern? Do we need to move aspects of the licensing plugin outside of x-pack as well (mostly thinking type definitions/enums here)?
IMO this is only a problem for the remainder of 7.x. Once we move to 8.0, these features won't have to conditionally register reporting sub-feature privileges. Starting in 8.0, they can always specify the reporting sub-feature privileges, as the old privilege model will no longer be supported. We could consider a more flexible privilege model where plugins can register sub-features for features belonging to other plugins, but I'm not yet convinced that's something we need. |
Agreed!
It's my understanding that license enforcement itself should not be in OSS; however, I think it'd be fine to have OSS aware of the license levels. @stacey-gammon, is this your understanding as well? |
Yes! I am glad that came across clearly. I am looking for changes that can push toward Reporting using feature controls in 7.13. |
There is a benefit to cleaning up code and moving It sounds like there is general acceptance of my proposal to create a new plugin, The new plugin will also depend on This |
ok for me.
IMO We should reverse the dependency:
It bothers me a little bit. As already being said, I don't think low-level plugins (building blocks for Kibana plugins) should depend on high-level plugins (providing user-facing functionality). Otherwise, we will face another circular dependency problem very soon. |
Reporting isn't going to move in 7.x. I need a thing that can provide extension points for Reporting plugin, which is what this proposal is about.
I really don't see a problem with having a plugin be responsible for registering non-x-pack features - the problem for me if the
I don't suggest to move any code outside of x-pack :) The new plugin that provides extension points for oss features would be I understand that there is a bit of maintenance cost with moving a file from one x-pack plugin to a new x-pack plugin: that is definitely not a plan that could fit every problem. But if the right thing means breaking up the
The need for Kibana to have an I truly want to find a way to allow Reporting to progress towards Kibana feature controls before 8.0. I think a lot can be achieved by adding a new x-pack plugin to register the the oss features, and include Reporting along with it, and keep it as a high-level plugin. If the new plugin becomes more than that, and it starts to mean more code needs to be refactored, we get a lot of complexity on what #19914 is waiting for.
|
I looked more at the If a separate plugin were to register the features instead, it would have to do it in the |
It doesn't have to wait for such a long time, but we need to understand the desirable final state before introducing a temporary workaround. Otherwise, we can end up in a situation when this workaround doesn't allow us to refactor code later.
As a temporary measurement I've got a question about overall privilege registration logic: Why OSS plugins register |
One thing that may not have come clear: the area that provides an extension point for Reporting needs to have a dependency on Reporting. There will be an But this should help explain why the
Currently, there is much reorganization work to be done. Reporting-releated UI components are mostly in the Reporting domain:
If Reporting is disabled, the Reporting-related UI components don't appear because they are registered in the Reporting domain. This is the kind of tech debt I brought up when I wrote:
Side note: I wrote "mostly" because Canvas has a bug in that it has some dedicated Reporting-related UI components in its domain, but it does not have a dependency on |
I am starting to warm up to this idea, and I see how it makes sense as the "right" way to organize the code as preparation for #19914 We could have In
In
|
Thanks @mshustov for reaching out to me to clarify your thoughts.
This suggestion is clear. It will enable me to continue work getting the |
This PR attempts to implement the plan. This diagram shows how the different plugins can be connected together: |
Proposal: Create a new plugin to separate
oss_features
out offeatures
. This will allow open-source applications to registered as "features" integrate Reporting export types as their own sub-feature(s).Background
Issue: #19914.
The Reporting should switch from the roles-based access control model (
ElasticsearchFeatureConfig
) to using Kibana feature controls (aSubFeatureConfig
declaration inKibanaFeatureConfig.subFeatures
). The technical changes will be that that various applications will integrate with Reporting by registring reporting features as sub-feature privileges.Example for the Canvas feature declaration, with the added
subFeatures
key:With the Canvas feature registered in that way, an admin user could grant Reporting access to users in the Management > Security > Roles UI.
The difference for "OSS" applications
Discover, Dashboard and Visualize also have feature declarations that need to be updated with Reporting as a sub-feature. The current declarations are in
x-pack/plugins/features/server/oss_features.ts
On the surface, it might seem like Reporting could be registered as sub-feature privileges of the 3 applications right in this file. If that were to happen, then the Features plugin would need a dependency for
reporting
in its kibana.json file. The detailed list of changes are:Problem: the Features plugin can not depend on Reporting. There would be circular dependencies: Reporting also depends on
features
in order to register itself as an Elasticsearch feature. That can be solved by moving the Reporting declaration out - maybe to Features. However, that isn’t enough: Reporting also depends onsecurity
, which also depends onfeatures
. That makes an unavoidable set of circular dependencies:Detailed Proposal
By taking
oss_features
logic out ofx-pack/plugins/features
and moving it to a new plugin, the Features plugin wouldn't need to depend on Reporting: the new plugin would centrally depend on Reporting and on Features. It would have the logic of the numbered steps above. Taking that code out of the Features plugin restores the dependency graph to flow in a single direction:In the longer term, having a new plugin could help Reporting with other technical debt. Reporting has code that is specific to OSS applications could be moved to the new plugin. This refers to the code that registers Reporting features as a top-nav sharing menu action for Discover, the code that registers "Download CSV" as a saved search panel action, etc.
Unknowns
This proposal would solve an earlier barrier in one idea to implement #19914. I don't yet know enough Feature Controls capability when it comes to showing or hiding the Reporting widgets in the UI. The proposal is that the legacy model can be toggled off with a config setting, but is enough context going to be carried all the way down to the browser level?
The text was updated successfully, but these errors were encountered: