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

Fix breaking changes for 3.0.0 release #1424

Merged
merged 1 commit into from
Feb 21, 2025
Merged

Conversation

kaituo
Copy link
Collaborator

@kaituo kaituo commented Feb 21, 2025

Description

This PR updates imports and method references for bumping version to 3.0 alpha.

Specifically,

  • Replace import org.opensearch.client.Client; with import org.opensearch.transport.client.Client;
  • Replace getTotalHits().value with getTotalHits().value()
  • Replace import org.opensearch.action.support.master.AcknowledgedResponse; with import org.opensearch.action.support.clustermanager.AcknowledgedResponse;
  • Replace import org.opensearch.client.node.NodeClient; with import org.opensearch.transport.client.node.NodeClient;
  • Replace import org.opensearch.client.ClusterAdminClient; with import org.opensearch.transport.client.ClusterAdminClient;
  • Replace import org.opensearch.client.AdminClient; with import org.opensearch.transport.client.AdminClient;
  • Replace import org.opensearch.client.IndicesAdminClient; with import org.opensearch.transport.client.IndicesAdminClient;
  • Rename masterNodeId to clusterManagerNodeId

These changes align with similar PR: https://github.com/opensearch-project/flow-framework/pull/1026/files

Testing done:

  • gradle build

Related Issues

Resolves #[Issue number to be closed when this PR is merged]
opensearch-project/OpenSearch#3351

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.

@opensearch-trigger-bot opensearch-trigger-bot bot added documentation Improvements or additions to documentation infra Changes to infrastructure, testing, CI/CD, pipelines, etc. backport 2.x labels Feb 21, 2025
@kaituo kaituo changed the title Fix breaking changes for 3.0.0 releas Fix breaking changes for 3.0.0 release Feb 21, 2025
Copy link

codecov bot commented Feb 21, 2025

Codecov Report

Attention: Patch coverage is 56.25000% with 7 lines in your changes missing coverage. Please review.

Project coverage is 81.58%. Comparing base (ff200b2) to head (0df3a8a).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
.../opensearch/timeseries/cluster/ADDataMigrator.java 0.00% 0 Missing and 2 partials ⚠️
...ain/java/org/opensearch/ad/task/ADTaskManager.java 50.00% 0 Missing and 1 partial ⚠️
...cast/transport/ForecastRunOnceTransportAction.java 0.00% 0 Missing and 1 partial ⚠️
...arch/timeseries/ExecuteResultResponseRecorder.java 0.00% 0 Missing and 1 partial ⚠️
...opensearch/timeseries/indices/IndexManagement.java 0.00% 0 Missing and 1 partial ⚠️
...va/org/opensearch/timeseries/task/TaskManager.java 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #1424      +/-   ##
============================================
+ Coverage     81.51%   81.58%   +0.07%     
- Complexity     5855     5865      +10     
============================================
  Files           533      533              
  Lines         23664    23664              
  Branches       2374     2374              
============================================
+ Hits          19289    19306      +17     
+ Misses         3212     3196      -16     
+ Partials       1163     1162       -1     
Flag Coverage Δ
plugin 81.58% <56.25%> (+0.07%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
.../java/org/opensearch/ad/ADEntityProfileRunner.java 100.00% <ø> (ø)
...in/java/org/opensearch/ad/ADTaskProfileRunner.java 80.95% <ø> (ø)
...rg/opensearch/ad/AnomalyDetectorProfileRunner.java 100.00% <ø> (ø)
...opensearch/ad/ExecuteADResultResponseRecorder.java 84.21% <ø> (ø)
...ensearch/ad/client/AnomalyDetectionNodeClient.java 100.00% <ø> (ø)
...a/org/opensearch/ad/indices/ADIndexManagement.java 84.61% <ø> (ø)
...ain/java/org/opensearch/ad/ml/ADCheckpointDao.java 65.51% <ø> (ø)
...ensearch/ad/rest/RestAnomalyDetectorJobAction.java 100.00% <ø> (ø)
...earch/ad/rest/RestDeleteAnomalyDetectorAction.java 100.00% <ø> (ø)
...search/ad/rest/RestDeleteAnomalyResultsAction.java 19.04% <ø> (ø)
... and 121 more

... and 4 files with indirect coverage changes

This PR updates imports and method references for bumping version to 3.0 alpha.

Specifically,
- Replace `import org.opensearch.client.Client;` with `import org.opensearch.transport.client.Client;`
- Replace `getTotalHits().value` with `getTotalHits().value()`
- Replace `import org.opensearch.action.support.master.AcknowledgedResponse;` with `import org.opensearch.action.support.clustermanager.AcknowledgedResponse;`
- Replace `import org.opensearch.client.node.NodeClient;` with `import org.opensearch.transport.client.node.NodeClient;`
- Replace `import org.opensearch.client.ClusterAdminClient;` with `import org.opensearch.transport.client.ClusterAdminClient;`
- Replace `import org.opensearch.client.AdminClient;` with `import org.opensearch.transport.client.AdminClient;`
- Replace `import org.opensearch.client.IndicesAdminClient;` with `import org.opensearch.transport.client.IndicesAdminClient;`
- Rename `masterNodeId` to `clusterManagerNodeId`

These changes align with similar PR: https://github.com/opensearch-project/flow-framework/pull/1026/files

Testing done:
* gradle build

Signed-off-by: Kaituo Li <[email protected]>
@@ -35,7 +35,7 @@ buildscript {
js_resource_folder = "src/test/resources/job-scheduler"
common_utils_version = System.getProperty("common_utils.version", opensearch_build)
job_scheduler_version = System.getProperty("job_scheduler.version", opensearch_build)
bwcVersionShort = "2.19.0"
bwcVersionShort = "2.20.0"
Copy link
Member

Choose a reason for hiding this comment

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

since 2.20 wont be released, should this stay 2.19 or it fails if its not 2.20?

Copy link
Collaborator Author

@kaituo kaituo Feb 21, 2025

Choose a reason for hiding this comment

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

without doing it bwc test failed with

> `cluster{::securityBwcCluster0}` failed to wait for cluster health yellow after 40 SECONDS
    IO error while waiting cluster
    503 Service Unavailable

OpenSearch current major (3.0) is wire compatible only with last minor of previous major (2.20). Read opensearch-project/OpenSearch#5076 and opensearch-project/OpenSearch#5076

Copy link
Member

Choose a reason for hiding this comment

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

I see, I assume that might need to change in future though if 2.20 is never released we will want for example 2.19.x be bwc with 3.0?

@kaituo kaituo merged commit b6ded29 into opensearch-project:main Feb 21, 2025
21 checks passed
@opensearch-trigger-bot
Copy link

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/anomaly-detection/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/anomaly-detection/backport-2.x
# Create a new branch
git switch --create backport/backport-1424-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 b6ded29330f17357f7ac98432241a0a88187f6c4
# Push it to GitHub
git push --set-upstream origin backport/backport-1424-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/anomaly-detection/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-1424-to-2.x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x backport-failed documentation Improvements or additions to documentation infra Changes to infrastructure, testing, CI/CD, pipelines, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants