Skip to content

Conversation

cwperks
Copy link
Member

@cwperks cwperks commented Jul 7, 2025

Description

This PR is a non-breaking change that is a precursor for #714

Essentially, there are plugins in the OpenSearch ecosystem that are directly instantiating the LockService class from JS SPI and I am seeking to forbid this in future versions of OpenSearch in favor of using dependency injection and only instantiating within the Job Scheduler.

Ultimately, I plan to convert the LockService to an interface.

The problem with having this class marked as final, is that I cannot replace usages like https://github.com/opensearch-project/geospatial/blob/506b38356e9ff79ce5dd3ac6871f4e871af6b2aa/src/test/java/org/opensearch/geospatial/ip2geo/common/Ip2GeoLockServiceTests.java#L35 because it requires mocking.

I would like to remove final as a modifier (only in the interim) to be able to replace existing places where the LockService is instantiated and then fully replace it with an interface.

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • API changes companion pull request created.
  • Commits are signed per the DCO using --signoff.
  • Public documentation issue/PR created.

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: Craig Perkins <[email protected]>
Copy link

codecov bot commented Jul 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 33.76%. Comparing base (707ea44) to head (34996bc).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main     #792   +/-   ##
=========================================
  Coverage     33.76%   33.76%           
  Complexity      143      143           
=========================================
  Files            29       29           
  Lines          1380     1380           
  Branches        132      132           
=========================================
  Hits            466      466           
  Misses          877      877           
  Partials         37       37           

☔ 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 cwperks merged commit 906af8b into opensearch-project:main Jul 8, 2025
19 of 22 checks passed
@github-project-automation github-project-automation bot moved this from 👀 In Review to ✅ Done in Engineering Effectiveness Board Jul 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants