Gradle plugin support for dependencies in plugin descriptor properties#17178
Gradle plugin support for dependencies in plugin descriptor properties#17178abseth-amzn wants to merge 1 commit into
Conversation
Signed-off-by: Abhilasha Seth <abseth@amazon.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #17178 +/- ##
============================================
+ Coverage 72.35% 72.40% +0.04%
- Complexity 65500 65662 +162
============================================
Files 5298 5306 +8
Lines 304603 304929 +326
Branches 44187 44256 +69
============================================
+ Hits 220397 220777 +380
+ Misses 66095 66035 -60
- Partials 18111 18117 +6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
thanks @abseth-amzn! |
| has.native.controller=${hasNativeController} | ||
| # | ||
| # 'dependencies': any dependencies specified by the plugin | ||
| dependencies=${dependencies} |
There was a problem hiding this comment.
I see we are adding dependencies as another parameter to plugin-descriptor.properties. Why not re-use opensearch.version ?
PluginInfo.java[1] already processes semver range. May be we might have to change opensearch-plugin install cli but thats pretty much it.
There was a problem hiding this comment.
Support for 'dependencies' as another parameter was already introduced in #11441. After that change, Opensearch expects either 'opensearch.version' or 'dependencies' parameter in the plugin descriptor properties file.
https://github.com/opensearch-project/OpenSearch/blame/e93791bc97b9791c422fa21e365df340cb8e2aa2/server/src/main/java/org/opensearch/plugins/PluginInfo.java#L291
Today, the semver support only works if plugin descriptor file has a 'dependencies' section with 'opensearch' as the only supported dependency.
Example test showing a sample plugin descriptor properties file - https://github.com/opensearch-project/OpenSearch/pull/11441/files#diff-1311b3459a8afb363dd9ff9d584421c3a8292fed4b0d25535f10a2b4a9c98bc7R94
With this commit (17178), we are adding capability for the opensearch-plugin to add this new parameter to the plugin-descriptor.properties file that it generates, so that users can leverage semver feature.
Here is the discussion from one of the discarded PRs regarding adding support for new 'dependencies' section - #6837 (review)
|
This PR is stalled because it has been open for 30 days with no activity. |
|
This PR is stalled because it has been open for 30 days with no activity. |
|
since @abseth-amzn doesn't seem to be working at AWS anymore - or at least not on OpenSearch - (no activities on the GH profile for more than a year) and this PR is abandoned i've taken its content, rebased it and raised #22426 with it. |
Description
#11441 added support for semver ranges in dependencies of plugins. This commit updates the
opensearchplugin(fromorg.opensearch.gradle:build-tools) to supportdependenciesproperty when building plugins. Without this support, plugin's plugin-descriptor.properties file would require manual update to adddependenciesproperty. With this support, it would be possible to build plugins with semver range support for opensearch using gradle code. Example usage:Since no plugin is currently using
dependenciesproperty, this change would simply add emptydependenciesproperty to plugin-descriptor.properties file. Example:Note - before this commit, opensearch process would reject above mentioned plugin-descriptor.properties file since it contains both
opensearch.versionanddependenciesproperty. With this commit, PluginInfo is being updated to allow files like above since one of these properties is empty.Hence this is a breaking change in opensearchplugin. The plugin-descriptor.properties file created by this plugin would not be accepted by older opensearch versions.
Following is an example of plugin-descriptor.properties file with
dependenciesproperty specified by the plugin in build.gradle (note emptyopensearch.versionproperty):Related Issues
Resolves #13187
Check List
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.