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

7.x only REST specification fixes #56736

Merged
merged 3 commits into from
May 26, 2020
Merged

Conversation

jakelandis
Copy link
Contributor

Fixes for the REST specification specific to 7.x

  • remove ignore "cat.thread_pool.json" and remove the "" as an option. deprecrate size from cat.thread_pool in json spec #55984 deprecated this field since it these params here have no effect on this specific API
  • remove ignore "indices.put_mapping.json" by adding the required / in the path to pass validation.

Once these are fixed #56647 should be able to be cleanly backported to 7.x

@jakelandis jakelandis added v7.8.0 v7.7.1 Team:Clients Meta label for clients team labels May 14, 2020
@jakelandis jakelandis requested a review from russcam May 14, 2020 02:06
Copy link
Contributor

@russcam russcam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a comment about removing the empty sting enum option

@@ -36,7 +36,6 @@
"type":"enum",
"description":"The multiplier in which to display values",
"options":[
"",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this should be removed in 7.x. In removing this, it may introduce a breaking change to the client's API and because the major versioning of the clients is in lock step with Elasticsearch, it would be a breaking change to the client's API within a major version.

To move forward, we could special case handle an empty string enum option on size for cat.threadpool in the JSON schema.

Copy link
Contributor

@russcam russcam May 14, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it were removed, each client where it would introduce a breaking change would need to specially handle this in their generator

Copy link
Contributor Author

@jakelandis jakelandis May 14, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... i don't see a good way to special case this in the JSON schema. However, if there is a good way I am still a bit hesitant to special case this in the schema. Splippery slope argument about too many special cases and a schema stops being a schema due to special cases ... and a real world concern of readability and keeping 7.x closer inline with master.

I think that since there exists an API with a "" and there is support for it, that "" should validate with the schema (but only for 7.x). I added schema support across the board for "" in af2780a. This will not be forward ported to master, and since all changes generally go through master first it is pretty unlikely that someone will accidentally try to support "" since on master it will fail validation. (note #55736 removed this entirely from master)

I understand the desire to not break the clients, so I think we can either 1) support "" for 7.x, or 2) hard code to ignore this file in the task itself (like we do with _common), or 3) figure out how to special case this in the schema (I will need some assistance with that).

My preference is 1 (as in the latest update to this PR) (then 2, then 3)

thoughts?

Copy link
Contributor

@russcam russcam May 20, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since all changes generally go through master first it is pretty unlikely that someone will accidentally try to support "" since on master it will fail validation.

Good point; this sounds like a good argument for not needing to special case "" only to cat.threadpool in 7.x since any API changes would be backported from master which would disallow.

@pugnascotia pugnascotia changed the title 7.x only spec fixes 7.x only REST specification fixes May 14, 2020
@@ -44,7 +44,7 @@
"p"
],
"deprecated":{
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hadn't originally back-ported the deprecation to to 7.7, but am on https://github.com/elastic/elasticsearch/pull/56737/files this will help reduce the conflict.

@jakelandis
Copy link
Contributor Author

@russcam - mind taking another look w.r.t comment: #56736 (comment)

Copy link
Contributor

@russcam russcam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks @jakelandis

@jakelandis jakelandis merged commit 920677a into elastic:7.x May 26, 2020
@jakelandis jakelandis deleted the 7.x_spec_fixes branch May 26, 2020 17:34
jakelandis added a commit to jakelandis/elasticsearch that referenced this pull request May 26, 2020
Fixes for the REST specification specific to 7.x

* remove ignore "cat.thread_pool.json" and add the "" as valid option. elastic#55984 deprecated this field since it these params here have no effect on this specific API
* remove ignore "indices.put_mapping.json" by adding the required / in the path to pass validation.
jakelandis added a commit to jakelandis/elasticsearch that referenced this pull request May 26, 2020
Fixes for the REST specification specific to 7.x

* remove ignore "cat.thread_pool.json" and add the "" as valid option. elastic#55984 deprecated this field since it these params here have no effect on this specific API
* remove ignore "indices.put_mapping.json" by adding the required / in the path to pass validation.
jakelandis added a commit that referenced this pull request May 26, 2020
Fixes for the REST specification specific to 7.x

* remove ignore "cat.thread_pool.json" and add the "" as valid option. 
* remove ignore "indices.put_mapping.json" by adding the required / in the path to pass validation.
jakelandis added a commit that referenced this pull request May 26, 2020
Fixes for the REST specification specific to 7.x

* remove ignore "cat.thread_pool.json" and add the "" as valid option. 
* remove ignore "indices.put_mapping.json" by adding the required / in the path to pass validation.
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-features (:Core/Features/Features)

@elasticmachine elasticmachine added the Team:Data Management Meta label for data/management team label May 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug Team:Clients Meta label for clients team Team:Data Management Meta label for data/management team v7.7.1 v7.8.0 v7.9.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants