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

REST : deprecate field_data for Clear Indices Cache API #28943

Merged
merged 3 commits into from
Mar 13, 2018

Conversation

olcbean
Copy link
Contributor

@olcbean olcbean commented Mar 8, 2018

Throughout the code and the documentation fielddata is used. Only for the Clear Indices Cache API field_data has been used :

public static final ParseField FIELD_DATA = new ParseField("field_data", "fielddata");

( if fielddata is used as a url param, a deprecation warning is logged and also returned in the response headers )

Also the reference docs are referring only to fielddata.

For consistency reasons this PR deprecates field_data in favor of fielddata.


For context, a few usages of fielddata :

GET /_cat/fielddata
GET /_nodes/stats/indices/fielddata

Index setting : index.fielddata.cache


The change from fielddata to field_data has been done in e2c8ff9 ( at this point the two names were interchangeable : no deprecation logging )

Since b927cfe (#17804) a http warning header is sent for the deprecated usage

@elasticmachine
Copy link
Collaborator

Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually?

1 similar comment
@elasticmachine
Copy link
Collaborator

Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually?

@jasontedor jasontedor added :Core/Infra/REST API REST infrastructure and utilities review labels Mar 8, 2018
@jasontedor
Copy link
Member

FYI @elastic/es-core-infra.

@nik9000
Copy link
Member

nik9000 commented Mar 12, 2018

Makes sense to me.

@olcbean, could you add a yaml test for this API that just calls it with the new parameter to make sure the new preferred name? That'd make sure that we parse it and should be quite quick.

I think the right thing to do is, once this is ready, to merge it to master and 6.x and, in a followup, remove the now-deprecated name. @olcbean, would you like to do the follow-up?

@elasticmachine, test this please.

@javanna
Copy link
Member

javanna commented Mar 13, 2018

do we want to deprecate in 6.x and remove in 7.0? If so the migrate guide has to be updated.

@olcbean
Copy link
Contributor Author

olcbean commented Mar 13, 2018

Hm...
When a param is removed it should be documented ( in the followup PR )
In some cases when a deprecation is introduced, it is also documented. But I am not sure when.

The question is how to handle the docs ? Should I add a deprecation msg and if so, if I open the PR against master I do not have access to the 6.x migration docs ... I see two possible ways to proceed.

  • no deprecation note
  • open a separate migration doc PR against 6.x ( once this PR is backported to 6.x )

@olcbean
Copy link
Contributor Author

olcbean commented Mar 13, 2018

@nik9000 @javanna thanks for the reviews!
The PR is ready for another round ;)

@nik9000
Copy link
Member

nik9000 commented Mar 13, 2018

When a param is removed it should be documented ( in the followup PR )

We'll generate a changes list automatically. The script should pick up anything with breaking and deprecation labels and group them into the right section.

@nik9000
Copy link
Member

nik9000 commented Mar 13, 2018

@elasticmachine, test this please

@nik9000
Copy link
Member

nik9000 commented Mar 13, 2018

It looks like the PR test failures are because this needs to be simultaneously backported. That is no problem. I'll test locally.

@nik9000 nik9000 merged commit edc57f6 into elastic:master Mar 13, 2018
spinscale added a commit that referenced this pull request Mar 14, 2018
In order to fix the tests, the correct version needs to be skipped until
the backport is done.

Relates #28943
@spinscale
Copy link
Contributor

I have pushed 9f2c4df to fix failing tests until the backport is done.

nik9000 pushed a commit that referenced this pull request Mar 14, 2018
We call it `fielddata` everywhere else in the code and API so we may as
well be consistent.
@nik9000
Copy link
Member

nik9000 commented Mar 14, 2018

I have pushed 9f2c4df to fix failing tests until the backport is done.

I pushed the backport and reverted this. Sorry for the noise.

nik9000 added a commit that referenced this pull request Mar 14, 2018
nik9000 added a commit that referenced this pull request Mar 14, 2018
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.

7 participants