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] Require MediaType in Strings.toString API (#6009) #6414

Merged
merged 2 commits into from
Feb 21, 2023

Conversation

nknize
Copy link
Collaborator

@nknize nknize commented Feb 21, 2023

Backport 1f4cdd2 from #6009

Strings.toString is tightly coupled to XContentType.JSON which blocks
modularizing foundation classes from the server module to the core library. This
change refactors the Strings.toString API to accept a generic MediaType such that
the toString implementation detail is encapsulated to the :server module.

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@Poojita-Raj
Copy link
Contributor

Hey @nknize, seems like it failed on a related error:

Task :server:compileJava
/var/jenkins/workspace/gradle-check/search/server/src/main/java/org/opensearch/action/admin/indices/replication/SegmentReplicationStatsResponse.java:97: error: incompatible types: SegmentReplicationStatsResponse cannot be converted to MediaType
return Strings.toString(this, true, true);

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@codecov-commenter
Copy link

Codecov Report

Merging #6414 (1ec4dfb) into 2.x (8b3409e) will increase coverage by 0.01%.
The diff coverage is 27.55%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@             Coverage Diff              @@
##                2.x    #6414      +/-   ##
============================================
+ Coverage     70.34%   70.36%   +0.01%     
- Complexity    59187    59228      +41     
============================================
  Files          4798     4798              
  Lines        284176   284178       +2     
  Branches      41313    41313              
============================================
+ Hits         199899   199952      +53     
+ Misses        67562    67471      -91     
- Partials      16715    16755      +40     
Impacted Files Coverage Δ
...opensearch/client/slm/SnapshotLifecyclePolicy.java 0.00% <0.00%> (ø)
...ch/client/slm/SnapshotLifecyclePolicyMetadata.java 0.00% <0.00%> (ø)
.../opensearch/client/slm/SnapshotLifecycleStats.java 0.00% <0.00%> (ø)
...rch/client/slm/SnapshotRetentionConfiguration.java 0.00% <0.00%> (ø)
...java/org/opensearch/common/xcontent/MediaType.java 100.00% <ø> (ø)
...a/org/opensearch/common/xcontent/XContentType.java 100.00% <ø> (ø)
...h/script/mustache/MultiSearchTemplateResponse.java 56.25% <0.00%> (ø)
...rg/opensearch/index/rankeval/RankEvalResponse.java 98.57% <0.00%> (ø)
...va/org/opensearch/index/rankeval/RankEvalSpec.java 96.49% <0.00%> (ø)
...a/org/opensearch/index/rankeval/RatedDocument.java 81.03% <0.00%> (ø)
... and 574 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@nknize nknize merged commit c4ab236 into opensearch-project:2.x Feb 21, 2023
kartg added a commit to kartg/OpenSearch that referenced this pull request Feb 22, 2023
kartg added a commit to kartg/OpenSearch that referenced this pull request Feb 22, 2023
@kartg kartg mentioned this pull request Feb 22, 2023
23 tasks
kartg added a commit that referenced this pull request Feb 22, 2023
…) (#6414)" (#6431)

This reverts commit c4ab236 on the 2.6 branch. The change will be retained in the 2.x branch so it can be a part of the next 2.* release.

Signed-off-by: Kartik Ganesh <gkart@amazon.com>
Rishikesh1159 added a commit to Rishikesh1159/OpenSearch that referenced this pull request Mar 21, 2023
Signed-off-by: Rishikesh1159 <rishireddy1159@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip-changelog v2.6.0 'Issues and PRs related to version v2.6.0'
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants