-
Notifications
You must be signed in to change notification settings - Fork 58
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
[FEATURE] New Extension Template Repo #925
Comments
Can you be more specific on what you want in this template? I created a basic CRUD extension on my personal repo here: https://github.com/dbwiddis/CRUDExtension I'd be happy to move "my" code or some version of it somewhere as a template, or an other sample similar to hello world, etc. but it's not clear to me what you're asking for that's not covered by that document or the hello world example. |
Hi @dbwiddis, something like your basic CRUD extension would be great. I am hoping to have a template where someone can use the GitHub repository template option to autofill a significant portion of the reusable code. With the template, I think we can skip over at least the dependency declaration and port assignment steps of the CREATE_YOUR_FIRST_EXTENSION document. I understand why they are there but I am trying to get a template in place where a user could reasonably create a basic extension to complete some task within an hour or so. Even just your CRUD extension would be a great step towards this as it gives the framework for us to be able to direct users to "put your code here." I think this would give us an "express" extension creation pattern that would be valuable for different community events like workshops, hackathons, and conferences. Basically, I am looking to make a template where as much generic code as possible is already present to allow for reuse in local development scenarios. I.e. I am user and just testing the extension against my own fork for fun. |
So this is what I came up with: https://github.com/scrawfor99/test_extension. I took your CRUD Extension then swapped to gradle and used the gradle tasks framework to write a couple different scripts. The first lets someone rename the extension base components. Is you run I also created three generic starting points for a new extension. The first is just your CRUDExtension. The second is a BasicOutline where the templateAction file becomes replaced with a generic outline of the file:
finally I also made a word counter extension
Each of these basic starting points can be triggered with So someone can first pick a starting template then automatically set all the values for the name of their extension from there. You can also continually rename the extension with the extension naming script. Once you rename it, running the |
It would also be nice if we could create a path for connecting a frontend. I will look into how this may be accomplished as well as what other scripts would be useful for getting started. |
Great work, @scrawfor99 ! I love the script idea. One small tweak, I'm not sure we're going to keep the client initialization via SDK. I've argued for its removal (See #625 and linked issues there). From a "create your first extension" standpoint it's easy, we just point people to the docs, but with a template you're going to need to actually import the documentation code. (That's really all the SDK does, btw, is copy one of those code bits.) |
Hey @scrawfor99 having just created a new plugin based on https://github.com/opensearch-project/opensearch-plugin-template-java I think this is probably the way to go. WDYT? |
Is your feature request related to a problem?
With the SDK, we offer support for creating custom extensions. As part of this process, a user needs to create a new repo and configure various settings to be compatible with OpenSearch.
I propose we create a new extension template where people can use the template for creating a new extension and not need to go through the process of grabbing the different configuration files.
I am curious to hear what defaults the maintainers would like to be included. I will submit a basic version for use shortly.
The text was updated successfully, but these errors were encountered: