Skip to content

Conversation

@mch2
Copy link
Member

@mch2 mch2 commented Sep 25, 2025

Description

In trying to test some changes to sql and OpenSearch I found it annoying to have to re-assemble and manually install a plugin every time I made a change to OpenSearch.

This change allows us to install and test plugins that are not shipped with OpenSearch core with gradlew run. You can use it by only specifying the plugin name or adding a specific version to test patches or a released version.

Example :
./gradlew run -PinstalledPlugins['opensearch-job-scheduler'] which will look for opensearch-job-scheduler:<current-opensearch-version>0-SNAPSHOT
or
./gradlew run -PinstalledPlugins['opensearch-job-scheduler:3.2.x.x]

it works fine along with existing plugins:

./gradlew run --debug-server-jvm -PinstalledPlugins="['opensearch-job-scheduler', 'opensearch-sql-plugin', 'repository-s3']"

If you are using a local version of an external plugin like I am the workflow would be:

  1. publish core to maven local once so the plugin is built with local changes (if you have api changes).
  2. publish the plugin to maven local with changes
  3. ./gradlew run as many times as you want, set breakpoints, test things, break things

Related Issues

N/A

Check List

  • Functionality includes testing.
  • API changes companion pull request created, if applicable.
  • Public documentation issue/PR created, if applicable.

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.

This change allows us to install  plugins not shipped with core with gradlew run.
It supports simply specifying the plugin name or adding a specific version.

Example:
./gradlew run -PinstalledPlugins['opensearch-job-scheduler'] or
./gradlew run -PinstalledPlugins['opensearch-job-scheduler:3.2.x.x]

Signed-off-by: Marc Handalian <marc.handalian@gmail.com>
@mch2 mch2 requested a review from a team as a code owner September 25, 2025 23:46
@github-actions
Copy link
Contributor

❕ Gradle check result for 77a7d03: UNSTABLE

Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure.

@codecov
Copy link

codecov bot commented Sep 26, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.34%. Comparing base (7abef8c) to head (16271a4).
⚠️ Report is 13 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #19428      +/-   ##
============================================
- Coverage     72.93%   72.34%   -0.59%     
+ Complexity    69947    69340     -607     
============================================
  Files          5676     5676              
  Lines        321121   321123       +2     
  Branches      46427    46428       +1     
============================================
- Hits         234195   232310    -1885     
- Misses        68032    69837    +1805     
- Partials      18894    18976      +82     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cwperks
Copy link
Member

cwperks commented Sep 26, 2025

This is great :). Thank you @mch2!

I wonder if it would be possible in the future to always install plugin dependencies automatically to prevent having to list them out. In either case, this is a big improvement for testing efficiency.

@mch2
Copy link
Member Author

mch2 commented Sep 26, 2025

I wonder if it would be possible in the future to always install plugin dependencies automatically to prevent having to list them out. In either case, this is a big improvement for testing efficiency.

yeah we could add a flag or param to fetch a set of bundled plugins. Though I'd imagine keeping that stable with a larger plugin list will be a challenge against snapshot versions, but could provide value in quickly identifying compatibility issues.

Signed-off-by: Marc Handalian <marc.handalian@gmail.com>
@github-actions
Copy link
Contributor

❌ Gradle check result for 16271a4:

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@andrross
Copy link
Member

@mch2 Another digression and something that would be separate from this PR, but what do you think about making the opensearch-plugin CLI behave similarly? At least for the official OpenSearch Project plugins, it would be nice to be able to install them by name regardless of whether they are part of the core repository or a separate repository. In other works opensearch-plugin install opensearch-knn should work the same way as opensearch-plugin install repository-s3 works.

@github-actions
Copy link
Contributor

❕ Gradle check result for 16271a4: UNSTABLE

Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure.

@mch2
Copy link
Member Author

mch2 commented Sep 29, 2025

@mch2 Another digression and something that would be separate from this PR, but what do you think about making the opensearch-plugin CLI behave similarly? At least for the official OpenSearch Project plugins, it would be nice to be able to install them by name regardless of whether they are part of the core repository or a separate repository. In other works opensearch-plugin install opensearch-knn should work the same way as opensearch-plugin install repository-s3 works.

Agreed this would be nice to have, esp given our new snapshot repo doesn't have browse functionality to find the plugins url.

@mch2 mch2 merged commit db4e85f into opensearch-project:main Sep 29, 2025
34 of 58 checks passed
peteralfonsi pushed a commit to peteralfonsi/OpenSearch that referenced this pull request Oct 15, 2025
…earch-project#19428)

* Update installedPlugins in run.gradle to fetch plugins from maven.

This change allows us to install  plugins not shipped with core with gradlew run.
It supports simply specifying the plugin name or adding a specific version.

Example:
./gradlew run -PinstalledPlugins['opensearch-job-scheduler'] or
./gradlew run -PinstalledPlugins['opensearch-job-scheduler:3.2.x.x]

Signed-off-by: Marc Handalian <marc.handalian@gmail.com>

* Add support for third party plugins

Signed-off-by: Marc Handalian <marc.handalian@gmail.com>

---------

Signed-off-by: Marc Handalian <marc.handalian@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants