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

Add docs for feature reset API #71759

Merged

Conversation

williamrandolph
Copy link
Contributor

Here are some docs for the Feature Reset API. These should have been included in #69469, but were left for later.

@williamrandolph williamrandolph added >docs General docs changes :Core/Infra/Core Core issues without another label v8.0.0 v7.13.0 labels Apr 15, 2021
@elasticmachine elasticmachine added Team:Docs Meta label for docs team Team:Core/Infra Meta label for core/infra team labels Apr 15, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-docs (Team:Docs)

@williamrandolph
Copy link
Contributor Author

williamrandolph commented Apr 15, 2021

I have two questions about this work:

  • How can I create a "warning" or "important" block to emphasize that this API shouldn't be used on production systems?
  • Is there a way to loosen the check on the API response so that this test doesn't break when feature states added or removed.

@jaymode
Copy link
Member

jaymode commented Apr 16, 2021

How can I create a "warning" or "important" block to emphasize that this API shouldn't be used on production systems?

For the warning, I am guessing something like the one on this page is good: https://github.com/elastic/elasticsearch/blob/master/docs/reference/index-modules.asciidoc

@jaymode
Copy link
Member

jaymode commented Apr 16, 2021

Is there a way to loosen the check on the API response so that this test doesn't break when feature states added or removed.

Maybe the following from https://github.com/elastic/elasticsearch/tree/master/docs#readme will be helpful:

One interesting difference here is that you often want to match against the response from Elasticsearch. To do that you can reference the "body" of the response like this: // TESTRESPONSE[s/"took": 25/"took": $body.took/]

@williamrandolph
Copy link
Contributor Author

I played with the substitutions, but I couldn't find a way to indicate a variable number of entries in a list. So we can either skip checking the result of this test, or we can require that if we add a feature state to the system, we have to add an entry here. Thoughts?

Copy link
Contributor

@debadair debadair left a comment

Choose a reason for hiding this comment

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

Left some suggestions--let me know if you have any questions!

@jaymode
Copy link
Member

jaymode commented Apr 20, 2021

I think you should be able to do what we do for things like plugins:

// TESTRESPONSE[s/"plugins": \[[^\]]*\]/"plugins": $body.$_path/]

Copy link
Member

@jaymode jaymode left a comment

Choose a reason for hiding this comment

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

Docs look good aside for Deb's suggestions.

@williamrandolph williamrandolph merged commit d1bcd2a into elastic:master Apr 21, 2021
williamrandolph added a commit that referenced this pull request Apr 21, 2021
* Add docs for feature reset API
* Prose and style much improved by Deb Adair.

Co-authored-by: debadair <[email protected]>
@williamrandolph
Copy link
Contributor Author

Backport commit: a46b8ea

williamrandolph added a commit to williamrandolph/elasticsearch that referenced this pull request Apr 27, 2021
* Add docs for feature reset API
* Prose and style much improved by Deb Adair.

Co-authored-by: debadair <[email protected]>
williamrandolph added a commit that referenced this pull request Apr 28, 2021
* Add docs for feature reset API (#71759)

* Make feature reset API response more informative (#71240)

Previously, the ResetFeatureStateStatus object captured its status in a
String, which meant that if we wanted to know if something succeeded or
failed, we'd have to parse information out of the string. This isn't a
good way of doing things.

I've introduced a SUCCESS/FAILURE enum for status constants, and added a
check for failures in the transport action. We return a 207 if some but not all
reset actions fail, and for every failure, we also return information about the
exception or error that caused it.

* Fix 7.x backport compilation issues

* Feature reset integration test should tolerate failed resets (#72326)

Co-authored-by: debadair <[email protected]>
Co-authored-by: Jay Modi <[email protected]>
@jakelandis jakelandis removed the v8.0.0 label Jul 26, 2021
@williamrandolph williamrandolph deleted the feature-reset-api-docs branch May 23, 2022 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/Core Core issues without another label >docs General docs changes Team:Core/Infra Meta label for core/infra team Team:Docs Meta label for docs team v7.13.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants