kibana/x-pack/plugins/transform
Tomas Della Vedova 238791b942
ES client : use the new type definitions (#83808)
* Use client from branch

* Get type checking working in core

* Fix types in other plugins

* Update client types + remove type errors from core

* migrate Task Manager Elasticsearch typing from legacy library to client library

* use SortOrder instead o string in alerts

* Update client types + fix core type issues

* fix maps ts errors

* Update Lens types

* Convert Search Profiler body from a string to an object to conform to SearchRequest type.

* Fix SOT types

* Fix/mute Security/Spaces plugins type errors.

* Fix bootstrap types

* Fix painless_lab

* corrected es typing in Event Log

* Use new types from client for inferred search responses

* Latest type defs

* Integrate latest type defs for APM/UX

* fix core errors

* fix telemetry errors

* fix canvas errors

* fix data_enhanced errors

* fix event_log errors

* mute lens errors

* fix or mute maps errors

* fix reporting errors

* fix security errors

* mute errors in task_manager

* fix errors in telemetry_collection_xpack

* fix errors in data plugins

* fix errors in alerts

* mute errors in index_management

* fix task_manager errors

* mute or fix lens errors

* fix upgrade_assistant errors

* fix or mute errors in index_lifecycle_management

* fix discover errors

* fix core tests

* ML changes

* fix core type errors

* mute error in kbn-es-archiver

* fix error in data plugin

* fix error in telemetry plugin

* fix error in discover

* fix discover errors

* fix errors in task_manager

* fix security errors

* fix wrong conflict resolution

* address errors with upstream code

* update deps to the last commit

* remove outdated comments

* fix core errors

* fix errors after update

* adding more expect errors to ML

* pull the lastest changes

* fix core errors

* fix errors in infra plugin

* fix errors in uptime plugin

* fix errors in ml

* fix errors in xpack telemetry

* fix or mute errors in transform

* fix errors in upgrade assistant

* fix or mute fleet errors

* start fixing apm errors

* fix errors in osquery

* fix telemetry tests

* core cleanup

* fix asMutableArray imports

* cleanup

* data_enhanced cleanup

* cleanup events_log

* cleaup

* fix error in kbn-es-archiver

* fix errors in kbn-es-archiver

* fix errors in kbn-es-archiver

* fix ES typings for Hit

* fix SO

* fix actions plugin

* fix fleet

* fix maps

* fix stack_alerts

* fix eslint problems

* fix event_log unit tests

* fix failures in data_enhanced tests

* fix test failure in kbn-es-archiver

* fix test failures in index_pattern_management

* fixing ML test

* remove outdated comment in kbn-es-archiver

* fix error type in ml

* fix eslint errors in osquery plugin

* fix runtime error in infra plugin

* revert changes to event_log cluser exist check

* fix eslint error in osquery

* fixing ML endpoint argument types

* fx types

* Update api-extractor docs

* attempt fix for ese test

* Fix lint error

* Fix types for ts refs

* Fix data_enhanced unit test

* fix lens types

* generate docs

* Fix a number of type issues in monitoring and ml

* fix triggers_actions_ui

* Fix ILM functional test

* Put search.d.ts typings back

* fix data plugin

* Update typings in typings/elasticsearch

* Update snapshots

* mute errors in task_manager

* mute fleet errors

* lens. remove unnecessary ts-expect-errors

* fix errors in stack_alerts

* mute errors in osquery

* fix errors in security_solution

* fix errors in lists

* fix errors in cases

* mute errors in search_examples

* use KibanaClient to enforce promise-based API

* fix errors in test/ folder

* update comment

* fix errors in x-pack/test folder

* fix errors in ml plugin

* fix optional fields in ml api_integartoon tests

* fix another casting problem in ml tests

* fix another ml test failure

* fix fleet problem after conflict resolution

* rollback changes in security_solution. trying to fix test

* Update type for discover rows

* uncomment runtime_mappings as its outdated

* address comments from Wylie

* remove eslint error due to any

* mute error due to incompatibility

* Apply suggestions from code review

Co-authored-by: John Schulz <github.com@jfsiii.org>

* fix type error in lens tests

* Update x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_service.ts

Co-authored-by: Alison Goryachev <alisonmllr20@gmail.com>

* Update x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_service.test.ts

Co-authored-by: Alison Goryachev <alisonmllr20@gmail.com>

* update deps

* fix errors in core types

* fix errors for the new elastic/elasticsearch version

* remove unused type

* remove unnecessary manual type cast and put optional chaining back

* ML: mute Datafeed is missing indices_options

* Apply suggestions from code review

Co-authored-by: Josh Dover <1813008+joshdover@users.noreply.github.com>

* use canary pacakge instead of git commit

Co-authored-by: Josh Dover <me@joshdover.com>
Co-authored-by: Josh Dover <1813008+joshdover@users.noreply.github.com>
Co-authored-by: Gidi Meir Morris <github@gidi.io>
Co-authored-by: Nathan Reese <reese.nathan@gmail.com>
Co-authored-by: Wylie Conlon <wylieconlon@gmail.com>
Co-authored-by: CJ Cenizal <cj@cenizal.com>
Co-authored-by: Aleh Zasypkin <aleh.zasypkin@gmail.com>
Co-authored-by: Dario Gieselaar <dario.gieselaar@elastic.co>
Co-authored-by: restrry <restrry@gmail.com>
Co-authored-by: James Gowdy <jgowdy@elastic.co>
Co-authored-by: John Schulz <github.com@jfsiii.org>
Co-authored-by: Alison Goryachev <alisonmllr20@gmail.com>
2021-03-25 04:47:16 -04:00
..
common [ML] Transforms: Fixes missing number of transform nodes and error reporting in stats bar. (#93956) 2021-03-16 11:41:48 +01:00
public [ML] Fix Transform runtime mapping editor so mappings can be removed (#95108) 2021-03-24 13:28:31 -05:00
server ES client : use the new type definitions (#83808) 2021-03-25 04:47:16 -04:00
jest.config.js Elastic License 2.0 (#90099) 2021-02-03 18:12:39 -08:00
kibana.json Use SavedObjectClass from savedObject start contract instead of createSavedObjectClass (#80063) 2020-10-14 09:26:04 +02:00
readme.md [ML] Transforms: Adds a11y tests for Transform plugin (#93197) 2021-03-03 11:41:44 +00:00
tsconfig.json [ML] Transforms: Migrates transform plugin to TS project ref (#90190) 2021-02-03 17:14:03 +00:00

Documentation for Transforms UI developers

This plugin provides access to the transforms features provided by Elastic.

Requirements

To use the transforms feature, you must have at least a Basic license. For more info, refer to Set up transforms.

Setup local environment

Kibana

  1. Fork and clone the Kibana repo.

  2. Install nvm, node, yarn (for example, by using Homebrew). See Install dependencies.

  3. Make sure that Elasticsearch is deployed and running on localhost:9200.

  4. Navigate to the directory of the kibana repository on your machine.

  5. Fetch the latest changes from the repository.

  6. Checkout the branch of the version you want to use. For example, if you want to use a 7.9 version, run git checkout 7.9. (Your Elasticsearch and Kibana instances need to be the same version.)

  7. Run nvm use. The response shows the Node version that the environment uses. If you need to update your Node version, the response message contains the command you need to run to do it.

  8. Run yarn kbn bootstrap. It takes all the dependencies in the code and installs/checks them. It is recommended to use it every time when you switch between branches.

  9. Make a copy of kibana.yml and save as kibana.dev.yml. (Git will not track the changes in kibana.dev.yml but yarn will use it.)

  10. Provide the appropriate password and user name in kibana.dev.yml.

  11. Run yarn start to start Kibana.

  12. Go to http://localhost:560x/xxx (check the terminal message for the exact path).

For more details, refer to this getting started page.

Adding sample data to Kibana

Kibana has sample data sets that you can add to your setup so that you can test different configurations on sample data.

  1. Click the Elastic logo in the upper left hand corner of your browser to navigate to the Kibana home page.

  2. Click Load a data set and a Kibana dashboard.

  3. Pick a data set or feel free to click Add on all of the available sample data sets.

These data sets are now ready to be used for creating transforms in Kibana.

Running tests

Jest tests

Documentation: https://www.elastic.co/guide/en/kibana/current/development-tests.html#_unit_testing

Run the test following jest tests from `kibana/x-pack/plugins/transform.

New snapshots, all plugins:

yarn test:jest

Update snapshots for the transform plugin:

yarn test:jest -u

Update snapshots for a specific directory only:

yarn test:jest public/app/sections

Run tests with verbose output:

yarn test:jest --verbose

Functional tests

Before running the test server, make sure to quit all other instances of Elasticsearch.

Run the following commands from the x-pack directory and use separate terminals for test server and test runner. The test server command starts an Elasticsearch and Kibana instance that the tests will be run against.

  1. Functional UI tests with Trial license (default config):

     node scripts/functional_tests_server.js
     node scripts/functional_test_runner.js --include-tag transform
    

    Transform functional Trial license tests are located in x-pack/test/functional/apps/transform.

  2. Functional UI tests with Basic license:

     node scripts/functional_tests_server.js --config test/functional_basic/config.ts
     node scripts/functional_test_runner.js --config test/functional_basic/config.ts --include-tag transform
    

    Transform functional Basic license tests are located in x-pack/test/functional_basic/apps/transform.

  3. API integration tests with Trial license:

     node scripts/functional_tests_server.js
     node scripts/functional_test_runner.js --config test/api_integration/config.ts --include-tag transform
    

    Transform API integration Trial license tests are located in x-pack/test/api_integration/apis/transform.

  4. API integration tests with Basic license:

     node scripts/functional_tests_server.js --config test/api_integration_basic/config.ts
     node scripts/functional_test_runner.js --config test/api_integration_basic/config.ts --include-tag transform
    

    Transform API integration Basic license tests are located in x-pack/test/api_integration_basic/apis/ml.

  5. Accessibility tests:

    We maintain a suite of accessibility tests (you may see them referred to elsewhere as a11y tests). These tests render each of our pages and ensure that the inputs and other elements contain the attributes necessary to ensure all users are able to make use of Transforms (for example, users relying on screen readers).

     node scripts/functional_tests_server --config test/accessibility/config.ts
     node scripts/functional_test_runner.js --config test/accessibility/config.ts --grep=transform
    

    Transform accessibility tests are located in x-pack/test/accessibility/apps.