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

Add details for gradle custom plugin. #144

Merged
merged 16 commits into from
May 10, 2022
Merged

Add details for gradle custom plugin. #144

merged 16 commits into from
May 10, 2022

Conversation

prudhvigodithi
Copy link
Member

@prudhvigodithi prudhvigodithi commented Apr 27, 2022

Signed-off-by: pgodithi [email protected]

Custom plugin's readme

Description

This PR will add a doc for gradle custom plugins and explains in details on how to use opensearch.pluginzip plugin

Issues Resolved

#143

Associated issues

opensearch-project/opensearch-build#1916

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: pgodithi <[email protected]>

Custom plugin's readme

Signed-off-by: pgodithi <[email protected]>

Custom plugin's readme

Signed-off-by: pgodithi <[email protected]>

Custom plugin's readme

Signed-off-by: pgodithi <[email protected]>

Custom plugin's readme

Signed-off-by: pgodithi <[email protected]>

Custom plugin's readme

Signed-off-by: pgodithi <[email protected]>

Custom plugin's readme

Signed-off-by: pgodithi <[email protected]>

Custom plugin's readme

Signed-off-by: pgodithi <[email protected]>

Custom plugin's readme

Signed-off-by: pgodithi <[email protected]>

Custom plugin's readme

Signed-off-by: pgodithi <[email protected]>

Custom plugin's readme

Signed-off-by: pgodithi <[email protected]>

Custom plugin's readme

Signed-off-by: pgodithi <[email protected]>

Custom plugin's readme

Signed-off-by: pgodithi <[email protected]>

Custom plugin's readme

Signed-off-by: pgodithi <[email protected]>

Custom plugin's readme

Signed-off-by: pgodithi <[email protected]>

Custom plugin's readme

Signed-off-by: pgodithi <[email protected]>
Signed-off-by: pgodithi <[email protected]>
Signed-off-by: pgodithi <[email protected]>
Signed-off-by: pgodithi <[email protected]>
Signed-off-by: pgodithi <[email protected]>
@prudhvigodithi
Copy link
Member Author

prudhvigodithi commented Apr 28, 2022

Hey @dblock can you please review this PR?
(To better Read)
I will link this doc to the issue's created for each plugin repo as as part of the campaign.
Example the issue will be something like this prudhvigodithi/opensearch-build#18

GRADLE_CUSTOM_PLUGINS.md Outdated Show resolved Hide resolved
GRADLE_CUSTOM_PLUGINS.md Outdated Show resolved Hide resolved
GRADLE_CUSTOM_PLUGINS.md Outdated Show resolved Hide resolved
GRADLE_CUSTOM_PLUGINS.md Outdated Show resolved Hide resolved
GRADLE_CUSTOM_PLUGINS.md Outdated Show resolved Hide resolved
GRADLE_CUSTOM_PLUGINS.md Outdated Show resolved Hide resolved
GRADLE_CUSTOM_PLUGINS.md Outdated Show resolved Hide resolved
GRADLE_CUSTOM_PLUGINS.md Outdated Show resolved Hide resolved
GRADLE_CUSTOM_PLUGINS.md Outdated Show resolved Hide resolved
@prudhvigodithi
Copy link
Member Author

Thanks @gaiksaya, added all your suggestions in the latest commits.

Copy link
Member

@dblock dblock left a comment

Choose a reason for hiding this comment

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

I think this belongs in "Building Plugins with OpenSearch", ie. BUILDING.md.

I'd also want to see examples implemented in https://github.com/opensearch-project/opensearch-plugin-template-java that match the doc.

@prudhvigodithi
Copy link
Member Author

prudhvigodithi commented Apr 28, 2022

Hey @dblock, you suggest to move the data of GRADLE_CUSTOM_PLUGINS.md(added via this PR) to BUILDING.md?
Also Coming to opensearch-plugin-template-java, this I see for creating any new OpenSearch plugins repo and but not for gradle plugins (under buildSrc/), did I miss anything from you previous comment ?

Signed-off-by: pgodithi <[email protected]>
Signed-off-by: pgodithi <[email protected]>
Signed-off-by: pgodithi <[email protected]>
Signed-off-by: pgodithi <[email protected]>
@prudhvigodithi
Copy link
Member Author

Hey @dblock migrated the details to BUILDING.md.
PR for opensearch-plugin-template-java
Once this is merged I will add a new PR for opensearch-plugin-template-java to add details about opensearch.pluginzip

Copy link
Member

@dblock dblock left a comment

Choose a reason for hiding this comment

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

I mostly have nitpicks, the doc is good!

