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

Resurrect _xpack/watcher routes #70337

Merged
merged 4 commits into from
Apr 7, 2021

Conversation

joegallo
Copy link
Contributor

@joegallo joegallo commented Mar 11, 2021

Related to #51816 / #68905.

Adds back the _xpack/watcher routes when using rest compatibility for a request.

# no change here
joegallo@galactic:~/Code/elastic/elasticsearch $ curl http://localhost:9200/_watcher/stats
{"_nodes":{"total":1,"successful":1,"failed":0},"cluster_name":"runTask","manually_stopped":false,"stats":[{"node_id":"oPIII6_ZS4eP9-wUj3l8NA","watcher_state":"started","watch_count":0,"execution_thread_pool":{"queue_size":0,"max_size":0}}]}%

# _xpack/watcher doesn't exist
joegallo@galactic:~/Code/elastic/elasticsearch $ curl http://localhost:9200/_xpack/watcher/stats
{"error":"no handler found for uri [/_xpack/watcher/stats] and method [GET]"}%

# unless...
joegallo@galactic:~/Code/elastic/elasticsearch $ curl -H'accept:application/json;compatible-with=7' http://localhost:9200/_xpack/watcher/stats
{"_nodes":{"total":1,"successful":1,"failed":0},"cluster_name":"runTask","manually_stopped":false,"stats":[{"node_id":"oPIII6_ZS4eP9-wUj3l8NA","watcher_state":"started","watch_count":0,"execution_thread_pool":{"queue_size":0,"max_size":0}}]}%

@joegallo joegallo added the WIP label Mar 11, 2021
@joegallo joegallo force-pushed the resurrect-xpack-watcher-routes branch 4 times, most recently from 63b1842 to e730386 Compare March 31, 2021 16:57
@joegallo joegallo force-pushed the resurrect-xpack-watcher-routes branch 2 times, most recently from a534b40 to b6185f4 Compare April 5, 2021 14:55
@joegallo joegallo force-pushed the resurrect-xpack-watcher-routes branch from b6185f4 to 36e9ea5 Compare April 6, 2021 15:39
@joegallo joegallo removed the WIP label Apr 6, 2021
@joegallo joegallo requested a review from jakelandis April 6, 2021 17:05
@joegallo joegallo added the v8.0.0 label Apr 6, 2021
@joegallo joegallo marked this pull request as ready for review April 6, 2021 17:05
@joegallo
Copy link
Contributor Author

joegallo commented Apr 6, 2021

I copied over all the watcher API definitions into xpack equivalents, and then I copied over the basic yml tests and got them passing. On the one hand, this is a lot of code change, but on the other hand it's not like I sat down and wrote it all by hand either.

I could certainly do a round of tree shaking if we think it's important to cut this down -- that is, we could have a larger yml file of many tests that attempts to get something approaching reasonable coverage, rather than this copy/paste/edit cycle that I've currently done.

Copy link
Contributor

@jakelandis jakelandis left a comment

Choose a reason for hiding this comment

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

LGTM. No worries about the cp/paste from the original tests (assuming they are stable :) ) This does drive home the point we need to add the v7 into the sourceset (directory) name (which is on my todo list).

@joegallo joegallo merged commit 1256c2b into elastic:master Apr 7, 2021
@joegallo joegallo deleted the resurrect-xpack-watcher-routes branch April 7, 2021 15:11
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.

2 participants