-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Require MediaType in Strings.toString API #6009
Require MediaType in Strings.toString API #6009
Conversation
String.toString is tightly coupled to XContentType.JSON which blocks modularizing foundation classes from the server module to the core library. This change refactors the String.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>
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Codecov Report
📣 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 @@
## main #6009 +/- ##
============================================
+ Coverage 70.75% 70.85% +0.10%
- Complexity 58720 58778 +58
============================================
Files 4771 4771
Lines 280818 280820 +2
Branches 40568 40568
============================================
+ Hits 198704 198987 +283
+ Misses 65824 65524 -300
- Partials 16290 16309 +19
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
libs/x-content/src/main/java/org/opensearch/common/xcontent/MediaType.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
@andrross this change is breaking (#6009 (comment)), we could only backport it with #6013 (or similar change) |
So I'm concerned about backport paralysis in that we prevent progress out of fear of breaking something that's not widely used (or more correctly, not marked as a forward facing API). So let's look a little closer here. What's breaking? Data formats / indexes are not breaking. DSL API isn't. Java signatures are, but those are on classes that aren't marked as |
@nknize the |
But we don't support a formal MediaType API... (e.g., it's not marked @opensearch.api) |
That's a argument, I don't know if the |
Well we inherited a codebase with a majority implementation that is not suited to officially support community BWC beyond the public facing DSL and index encodings. So when I applied the annotation label in |
Thanks a lot @nknize , no concerns from my side anymore! |
@andrross I'm guessing I missed the changlog issue discussion. Is there any reason we didn't adopt other project behaviors w/ the changelog and use the issue number instead of the Pull request? Not only would this enforce (the recommendation of) having an issue for every PR it would eliminate this crazy commit dance of having to put a dummy URL in the changelog and push a commit that updates it right after opening the PR. Moreover, we could standardize on PR titles to look more official and more easily searched like |
@nknize I agree with your position, but the reality is that just the |
This is paralyzing. There's no 3.0 timetable and we should be able to move leaner as a project, even if that means plugin developers have to more closely monitor core changes and open PRs to refactor method signature changes. Ideally CI would be setup to broadcast build failure notifications that the original author could open the PRs on each of the repositories but I get that's not easily configured. In the meantime, committing core to not change even a single method in Update: until we settle on a backport strategy (which might be as simple as adding |
AFAIK that's the strategy we've been following. On |
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>
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>
…nsearch-project#6009) (opensearch-project#6414)" This reverts commit c4ab236. Signed-off-by: Kartik Ganesh <gkart@amazon.com>
Strings.toString
is tightly coupled toXContentType.JSON
which blocks modularizing foundation classes from the:server module
to theopensearch-core
library. This change refactors theStrings.toString
API to accept a genericMediaType
such that thetoString
implementation detail is encapsulated to the:server
module and the abstraction can be teased into the supporting libraries.relates #5910