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

[BWC and API enforcement] Decorate the existing APIs with proper annotations (part 3) #11182

Merged
merged 1 commit into from
Nov 16, 2023

Conversation

reta
Copy link
Collaborator

@reta reta commented Nov 13, 2023

Description

Decorate the existing APIs with proper annotations. This is merely the first part so we could work through the small changesets vs big bang pull request. The API validations are fully automated (as annotation processor #9304).

All classes that are annotated in this pull request leak through org.opensearch.client.Client which is by definition (currently) is public APIs exposed through plugins and RestClient / HighLevelRestClient.

Related Issues

Part of #9303

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Failing checks are inspected and point to the corresponding known issue(s) (See: Troubleshooting Failing Builds)
  • Commits are signed per the DCO using --signoff
  • Commit changes are listed out in CHANGELOG.md file (See: Changelog)
  • 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.

Copy link
Contributor

❌ Gradle check result for 9b20bce: 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?

Copy link
Contributor

github-actions bot commented Nov 13, 2023

Compatibility status:

Checks if related components are compatible with change 199a68d

Incompatible components

Incompatible components: [https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/performance-analyzer.git]

Skipped components

Compatible components

Compatible components: [https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/reporting.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/opensearch-oci-object-storage.git, https://github.com/opensearch-project/sql.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/custom-codecs.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/neural-search.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/cross-cluster-replication.git, https://github.com/opensearch-project/performance-analyzer-rca.git, https://github.com/opensearch-project/geospatial.git]

Copy link
Contributor

❕ Gradle check result for 7de9a36: UNSTABLE

  • TEST FAILURES:
      1 org.opensearch.search.SearchWeightedRoutingIT.testShardRoutingWithNetworkDisruption_FailOpenEnabled

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

Copy link

codecov bot commented Nov 14, 2023

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (54ff353) 71.09% compared to head (07ccc2e) 71.26%.
Report is 1 commits behind head on main.

❗ Current head 07ccc2e differs from pull request most recent head 199a68d. Consider uploading reports for the commit 199a68d to get more accurate results

Files Patch % Lines
.../java/org/opensearch/common/settings/Settings.java 77.77% 1 Missing and 3 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #11182      +/-   ##
============================================
+ Coverage     71.09%   71.26%   +0.17%     
- Complexity    58752    58865     +113     
============================================
  Files          4888     4888              
  Lines        277207   277222      +15     
  Branches      40282    40287       +5     
============================================
+ Hits         197077   197561     +484     
+ Misses        63654    63130     -524     
- Partials      16476    16531      +55     

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

@reta reta force-pushed the bwc.3 branch 2 times, most recently from 326a566 to 318a704 Compare November 14, 2023 15:33
Copy link
Contributor

❕ Gradle check result for 326a566: UNSTABLE

  • TEST FAILURES:
      1 org.opensearch.search.SearchWeightedRoutingIT.testShardRoutingWithNetworkDisruption_FailOpenEnabled
      1 org.opensearch.remotestore.RemoteStoreStatsIT.testStatsResponseFromAllNodes
      1 org.opensearch.action.admin.cluster.node.tasks.ResourceAwareTasksTests.testTaskResourceTrackingDuringTaskCancellation

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

Copy link
Contributor

✅ Gradle check result for 318a704: SUCCESS

Copy link
Contributor

✅ Gradle check result for a38dc2c: SUCCESS

Copy link
Contributor

✅ Gradle check result for 3be616c: SUCCESS

Copy link
Contributor

❕ Gradle check result for 61bd2d3: UNSTABLE

  • TEST FAILURES:
      1 org.opensearch.http.SearchRestCancellationIT.testAutomaticCancellationDuringQueryPhase

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

Copy link
Contributor

❕ Gradle check result for 3a34bb6: UNSTABLE

  • TEST FAILURES:
      1 org.opensearch.search.SearchTimeoutIT.testSimpleTimeout {p0={"search.concurrent_segment_search.enabled":"false"}}

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

Copy link
Contributor

❌ Gradle check result for 72f2f4f: 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?

@reta
Copy link
Collaborator Author

reta commented Nov 14, 2023

❌ Gradle check result for 72f2f4f: FAILURE

#7934

Copy link
Contributor

❌ Gradle check result for 72f2f4f: 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?

Copy link
Contributor

❕ Gradle check result for 72f2f4f: UNSTABLE

  • TEST FAILURES:
      1 org.opensearch.cluster.allocation.ClusterRerouteIT.testDelayWithALargeAmountOfShards

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

@reta reta requested a review from VachaShah as a code owner November 15, 2023 14:10
@reta
Copy link
Collaborator Author

reta commented Nov 15, 2023

@andrross @dblock @nknize looks like the last large chunk, there are only 2 issues to fix (one of them should be addressed by #10921):

error: The element org.opensearch.action.search.SearchTransportService is part of the public APIs but is not maked as @PublicApi, @ExperimentalApi or @DeprecatedApi (referenced by org.opensearch.action.search.SearchPhaseContext) 
error: The element org.opensearch.common.inject.Module is part of the public APIs but is not maked as @PublicApi, @ExperimentalApi or @DeprecatedApi (referenced by org.opensearch.plugins.Plugin) 

Copy link
Contributor

❌ Gradle check result for 6eca3b7: 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?

Copy link
Contributor

❌ Gradle check result for 7d1515d: 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?

@reta
Copy link
Collaborator Author

reta commented Nov 15, 2023

❌ Gradle check result for 7d1515d: FAILURE

#7934
#9499

Copy link
Contributor

❕ Gradle check result for b64aae8: UNSTABLE

  • TEST FAILURES:
      1 org.opensearch.remotestore.multipart.RemoteStoreMultipartIT.testOverriddenBufferInterval

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

@andrross
Copy link
Member

@reta Unfortunately the other PR I just merged caused a conflict here :(

@reta
Copy link
Collaborator Author

reta commented Nov 15, 2023

@reta Unfortunately the other PR I just merged caused a conflict here :(

Thanks @andrross , will resolve the conflicts shortly!

Copy link
Contributor

✅ Gradle check result for 6bc7fdb: SUCCESS

Copy link
Contributor

❕ Gradle check result for 07ccc2e: UNSTABLE

  • TEST FAILURES:
      1 org.opensearch.remotestore.RemoteStoreStatsIT.testDownloadStatsCorrectnessSinglePrimarySingleReplica

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

…tations (part 3)

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
Copy link
Contributor

✅ Gradle check result for 199a68d: SUCCESS

@reta reta merged commit 09bacee into opensearch-project:main Nov 16, 2023
27 checks passed
@reta reta added the backport 2.x Backport to 2.x branch label Nov 16, 2023
@opensearch-trigger-bot
Copy link
Contributor

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/OpenSearch/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch/backport-2.x
# Create a new branch
git switch --create backport/backport-11182-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 09bacee5fc85676e97bee6b4ad87dec35c6aa8cc
# Push it to GitHub
git push --set-upstream origin backport/backport-11182-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch/backport-2.x

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

reta added a commit to reta/OpenSearch that referenced this pull request Nov 16, 2023
…tations (part 3) (opensearch-project#11182)

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
(cherry picked from commit 09bacee)
andrross pushed a commit that referenced this pull request Nov 16, 2023
…tations (part 3) (#11182) (#11231)

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
(cherry picked from commit 09bacee)
@@ -276,7 +282,7 @@ public Parameter<T> setValidator(Consumer<T> validator) {
/**
* Configure a custom serializer for this parameter
*/
public Parameter<T> setSerializer(Serializer<T> serializer, Function<T, String> conflictSerializer) {
protected Parameter<T> setSerializer(Serializer<T> serializer, Function<T, String> conflictSerializer) {
Copy link
Member

Choose a reason for hiding this comment

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

@reta I saw this failed for k-NN plugin field mapper: https://github.com/opensearch-project/k-NN/blob/main/src/main/java/org/opensearch/knn/index/mapper/KNNVectorFieldMapper.java#L138. Should Serializer be public? It seems like it is similar to setValidator.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks @jmazanec15 , I will take a look shortly, the Serializer is defined as protected interface

    @InternalApi
    protected interface Serializer<T> {
        void serialize(XContentBuilder builder, String name, T value) throws IOException;
    }

so it was really weird to have a public method that uses the protected interface

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@jmazanec15 the change was reverted, should be all good, thank you for noticing!

fahadshamiinsta pushed a commit to fahadshamiinsta/OpenSearch270 that referenced this pull request Dec 4, 2023
…tations (part 3) (opensearch-project#11182)

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
rayshrey pushed a commit to rayshrey/OpenSearch that referenced this pull request Mar 18, 2024
…tations (part 3) (opensearch-project#11182)

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
shiv0408 pushed a commit to Gaurav614/OpenSearch that referenced this pull request Apr 25, 2024
…tations (part 3) (opensearch-project#11182)

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
Signed-off-by: Shivansh Arora <hishiv@amazon.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