BUILDING.md Outdated Show resolved Hide resolved
BUILDING.md Outdated Show resolved Hide resolved
[Plugin Code](https://github.com/opensearch-project/OpenSearch/tree/main/buildSrc/src/main/java/org/opensearch/gradle/pluginzip), [Plugin Tests](https://github.com/opensearch-project/OpenSearch/tree/main/buildSrc/src/test/java/org/opensearch/gradle/pluginzip), [Plugin META-INF](https://github.com/opensearch-project/OpenSearch/blob/main/buildSrc/src/main/resources/META-INF/gradle-plugins/opensearch.pluginzip.properties)


#### Plugin Design
Copy link
Member

Choose a reason for hiding this comment

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

I would remove this title.

Copy link
Member Author

Choose a reason for hiding this comment

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

Wont it be easy to check the plugin code location, if a user wants to know more details about this ?

Copy link
Member

Choose a reason for hiding this comment

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

The documentation for the plugin belongs with the plugin in its code. You can add these things as comments in the plugin itself. This doc is just about how to use it.

BUILDING.md Outdated Show resolved Hide resolved
BUILDING.md Outdated

#### Plugin Usage

* The Key requirement for this plugin to work is that the zip should be generated by `bundlePlugin` task that comes from existing [PublishPlugin](https://github.com/opensearch-project/OpenSearch/blob/main/buildSrc/src/main/java/org/opensearch/gradle/PublishPlugin.java).
Copy link
Member

Choose a reason for hiding this comment

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

Make the steps numbered, 1.2.3

Copy link
Member Author

Choose a reason for hiding this comment

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

@dblock so instead of * you suggest add number ?

Copy link
Member

@dblock dblock May 6, 2022

Choose a reason for hiding this comment

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

It's not an enumeration, I'd just write the text as is without any *.

BUILDING.md Outdated

Note: If there is a managed `build.sh` file and do not have any publish tasks, then its not required to exlcude these tasks, only required if it is calling publish tasks that targets ALL repos and ALL publications.

* Quick Example:
Copy link
Member

Choose a reason for hiding this comment

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

Point to a PR instead of lines of code, these links will stop working when those files are edited for whatever reason.

Copy link
Member Author

Choose a reason for hiding this comment

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

@dblock the plugins have not yet started to use to this gradle plugin, so we dont yet have a PR, once this document is merged and I have a PR as an example, then I can update the doc back again.

README.md Outdated Show resolved Hide resolved
@@ -6,6 +6,10 @@
- [Always Build SNAPSHOT Artifacts](#always-build-snapshot-artifacts)
- [Consume Maven Artifacts in Order](#consume-maven-artifacts-in-order)
- [Include Checksums in Maven Publications](#include-checksums-in-maven-publications)
- [Custom Gradle Plugins](#custom-gradle-plugins)
- [opensearch.pluginzip](#opensearchpluginzip)
- [Plugin Design](#plugin-design)
Copy link
Member

Choose a reason for hiding this comment

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

I would get rid of sub-sections and make it one entry (opensearch.pluginzip).

Copy link
Member Author

Choose a reason for hiding this comment

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

would it not be easy for a user to read sub-sections rather than a bit fat single section about the plugin? :)

Signed-off-by: pgodithi <[email protected]>
Signed-off-by: pgodithi <[email protected]>
@bbarani
Copy link
Member

bbarani commented May 6, 2022

I mostly have nitpicks, the doc is good!

@dblock Can we go ahead and merge this PR and work on the nitpicks later? I would like to see the teams start publishing the plugin zips from 2.0 GA version.

Signed-off-by: pgodithi <[email protected]>
Signed-off-by: pgodithi <[email protected]>
@prudhvigodithi
Copy link
Member Author

Hey @dblock I have pushed some suggested NIT's, please review.
Thanks

dblock
dblock previously approved these changes May 6, 2022
Copy link
Member

@dblock dblock left a comment

Choose a reason for hiding this comment

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

This looks good! I would just move the whole plugin design thing out. But also you can iterate on this later.

[Plugin Code](https://github.com/opensearch-project/OpenSearch/tree/main/buildSrc/src/main/java/org/opensearch/gradle/pluginzip), [Plugin Tests](https://github.com/opensearch-project/OpenSearch/tree/main/buildSrc/src/test/java/org/opensearch/gradle/pluginzip), [Plugin META-INF](https://github.com/opensearch-project/OpenSearch/blob/main/buildSrc/src/main/resources/META-INF/gradle-plugins/opensearch.pluginzip.properties)


#### Plugin Design
Copy link
Member

Choose a reason for hiding this comment

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

The documentation for the plugin belongs with the plugin in its code. You can add these things as comments in the plugin itself. This doc is just about how to use it.

BUILDING.md Outdated

#### Plugin Usage

1. The Key requirement for this plugin to work is that the zip should be generated by `bundlePlugin` task that comes from existing [PublishPlugin](https://github.com/opensearch-project/OpenSearch/blob/main/buildSrc/src/main/java/org/opensearch/gradle/PublishPlugin.java).
Copy link
Member

Choose a reason for hiding this comment

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

Nit: try to shorten things, e.g. "The Key requirement for this plugin to work is that the zip should be generated by bundlePlugin task" is the same as "Ensure that your project uses bundlePlugin".

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed this @dblock

@dblock dblock requested a review from gaiksaya May 6, 2022 22:23
Signed-off-by: pgodithi <[email protected]>
@dblock dblock merged commit 704764e into opensearch-project:main May 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants