-
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
Prevent OSS plugins from having required dependencies on optional plugins #106485
Comments
Pinging @elastic/kibana-operations (Team:Operations) |
I was playing with this today. It appears that we don't have any controls in place today to prevent dependencies from OSS to X-pack. However, we do have an ESLint rule to prevent imports: Lines 473 to 477 in 3612a7a
@elastic/kibana-operations Do we have any options to enforce this differently? Unless I'm missing something, this ESLint rule is the only thing preventing an OSS plugin from depending on an X-pack plugin. But I don't see a way that we can modify this rule to allow for optional dependencies and only block required dependencies. Perhaps that needs to be done differently at the build level? |
By optional dependencies, I assume you mean with the plugin contract. For that, it seems the best way to enforce that would be in core. |
Yes, via the |
Yeah I agree this seems easiest to solve from the PluginsService in Core. We'll need to start tracking where the plugin discovery process found a plugin (eg |
@kobelb Should we allow |
I don’t see why we wouldn’t allow this. The only reason we want to restrict dependencies at all is because if OSS plugins require X-Pack plugins, then the OSS build would be broken. And we want to avoid breaking the OSS build. |
To clarify some things, we no longer create a separate OSS and x-pack build, so the reason we didn't want to support a required dependency longer exists. If there is a reason for a required dependency, we should re-open this discussion and consider supporting it. |
I'm struggling to find a reference to the original internal discussion, but I believe the reason we wanted to only allow optional dependencies from oss to x-pack was less a technical one, and more of a pragmatic one -- in case there were a time in the future where we did end up maintaining separate builds again, it felt "safer" to not start introducing a bunch of hard dependencies between oss & x-pack. cc @kobelb as he was advocating for this approach IIRC |
@lukeelmers copying my thoughts from the private issue about this here:
|
When we stopped building the OSS distributable, we removed the only systemic protection that we had to prevent OSS plugins from having dependencies on X-Pack plugins. After further discussion, we've come to the conclusion that we should allow OSS plugins to have optional dependencies on X-Pack plugins. However, we should not allow OSS plugins to have required dependencies on X-Pack plugins. We should enforce this as part of CI or the build itself to prevent required dependencies from OSS to X-Pack.
The text was updated successfully, but these errors were encountered: