-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[Refactor] *Plugin classes in modules/ source module to *Module classes #4034
Comments
Just thinking out loud, but what about getting rid of the different source tree all together by moving modules under the plugin directory? The "installed by default" property feels like an external configuration and not something fundamental about the module itself. In this proposal we'd have all plugins under the same source tree and then a configuration defined somewhere in a build file (presumably?) that chooses which plugins get installed by default. If we ever change which plugins are installed by default it becomes a simple configuration change with no moving around or renaming of source files. |
I don't believe it's an external configuration. I'll have to double check but I believe modules under that directory are auto-installed by the PluginService at bootstrap but plugins under the plugins directory are not (users have to use the InstallPlugin CLI). There is a runtime dependency that we would be breaking if we eliminated the directory. I'm hoping to avoid all that with this simple low hanging fruit issue and just refactor the class names to be more explicit between the auto installed modules vs plugins. |
Seems like an easy task and I'd like to give this a try. |
…ch-project#4034) Signed-off-by: rockybean <imrockybean@gmail.com>
@nknize to be fair, this change would make the codebase navigation obscure, at least from developer's standpoint. When I am looking for plugin classes, I just do Another, more serious problem is confusion with CDI, notably To sum up, I am strongly |
These are reasonable concerns so no apology necessary.
I think this is the problem I'm finding. Using the
I agree that the term Would a compromise be to refactor to |
I think |
Thank you @rockybean! It's wonderful to have your contribution. This was also the point of these low hanging fruit issues, for new contributors to participate, iterate, and further learn the code base. I'm curious as to your thoughts as well. Creative ways to make a distinction between OpenSearch Modules vs Plugins w/o adding more confusion regarding class injection (a clumsy implementation on it's own). I certainly don't want to spend much time bikeshedding but I'm constantly running into this confusion about what should be an external plugin, vs a core plugin, vs a module. The Geo module is getting a lot of refactoring and PR reviews for new contributors become difficult when they see
|
My biggest concern is that from a development/functionality perspective a Module is a Plugin (it's just installed by default), so I did not like the idea of a s/Plugin/Module rename. Renaming to |
I think the root of the confusion here is that "plugin" is a bit overloaded. A |
+1 on this. This has been a hot topic in the GeoSpatial maintainers. For a new person it becomes very difficult to understand the difference between modules folder and plugin folder. We can change the name to +0.5 on the name change. |
I did open up an issue tangential to the idea here[1]. [1] #1486 |
@nknize
|
Sure thing @rockybean please feel free to do the renaming. Thanks! |
Has finished the renaming task and please help to check if there is any problem. 🤝 ❤️ |
* Rename Class ending with Plugin to Module under modules dir (#4034) Signed-off-by: rockybean <imrockybean@gmail.com> * Rename from Module to ModulePlugin Signed-off-by: rockybean <imrockybean@gmail.com>
implemented in #4042 |
Is your feature request related to a problem? Please describe.
OpenSearch modules only differ from plugins in that they are installed by default. Aside from that the same plugin scaffolding is used between the two. This makes navigating the source tree difficult. For example, if I'm looking at IngestUserAgentPlugin and IngestAttachmentPlugin I'd have no way of knowing
IngestUserAgentPlugin
is a module andIngestAttachment
is a plugin. (missing javadocs aside).Describe the solution you'd like
I propose we rote refactor all derived
*Plugin
classes currently in themodules/
directory to*Module
to make it more clear which concrete plugin classes are installed by default vs which are not.Describe alternatives you've considered
Implement separate module and plugin base classes. I think this is overkill for something that works just fine today and will likely be reworked during the extensions effort.
Additional context
This is a good
low hanging fruit
effort that a community contributor could pick up for earning merit.The text was updated successfully, but these errors were encountered: