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

Enforce Content-Type requirement on the rest layer and remove deprecated methods #23146

Merged
merged 8 commits into from Feb 17, 2017

Conversation

Projects
None yet
3 participants
@jaymode
Member

jaymode commented Feb 13, 2017

This commit enforces the requirement of Content-Type for the REST layer and removes the deprecated methods in transport requests and their usages.

While doing this, it turns out that there are many places where *Entity classes are used from the apache http client libraries and many of these usages did not specify the content type. The methods that do not specify a content type explicitly have been added to forbidden apis to prevent more of these from entering our code base.

Relates #19388

Enforce Content-Type requirement on the rest layer and remove depreca…
…ted methods

This commit enforces the requirement of Content-Type for the REST layer and removes the deprecated methods in transport
requests and their usages.

While doing this, it turns out that there are many places where *Entity classes are used from the apache http client
libraries and many of these usages did not specify the content type. The methods that do not specify a content type
explicitly have been added to forbidden apis to prevent more of these from entering our code base.

Relates #19388
@clintongormley

This comment has been minimized.

Show comment
Hide comment
@clintongormley

clintongormley Feb 13, 2017

Member

Please add breaking changes docs

Member

clintongormley commented Feb 13, 2017

Please add breaking changes docs

jaymode added some commits Feb 13, 2017

@jaymode

This comment has been minimized.

Show comment
Hide comment
@jaymode

jaymode Feb 14, 2017

Member

Please add breaking changes docs

Thanks for the reminder. Breaking changes docs were added as part of #22691 and I cleaned them up some more.

Member

jaymode commented Feb 14, 2017

Please add breaking changes docs

Thanks for the reminder. Breaking changes docs were added as part of #22691 and I cleaned them up some more.

jaymode added some commits Feb 14, 2017

@javanna

left a few comments, LGTM besides those

Show outdated Hide outdated buildSrc/src/main/resources/forbidden/es-test-signatures.txt
@@ -431,7 +432,7 @@ private HttpUriRequest performRandomRequest(String method) throws Exception {
HttpEntity entity = null;
boolean hasBody = request instanceof HttpEntityEnclosingRequest && getRandom().nextBoolean();
if (hasBody) {
entity = new StringEntity(randomAsciiOfLengthBetween(10, 100));
entity = new StringEntity(randomAsciiOfLengthBetween(10, 100), ContentType.APPLICATION_JSON);

This comment has been minimized.

@javanna

javanna Feb 17, 2017

Member

thanks for fixing all these.

@javanna

javanna Feb 17, 2017

Member

thanks for fixing all these.

" upgrade easier");
}
return true;
}, Property.NodeScope, Property.Deprecated);

This comment has been minimized.

@javanna

javanna Feb 17, 2017

Member

do we have a test for this? just making sure that a 5.x cluster having the setting set to false can upgrade to 6.0.

@javanna

javanna Feb 17, 2017

Member

do we have a test for this? just making sure that a 5.x cluster having the setting set to false can upgrade to 6.0.

This comment has been minimized.

@jaymode

jaymode Feb 17, 2017

Member

I can add this as a setting for a node in the rolling-upgrade tests?

@jaymode

jaymode Feb 17, 2017

Member

I can add this as a setting for a node in the rolling-upgrade tests?

This comment has been minimized.

@javanna

javanna Feb 17, 2017

Member

sounds good.

@javanna

javanna Feb 17, 2017

Member

sounds good.

Show outdated Hide outdated docs/reference/api-conventions.asciidoc
Show outdated Hide outdated docs/reference/api-conventions.asciidoc
@@ -19,6 +19,9 @@ In previous versions of Elasticsearch, having a proper Content-Type for the data
Elasticsearch 6.0.0 enforces that all requests with a body must have a supported Content-Type and this type will
be used when parsing the data.
When using the `source` query string parameter, the `source_content_type` parameter must also be specified with
the media type of the source.

This comment has been minimized.

@javanna

javanna Feb 17, 2017

Member

shall we add a bullet point on the removal of all those setters from the Java api? If we don't want to list them all, shall we just explain the change which type of methods it affects and how to fix the compile error?

@javanna

javanna Feb 17, 2017

Member

shall we add a bullet point on the removal of all those setters from the Java api? If we don't want to list them all, shall we just explain the change which type of methods it affects and how to fix the compile error?

jaymode added some commits Feb 17, 2017

@jaymode jaymode merged commit b234644 into elastic:master Feb 17, 2017

1 of 2 checks passed

elasticsearch-ci Build finished.
Details
CLA Commit author has signed the CLA
Details
@jaymode

This comment has been minimized.

Show comment
Hide comment
@jaymode

jaymode Feb 17, 2017

Member

Thanks @javanna !

Member

jaymode commented Feb 17, 2017

Thanks @javanna !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment