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

[Backport 2.x] Make IndexStoreListener a pluggable interface #16594

Merged
merged 2 commits into from
Nov 7, 2024

Conversation

opensearch-trigger-bot[bot]
Copy link
Contributor

Backport 9b7681c from #16583.

Signed-off-by: Jay Deng <jayd0104@gmail.com>
(cherry picked from commit 9b7681c)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@jed326
Copy link
Collaborator

jed326 commented Nov 7, 2024

@reta I see detect breaking changes is failing, I think because I removed NodeEnvironment.IndexStoreListener which was public, but also marked as @opensearch.internal so it should be fine to removed/replace -- any pointers?

I don't think it's related to #16585 either

@jed326
Copy link
Collaborator

jed326 commented Nov 7, 2024

Ah and it's because I am also changing the constructor here to the new class:

public NodeEnvironment(Settings settings, Environment environment, IndexStoreListener indexStoreListener) throws IOException {

Should I move IndexStoreListener back into NodeEnvironment, at least on 2.x?

IMO this isn't really a breaking change because the class that was modified is marked as internal and transitively that means the constructor that was using said internal class is also internal. I do get that technically it is breaking though since we are changing the public constructor / removing the public classes.

@jed326
Copy link
Collaborator

jed326 commented Nov 7, 2024

@sohami @andrross curious to hear your opinions on this as well

@andrross
Copy link
Member

andrross commented Nov 7, 2024

@jed326 The breaking changes check is pretty strict and we can't override it because it will just keep failing for all subsequent PRs. Can you create an empty interface/class NodeEnvironment.IndexStoreListener on 2.x that just extends the new public class? And also add back the ctor parameter even if it is unused.

Copy link
Contributor

github-actions bot commented Nov 7, 2024

✅ Gradle check result for b602dfd: SUCCESS

@jed326
Copy link
Collaborator

jed326 commented Nov 7, 2024

Thanks @andrross , that makes sense let me give that a try. I'm not entirely sure if extending the new interface will work but worst case we can just leave the untouched old one around too.

@reta
Copy link
Collaborator

reta commented Nov 7, 2024

@sohami @andrross curious to hear your opinions on this as well

@jed326 @andrross One sec, looking, we should not fail for non-annotated classes.

Copy link

codecov bot commented Nov 7, 2024

Codecov Report

Attention: Patch coverage is 86.48649% with 5 lines in your changes missing coverage. Please review.

Project coverage is 71.86%. Comparing base (a957ded) to head (ee72da1).
Report is 4 commits behind head on 2.x.

Files with missing lines Patch % Lines
...org/opensearch/index/store/IndexStoreListener.java 80.95% 4 Missing ⚠️
.../main/java/org/opensearch/env/NodeEnvironment.java 80.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##                2.x   #16594      +/-   ##
============================================
+ Coverage     71.75%   71.86%   +0.11%     
- Complexity    65322    65379      +57     
============================================
  Files          5313     5314       +1     
  Lines        305109   305139      +30     
  Branches      44456    44458       +2     
============================================
+ Hits         218920   219291     +371     
+ Misses        67970    67614     -356     
- Partials      18219    18234      +15     

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

@reta
Copy link
Collaborator

reta commented Nov 7, 2024

@jed326 The breaking changes check is pretty strict and we can't override it because it will just keep failing for all subsequent PRs. Can you create an empty interface/class NodeEnvironment.IndexStoreListener on 2.x that just extends the new public class? And also add back the ctor parameter even if it is unused.

@jed326 the @andrross suggestion is correct (or we could place IndexStoreListener back into NodeEnvironment), NodeEnvironment is a public API and it is being modified in non-compatible way.

@jed326 jed326 force-pushed the backport/backport-16583-to-2.x branch from 7234c74 to b072b6b Compare November 7, 2024 20:02
@jed326
Copy link
Collaborator

jed326 commented Nov 7, 2024

Alright I brought back those old interfaces / constructors and marked them as @Deprecated, seems like breaking changes is passing now. Thanks @andrross @reta !

Signed-off-by: Jay Deng <jayd0104@gmail.com>
@jed326 jed326 force-pushed the backport/backport-16583-to-2.x branch from b072b6b to ee72da1 Compare November 7, 2024 20:19
Copy link
Contributor

github-actions bot commented Nov 7, 2024

❕ Gradle check result for ee72da1: 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.

@jed326 jed326 merged commit 3e1e2cf into 2.x Nov 7, 2024
39 checks passed
@github-actions github-actions bot deleted the backport/backport-16583-to-2.x branch November 7, 2024 21:38
* This constructor is kept around on 2.x to avoid breaking changes.
*/
@Deprecated(forRemoval = true, since = "2.19.0")
public NodeEnvironment(Settings settings, Environment environment, IndexStoreListener indexStoreListener) throws IOException {
Copy link
Member

Choose a reason for hiding this comment

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

@reta was this change required? I thought we exempted the constructors from the check?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@reta was this change required? I thought we exempted the constructors from the check?

@andrross not by default, but if annotated with @InternalApi (not the case)

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.

3 participants