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

Warn when using deprecated syntax #8963

Closed
clintongormley opened this issue Dec 15, 2014 · 6 comments
Closed

Warn when using deprecated syntax #8963

clintongormley opened this issue Dec 15, 2014 · 6 comments
Labels
:Core/Infra/REST API REST infrastructure and utilities >feature

Comments

@clintongormley
Copy link

Currently, users have to read the release notes for every version to check what syntax/functionality has been deprecated. We should make it easier, by warning or even throwing an exception.

This can be controlled by the deprecations setting which accepts:

  • warn - logs and returns a warning in the request body when deprecated syntax/functionality/end points are used
  • error - throw an exception when deprecated syntax/functionality/end points are used
  • ignore - silently ignore deprecations

The default setting should be warn, to inform users during development of problems with their code. The user can set it to error to be sure that they are catching all problems, and they can set it to ignore in production so that known usage of deprecated functionality does not obscure real problems.

@clintongormley
Copy link
Author

Closed in favour of #11033

@clintongormley
Copy link
Author

Reopening. We should always log deprecations (based on the deprecation logging settings).

For warn, we should add a "warnings" section to the response, which lists all warnings. Strict throws an exception.

The index.query.parse.strict setting (see #11996) should be repurposed and renamed to response.deprecations.level, and should accept ignore, warn, strict.

The parse fields behaviour should be changed to collect deprecations, instead of throwing an exception, so that all warnings can be collected.

@nik9000
Copy link
Member

nik9000 commented Jul 22, 2016

I know we send a header when some usersIs this done or just partly done?

@clintongormley
Copy link
Author

I think this can be closed now - we have enough tooling around deprecations

@javanna
Copy link
Member

javanna commented Jul 27, 2016

The index.query.parse.strict setting (see #11996) should be repurposed and renamed to response.deprecations.level, and should accept ignore, warn, strict.

The parse fields behaviour should be changed to collect deprecations, instead of throwing an exception, so that all warnings can be collected.

Did we do any of these? I hope we did and I missed them :)

@nik9000
Copy link
Member

nik9000 commented Jul 27, 2016

The parse fields behaviour should be changed to collect deprecations, instead of throwing an exception, so that all warnings can be collected.

We did this one, but only in non-strict mode. It just collects deprecated stuff and sends Warning headers for them. I we're certainly talking about the other one in #19552.

@javanna javanna removed the help wanted adoptme label Aug 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/REST API REST infrastructure and utilities >feature
Projects
None yet
Development

No branches or pull requests

5 participants