-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Replace usage of deprecated createIndex() method in tests #18389
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
base: main
Are you sure you want to change the base?
Replace usage of deprecated createIndex() method in tests #18389
Conversation
❌ Gradle check result for 98664e1: FAILURE 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? |
❌ Gradle check result for 98664e1: FAILURE 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? |
Seems org.opensearch.index.mapper.size.SizeMappingTests.testSizeNotSet is flaky. |
Previously the code was passing an empty string array as a simple mapping and the new code is passing |
98664e1
to
75c4f47
Compare
❌ Gradle check result for 75c4f47: FAILURE 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? |
❌ Gradle check result for 75c4f47: null 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? |
createIndexRequestBuilder.setMapping(mappings); | ||
} | ||
return createIndex(index, createIndexRequestBuilder); | ||
return createIndexWithSimpleMappings(index, settings, mappings); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see you have mentioned in description that you are keeping these methods so as not to break any down-streams. But I think we can get rid of them, and let down-streams (if any) change their utilities accordingly.
I wonder if the plugin or any down-streams would be consuming test utils?
We have a good few weeks before 3.2 release, and the changes that any breaking down-streams will have to do will be very minimal.
Realizing that breaking things mid-version might not be a good idea. But at the same time, we should keep a track to remove all the deprecated code during 4.x release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly I think the best way to keep track is to annotate the code properly. The annotations will generate warnings on usage and it's simple to do a search to find all the instances of deprecated code.
Now, actually spending the time to do the work to remove the deprecated things around the next major version release is another story...
This PR is stalled because it has been open for 30 days with no activity. |
The deprecated versions of this method take a type parameter, support for which was removed back in 2.0. The parameter is not used. I have kept the deprecated methods so as to not break downstream components that may be using them but changed all the code in server to stop passing in a type parameter. Signed-off-by: Andrew Ross <andrross@amazon.com>
75c4f47
to
f30c5a8
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #18389 +/- ##
============================================
- Coverage 72.91% 72.88% -0.03%
+ Complexity 69391 69358 -33
============================================
Files 5645 5645
Lines 318789 318789
Branches 46126 46126
============================================
- Hits 232442 232348 -94
- Misses 67551 67691 +140
+ Partials 18796 18750 -46 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
The deprecated versions of this method take a type parameter, support for which was removed back in 2.0. The parameter is not used. I have kept the deprecated methods so as to not break downstream components that may be using them but changed all the code in server to stop passing in a type parameter.
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.