-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
Convert all the docs to // CONSOLE #18160
Comments
Running If we can get the false positive rate down to 0 then we can fail the build if this finds any snippets. if. |
Hi nik9000, do you have any easy guide on how to assist with converting? |
The simplest thing to convert to
Now that should just work with You can test your changes by running There are places where we didn't write the whole API call but I think those are easier once you know the sense syntax. |
It's perfectly fine for the path to start with a |
Or paste it into Sense, which should convert it to Sense syntax. Then press Ctrl-I or Cmd-I to reformat. |
I didn't like their being two ways to do it and it looked like more than half of the docs did it sans- If you really want to have the inconsistency back I can support that too.
The great irony of this is that I never use sense. I tried this morning and, of course, it didn't like that I was running on Elasticsearch's master branch and I hadn't built it from source. I don't have the patience nor the skill with javascript to run that from master too, I think. |
If anything, I'd prefer the other way. But I'm OK with the inconsistency |
@clintongormley I created #18184 for it. |
@nik9000 How deep do we want those tests to be? TESTRESPONSE seems to be present only in a couple of documents. Concrete example: For the query dsl docs - should there be more than just the AUTOSENSE annotation to include them in the test run so parse failures are caught? Another questions: Should we/ do we barf in case there's deprecated stuff in those snippets? |
I don't know. Just trying to run the query at all is a huge improvement over what we have. As a first pass I'd just If we want to go deeper we can use the In my first pass I was just trying to convert what we had, inventing syntax along the way. I just tried to pick up all the
Yes we should. No we don't. I don't know that Elasticsearch has a parameter to reject deprecated stuff. If not we should invent a parameter and make a big deal out of it because it seems really useful. And all the snippets should send that parameter by default. I think some snippets will talk about deprecated syntax and we can make |
That's what I'm currently doing for the query-dsl docs (went through them about half a year ago already when switching the parsing code to ParseField, the more complicated json snippets ended up as *fromJSON tests in the *QueryBuilder Java tests back then, so I should recognize most of the issues I run into while going along)
For parsing queries through ParseField there is an option called "index.query.parse.strict" that will fail to parse deprecated json parameters with an exception. |
Cool! Is that at the index level? I'd love something at the request level for this though I haven't looked at how hard it'd be to implement. And it'd be great if it were global including stuff like detecting deprecated mappings and stuff. It is the kind of thing we could have a lively discussion with @clintongormley about, I think. |
#17512 is related to this setting. |
Lol, I should remember my own issues. |
This makes the test generation support both while we move from `// AUTOSENSE` to `// CONSOLE`. Will bother elastic#18160
@clintongormley, you mentioned to me that you planned to rewrite some areas of the docs soon and would get to this as part of the rewrite. Like #18356. Anyway, do you have a list of places you plan to rewrite or a list of places you know you won't rewrite? |
Mappings I won't rewrite (or only a little). Nor cluster and index settings. Analysis is in progress. That's about it - other docs I'll redo as I have the time |
Am I the only one having trouble to run Running into a
|
Clint had that a while back and needed to
|
That did the trick for me. Thanks. Another question: Is it possible to limit test execution to just one doc file? That might speed up finding typos a bit when converting doc files with several snippets which look easy enough to not require trying each one of them separately. |
This adds CONSOLE to sort docs in order to automatically execute the doc snippets. Fixes a few minor types along the way. Relates to elastic#18160
I originally wrote this file when we first added snippets testing and a lot has changed. We've grown quite fond of the `// TESTRESPONSE[s/foo/bar/]` construct, for example, but the docs discouraged its use. Relates to #18160
I originally wrote this file when we first added snippets testing and a lot has changed. We've grown quite fond of the `// TESTRESPONSE[s/foo/bar/]` construct, for example, but the docs discouraged its use. Relates to #18160
Adds CONSOLE to cross-cluster-search docs but skips them for testing because we don't have a second cluster set up. This gets us the `VIEW IN CONSOLE` and `COPY AS CURL` links and makes sure that they are valid yaml (not json, technically) but doesn't get testing. Which is better than we had before. Adds CONSOLE to the dynamic templates docs and ingest-node docs. The ingest-node docs contain a *ton* of non-console snippets. We might want to convert them to full examples later, but that can be a separate thing. Relates to #18160
Adds CONSOLE to cross-cluster-search docs but skips them for testing because we don't have a second cluster set up. This gets us the `VIEW IN CONSOLE` and `COPY AS CURL` links and makes sure that they are valid yaml (not json, technically) but doesn't get testing. Which is better than we had before. Adds CONSOLE to the dynamic templates docs and ingest-node docs. The ingest-node docs contain a *ton* of non-console snippets. We might want to convert them to full examples later, but that can be a separate thing. Relates to #18160
Amazing effort! Awesome.
…On 22 Oct 2017 10:30 a.m., "Nik Everett" ***@***.***> wrote:
@tlrx <https://github.com/tlrx> Finished this in 643eb28
<643eb28>.
Thanks everyone doing all this work! 🍰
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#18160 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AB-ZO7XdtGmbsYsqs2M3NInv6-vGKEgXks5suoyzgaJpZM4IYP5M>
.
|
Describe the feature:
#18075 will merge soon, testing all the
// CONSOLE
snippets in our docs. But lots of our docs aren't annotated with it! We should annotate more snippets so we test more of the docs.Edit:
// CONSOLE
has replaced// AUTOSENSE
. The sense application is named console in 5.0.0.The text was updated successfully, but these errors were encountered: