-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Onboarding] Small fixes from QA #196178
[Onboarding] Small fixes from QA #196178
Conversation
💚 Build Succeeded
Metrics [docs]Async chunks
|
@@ -19,7 +19,7 @@ export const JAVASCRIPT_INFO: CodeLanguage = { | |||
codeBlockLanguage: 'javascript', | |||
}; | |||
|
|||
const SERVERLESS_INSTALL_CMD = `npm install @elastic/elasticsearch-serverless`; | |||
const SERVERLESS_INSTALL_CMD = `npm install @elastic/elasticsearch`; |
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.
we made a decision to use the elasticsearch client vs the elasticsearch-serverless client even for serverless. cc @miguelgrinberg
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.
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.
If this is just for generating code snippets presented to Serverless customers, I don't see an issue. 👍
For a second I thought this was about actually using the Serverless client in the Kibana codebase, which was discussed in #169674 and is currently blocked.
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.
Yes, just generating code snippets. It's mainly about what we should advise developers to use for interfacing with serverless. When I spoke with @miguelgrinberg, we decided that we want customers to use Elasticsearch
client for both stack and serverless. Just double-checking here to ensure that this hasn't changed.
Also, it would be good to update the code exporter library with this direction. I'm hoping to use the code exporter for these examples in the future instead.
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.
Yes, just generating code snippets. It's mainly about what we should advise developers to use for interfacing with serverless. When I spoke with @miguelgrinberg, we decided that we want customers to use
Elasticsearch
client for both stack and serverless. Just double-checking here to ensure that this hasn't changed.
For the foreseeable future, the Serverless API will remain a subset of the Elasticsearch API, with the caveat that features usually land in Serverless weeks before they go in an Elasticsearch release. I think I'm lacking context here, but for "developers that interface with Serverless", we should likely recommend the elasticsearch-serverless client, as:
- it won't encourage you to use APIs that don't exist in Serverless,
- it will contain the APIs that are in Serverless but not in the Stack releases yet.
But it's not that simple:
- The elasticsearch client will work on Serverless, after all. And we care less about code completion for examples.
- I don't think the elasticsearch-serverless client supports HTTP, which means it can't be used against start-local. Likewise, it does not support like node sniffing which might be useful to use conditionally if you're migrating from a local cluster to Serverless.
- We initially wanted to have a "serverless mode" in the elasticsearch client to restrict the APIs and parameters to the subset that worked everywhere, but since Serverless is only a subset, that was not needed.
- There are ongoing discussions to merge the two clients, but it's unclear how we can make that work yet due to the very different release schedules.
For all those reasons, it can make sense to use the elasticsearch client here. In other words, LGTM!
Also, it would be good to update the code exporter library with this direction. I'm hoping to use the code exporter for these examples in the future instead.
What is the code exporter library? request-converter, which is used in Dev Tools to export Python and JS code, uses the elasticsearch client: https://github.com/elastic/request-converter/blob/main/src/exporters/javascript.tpl
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.
Sorry yes, i meant the request-converter. Great that always uses elasticsearch client!
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
Starting backport for target branches: 8.x |
## Summary - update the code examples to use the normal client, not the elasticsearch client. The devtools team wants us to use the elasticsearch client here - update the code samples highlighting component so you can see highlighting (cherry picked from commit 422cad5)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
# Backport This will backport the following commits from `main` to `8.x`: - [[Onboarding] Small fixes from QA (#196178)](#196178) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Joe McElroy","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-15T10:44:17Z","message":"[Onboarding] Small fixes from QA (#196178)\n\n## Summary\r\n\r\n- update the code examples to use the normal client, not the\r\nelasticsearch client. The devtools team wants us to use the\r\nelasticsearch client here\r\n- update the code samples highlighting component so you can see\r\nhighlighting","sha":"422cad5c2dca04ed121544079be255ac85f9e479","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-minor"],"title":"[Onboarding] Small fixes from QA","number":196178,"url":"https://github.com/elastic/kibana/pull/196178","mergeCommit":{"message":"[Onboarding] Small fixes from QA (#196178)\n\n## Summary\r\n\r\n- update the code examples to use the normal client, not the\r\nelasticsearch client. The devtools team wants us to use the\r\nelasticsearch client here\r\n- update the code samples highlighting component so you can see\r\nhighlighting","sha":"422cad5c2dca04ed121544079be255ac85f9e479"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/196178","number":196178,"mergeCommit":{"message":"[Onboarding] Small fixes from QA (#196178)\n\n## Summary\r\n\r\n- update the code examples to use the normal client, not the\r\nelasticsearch client. The devtools team wants us to use the\r\nelasticsearch client here\r\n- update the code samples highlighting component so you can see\r\nhighlighting","sha":"422cad5c2dca04ed121544079be255ac85f9e479"}}]}] BACKPORT--> Co-authored-by: Joe McElroy <[email protected]>
Summary