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

[Console] Update autocomplete variables #162156

Conversation

ElenaStoeva
Copy link
Contributor

@ElenaStoeva ElenaStoeva commented Jul 18, 2023

This PR is WIP

Closes #160539

Summary

This PR updates the autocomplete variables defined in the Console code so that they correspond to the variables in the Es specification repo.

The following differences have been identified:

Variable name in Console Variable name in Es specification (example) Action required
nodes node_id (e.g. GET _nodes/{node_id}) Rename nodes variable to node_id
indices index (e.g. GET _cat/indices/{index}) Delete indices variable (since an index variable already exists)
types Not used Delete types variable
node Not used Delete node variable
type Used in PUT _monitoring/{type}/bulk but might have a different context ?
template name (e.g. GET _template/{name}) Match a name variable with _template parent to a template autocomplete component
index_template name (e.g. GET _index_template/{name}) Match a name variable with _index_template parent to a index template autocomplete component
component_template name (e.g. GET _component_template/{name}) Match a name variable with _component_template parent to a component template autocomplete component
data_stream name (e.g. GET _data_stream/{name}) Match a name variable with _data_stream parent to a data stream autocomplete component

How to test:

  1. Checkout the ES specification repo
  2. Run the command with node scripts/generate_console_definitions.js --source <ES_SPECIFICATION_REPO> --dest src/plugins/console/server/lib/spec_definitions/json/new_script/generated where <ES_SPECIFICATION_REPO> is the absolute path to the root of the ES specification repo
  3. Modify this line to '../../server/lib/spec_definitions/json/new_script'
  4. Start Es with yarn es snapshot and run Kibana with yarn start.
  5. Go to Console.
  6. For each modified variable from the table above, type in an example url pattern that includes this variable. For example, typing GET _cat/indices/ should suggest a list of index names.

@ElenaStoeva ElenaStoeva added Feature:Console Dev Tools Console Feature Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more release_note:skip Skip the PR/issue when compiling release notes labels Jul 18, 2023
@ElenaStoeva ElenaStoeva self-assigned this Jul 18, 2023
@kibana-ci
Copy link
Collaborator

kibana-ci commented Jul 19, 2023

💔 Build Failed

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #21 / console app console autocomplete feature should provide basic auto-complete functionality
  • [job] [logs] FTR Configs #35 / console app console autocomplete feature should provide basic auto-complete functionality
  • [job] [logs] FTR Configs #21 / console app console autocomplete feature should provide basic auto-complete functionality
  • [job] [logs] FTR Configs #35 / console app console autocomplete feature should provide basic auto-complete functionality

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
console 418.5KB 418.3KB -197.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @ElenaStoeva

@yuliacech
Copy link
Contributor

Hi @ElenaStoeva, thanks a lot for looking into this issue! I was wondering how did you identify variables that need updating? Were you looking at all variables in the this file in Console? That would be a very good start to check them. But I'm also thinking that we could reach out to the Clients team about use of any variables in the specification schema and also we could write a simple script to match any string in the schema file that is wrapped with curly braces. The regex would look something like /\{\w+\}/ and we could get a list of variables check.

@ElenaStoeva
Copy link
Contributor Author

Closing in favor of #162917.

@ElenaStoeva ElenaStoeva deleted the console-update-autocomplete-variables branch August 15, 2023 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Console Dev Tools Console Feature release_note:skip Skip the PR/issue when compiling release notes Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Console] Update the logic for variables
3 participants