-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Introduce stability description to the REST API specification #38413
Conversation
This could in the future also include e.g |
For deprecations I prefer @mayya-sharipova proposal here: #35262 |
Pinging @elastic/es-core-infra |
Discussed during
|
Addressed this item. |
2d6b084
to
cc855a3
Compare
We want to document these two for some time. I'll open an issue for this so that folks can track process as we've been answering this question every once in a while, but I plan on tackling the docs in the next couple of weeks |
Awesome to hear @jkakavas looking forward to those 👍 |
run elasticsearch-ci/2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, I think this is a good change. Ultimately I would like to see stability
be a field that is required to be defined so that APIs do not get accidentally marked as stable due to leaving this field out. Additionally, there is at least one stable
API that is not stable in terms of the response body, see #40104. Should we have a separate type for these?
@@ -1,6 +1,7 @@ | |||
{ | |||
"ccr.delete_auto_follow_pattern": { | |||
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-delete-auto-follow-pattern.html", | |||
"stability" : "beta", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think all CCR APIs are GA #39722
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ta, this PR preceeded that one. Updated now.
@@ -1,6 +1,7 @@ | |||
{ | |||
"sql.clear_cursor": { | |||
"documentation": "Clear SQL cursor", | |||
"stability" : "beta", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SQL APIs should be GA as of 6.7. @elastic/es-sql can you confirm?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, SQL is GA since 6.7. Thanks @jaymode for picking it up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated, to reflect latest state changes. Thanks for confirming.
cc @elastic/es-clients thoughts on the effect of #40104 on this PR? What should we call this type of API? its stable in terms of url/query_params but the body is reserved to be broken in between versions. This API (GET /_cluster/state) is now for inspection purposes only and not an API users should be expected to write features against. cc @elastic/microsoft #40104 has deep implications on how we map |
It looks like this would be a candidate for the |
Here's a good example, in #39382 (emphasis mine):
The API specification doesn't include the documentation link even, so this one looks a very good candidate for (Note that the client generators still need a documentation link.) |
cc855a3
to
bd29ddc
Compare
I opted for Its here to stay but we no longer make guarantees about its output staying the same during the course of a major version. This is different then |
@DaveCTurner @jasontedor would love to get your input on the stability listed for the cluster state API and whether that matches your intentions. |
Yes, |
I would not want to oversimplify states too much:
@jaymode I've amended the PR so that not specifying Also if someone specifies a |
I agree with @Mpdreamz here — the distinction between |
run elasticsearch-ci/2 |
0428aef
to
e9cfcb0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…ility appears after documentation everywhere
run elasticsearch-ci/1 |
I think this can be achieved in a different way. The api is "stable" in that the cluster state handler is not going away. It is the content that is unstable, ie the data returned by the cluster state api is an opaque blob.
I don't think those should have rest api specs at all. They can exist as http handlers in the code, and used eg for documentation generation, but not exist in the spec. That was the same conclusion we agreed on in the original discussion regarding |
The semantics between It basically signals the difference between map these requests and responses or not.
The progression of an API would be:
The meaning of
Given that we feel data_frame should have never been committed if they are stubs, and we are happy to role |
An alternative option would be to mark
The
With |
This is what I was suggesting, and I think it is simpler and more clear.
It is unclear how kibana can do testing against an api that is considered "private", as anything returned from it could possibly change at any time and break tests. I feel strongly these private or internal apis should simply not exist within our spec files, as the spec files by definition are the apis we expect users to use. |
The I know this hasn't been the case when you opened this PR, but meanwhile it progressed to beta ( |
…y value format that can be changed during minors
Addressed remaining PR comments:
"response": {
"treat_json_as_key_value" : true
}
There are 2 API's that are not really intended for public consumption though:
I wholeheartedly subscribe to not implementing private/internal API's and in effect blessing the java client as the defacto client e.g both of those API's are useful from other ecosystems too (beats/logstash/codesearch/apm et all). That said I changed these to be documented as |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM other than the merge conflict due to the painless context api being moved.
…c#38413) * introduce state to the REST API specification * change state over to stability * CCR is no GA updated to stable * SQL is now GA so marked as stable * Introduce `internal` as state for API's, marks stable in terms of lifetime but unstable in terms of guarantees on its output format since it exposes internal representations * make setting a wrong stability value, or not setting it at all an error that causes the YAML test suite to fail * update spec files to be explicit about their stability state * Document the fact that stability needs to be defined Otherwise the YAML test runner will fail (with a nice exception message) * address check style violations * update rest spec unit tests to include stability * found one more test spec file not declaring stability, made sure stability appears after documentation everywhere * cluster.state is stable, mark response in some way to denote its a key value format that can be changed during minors * mark data frame API's as beta * remove internal and private as states for an API * removed the wrong enum values in the Stability Enum in the previous commit (cherry picked from commit 61c34bb)
…c#38413) * introduce state to the REST API specification * change state over to stability * CCR is no GA updated to stable * SQL is now GA so marked as stable * Introduce `internal` as state for API's, marks stable in terms of lifetime but unstable in terms of guarantees on its output format since it exposes internal representations * make setting a wrong stability value, or not setting it at all an error that causes the YAML test suite to fail * update spec files to be explicit about their stability state * Document the fact that stability needs to be defined Otherwise the YAML test runner will fail (with a nice exception message) * address check style violations * update rest spec unit tests to include stability * found one more test spec file not declaring stability, made sure stability appears after documentation everywhere * cluster.state is stable, mark response in some way to denote its a key value format that can be changed during minors * mark data frame API's as beta * remove internal and private as states for an API * removed the wrong enum values in the Stability Enum in the previous commit (cherry picked from commit 61c34bb)
#43278) * introduce state to the REST API specification * change state over to stability * CCR is no GA updated to stable * SQL is now GA so marked as stable * Introduce `internal` as state for API's, marks stable in terms of lifetime but unstable in terms of guarantees on its output format since it exposes internal representations * make setting a wrong stability value, or not setting it at all an error that causes the YAML test suite to fail * update spec files to be explicit about their stability state * Document the fact that stability needs to be defined Otherwise the YAML test runner will fail (with a nice exception message) * address check style violations * update rest spec unit tests to include stability * found one more test spec file not declaring stability, made sure stability appears after documentation everywhere * cluster.state is stable, mark response in some way to denote its a key value format that can be changed during minors * mark data frame API's as beta * remove internal and private as states for an API * removed the wrong enum values in the Stability Enum in the previous commit (cherry picked from commit 61c34bb)
#43279) * introduce state to the REST API specification * change state over to stability * CCR is no GA updated to stable * SQL is now GA so marked as stable * Introduce `internal` as state for API's, marks stable in terms of lifetime but unstable in terms of guarantees on its output format since it exposes internal representations * make setting a wrong stability value, or not setting it at all an error that causes the YAML test suite to fail * update spec files to be explicit about their stability state * Document the fact that stability needs to be defined Otherwise the YAML test runner will fail (with a nice exception message) * address check style violations * update rest spec unit tests to include stability * found one more test spec file not declaring stability, made sure stability appears after documentation everywhere * cluster.state is stable, mark response in some way to denote its a key value format that can be changed during minors * mark data frame API's as beta * remove internal and private as states for an API * removed the wrong enum values in the Stability Enum in the previous commit (cherry picked from commit 61c34bb)
This introduces a
state
key to the REST API specs to signal an API's readiness:state
indicating the state of the API, defaults tostable
private
this API should not be be implemented by clientsexperimental
highly likely to break in the near future (minor/path), no bwc guarantees.Possibly removed in the future.
beta
less likely to break or be removed but still reserve the right to do sostable
No backwards breaking changes in a minor (default if not specified)