Commit graph

93 commits

Author SHA1 Message Date
Spencer eaf70a0b4e
[kbn/ui-shared-deps] split into two packages (#110558)
* [kbn/ui-shared-deps] split into two packages

* fix asset categorizer

* update snapshots

* reference npm dll from optimizer

Co-authored-by: spalger <spalger@users.noreply.github.com>
2021-09-16 12:06:46 -07:00
Jonathan Budzenski 17a4186ce8
[timelion] Move grammar to package (#111881)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-09-15 20:22:15 -04:00
Cauê Marcondes 2711e7b1cc
Removing old e2e (#112170)
* removing old e2e

* removing e2e

* removing e2e

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-09-15 16:33:54 -04:00
Stratoula Kalafateli e20f530762
Move to vis_types folder part 3 (#112084)
* Move to vis_types folder part 3

* Fix jest tests
2021-09-15 14:46:48 +03:00
Jean-Louis Leysens f08005e0e7
[Reporting] Create reports with full state required to generate the report (#101048)
* very wip

* - Reached first iteration of reporting body value being saved with
  the report for **PDF**
- Removed v2 of the reporting since it looks like we may be able
  to make a backwards compatible change on existing PDF/PNG
  exports

* reintroduced pdfv2 export type, see https://github.com/elastic/kibana/issues/99890\#issuecomment-851527878

* fix a whol bunch of imports

* mapped out a working version for pdf

* refactor to tuples

* added v2 pdf to export type registry

* a lot of hackery to get reports generated in v2

* added png v2, png reports with locator state

* wip: refactored for loading the saved object on the redirect app URL

* major wip: initial stages of reporting redirect app, need to add a way to generate v2 reports!

* added a way to generate a v2 pdf from the example reporting plugin

* updated reporting example app to read and accept forwarded app state

* added reporting locator and updated server-side route to not use Boom

* removed reporting locator for now, first iteration of reports being generated using the reporting redirect app

* version with PNG working

* moved png/v2 -> png_v2

* moved printable_pdf/v2 -> printable_pdf_v2

* updated share public setup and start mocks

* fix types after merging master

* locator -> locatorParams AND added a new endpoint for getting locator params to client

* fix type import

* fix types

* clean up bad imports

* forceNow required on v2 payloads

* reworked create job interface for PNG task payload and updated consumer code report example for forcenow

* put locatorparams[] back onto the reportsource interface because on baseparams it conflicts with the different export type params

* move getCustomLogo and generatePng to common for export types

* additional import fixes

* urls -> url

* chore: fix and update types and fix jest import mocks

* - refactored v2 behaviour to avoid client-side request for locator
  instead this value is injected pre-page-load so that the
  redirect app can use it
- refactored the interface for the getScreenshot observable
  factory. specifically we now expect 'urlsOrUrlTuples' to be
  passed in. tested with new and old report types.

* updated the reporting example app to use locator migration for v2 report types

* added functionality for setting forceNow

* added forceNow to job payload for v2 report types and fixed shared components for v2

* write the output of v2 reports to stream

* fix types for forceNow

* added tests for execute job

* added comments, organized imports, removed selectors from report params

* fix some type issues

* feedback: removed duplicated PDF code, cleaned screenshot observable function and other minor tweaks

* use variable (not destructured values) and remove unused import

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-08-12 18:40:19 +02:00
Jonathan Budzenski 11e68fda87
[packages] Move @kbn/interpreter to Bazel (#101089)
Co-authored-by: Tiago Costa <tiagoffcc@hotmail.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-06-22 09:59:20 -05:00
Tiago Costa cee33b004c
chore(NA): moving @kbn/ui-shared-deps into bazel (#101669)
* chore(NA): moving @kbn/io-ts-utils into bazel

* chore(NA): moving @kbn/ui-shared-deps into bazel

* chore(NA): compelte working build for @kbn/ui-shared-deps

* chore(NA): solve eslint problems

* chore(NA): solve typechecking

* chore(NA): debugger changes

* chore(NA): update optimizer basic integration tests

* chore(NA): ship kbn/ui-shared-deps metrics.json from new location at shared_built_assets

* chore(NA): use correct ui-shared-deps metrics file location

* chore(NA): remove webpack bazel config

* chore(NA): implement improvements on webpack config

* chore(NA): remove extra comment

* chore(NA): try esbuild-loader minimizer

* Revert "chore(NA): try esbuild-loader minimizer"

This reverts commit bffc49aaae.

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-06-18 16:09:31 +01:00
Tim Roes 2744f70466
Remove the no longer used release-notes script (#97806)
* Remove the no longer used release-notes script

* Commit missing file
2021-04-21 20:58:39 +02:00
Pierre Gayvallet 251bd9afc6
Remove /src/legacy (#95510)
* starting removing stuff

* fix jest config

* disable CLI mode until other PR is merged

* fix the schema

* add deprecation for maxPayloadBytes

* fix legacy start logic

* deletes `env` from unknown args

* fix FTR test config

* some legacy service deletion

* move config validation

* remove legacy exports from entrypoint

* preserve legacy logging in core logging config

* try to fix uiSettings integration tests

* fix legacy service tests

* more type fix

* use fromRoot from @kbn/utils

* cleanup kibana.d.ts

* fix unit tests

* remove src/core/server/utils

* fix server script

* add integration test for `/{path*}` route

* add unit tests on legacy config

* adapt uiSetting IT bis

* fix tests

* update generated doc

* address some review comments

* move review comments

* fix some stuff

* fix some stuff

* fix some stuff

* fix some stuff bis

* generated doc

* add test for ensureValidConfiguration
2021-04-06 09:25:36 +02:00
Tiago Costa 7c689a5b5b
chore(NA): stop grouping bazel out symlink folders (#96066) 2021-04-01 14:16:14 -05:00
Brian Seeders 03206b688a
[CI] Build and publish storybooks (#87701) 2021-02-18 14:13:23 -05:00
Alexey Antonov aa468c1d56
[Timelion] Communicate the index pattern to the dashboard (#90623)
* [Timelion] Communicate the index pattern to the dashboard

Closes #86418

* update types / limits.yml

* Update timelion_vis_type.tsx

* fix typo

* remove extra await

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-02-11 14:24:08 +03:00
Spencer 4190ea4237
[eslint] stop ignoring .storybook files (#90447)
Co-authored-by: spalger <spalger@users.noreply.github.com>
2021-02-05 10:52:39 -07:00
Tiago Costa a0d5d5614d
chore(NA): introduce new yarn kbn reset command to support bazel workflow (#89597)
* chore(NA): introduce new yarn kbn destroy command to support bazel workflow

* chore(NA): update wording for new kbn pm changes

* chore(NA): update .bazelrc.common

Co-authored-by: Tyler Smalley <tylersmalley@me.com>

* chore(NA): update .bazelrc

Co-authored-by: Tyler Smalley <tylersmalley@me.com>

* chore(NA): update packages/kbn-pm/src/commands/clean.ts

Co-authored-by: Tyler Smalley <tylersmalley@me.com>

* chore(NA): update packages/kbn-pm/src/commands/destroy.ts

Co-authored-by: Tyler Smalley <tylersmalley@me.com>

* chore(NA): update packages/kbn-pm/src/commands/clean.ts

Co-authored-by: Tyler Smalley <tylersmalley@me.com>

* chore(NA): update packages/kbn-pm/src/commands/destroy.ts

Co-authored-by: Tyler Smalley <tylersmalley@me.com>

* chore(NA): rename destroy command into reset

* chore(NA): update packages/kbn-pm/src/commands/clean.ts

Co-authored-by: Tyler Smalley <tylersmalley@me.com>

* chore(NA): restore old behaviour on kbn clean

* chore(NA): update reset command to delete bazel caches on disk

* chore(NA): update packages/kbn-pm/src/commands/clean.ts

Co-authored-by: Tyler Smalley <tylersmalley@me.com>

* chore(NA): update prefix to match bazel defined one for cache settings

* chore(NA): update kbn pm dist file

* chore(NA): update kbn pm dist

* chore(NA): update gitignore

* chore(NA): add new ignore files after changed bazel aggregated folder

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Tyler Smalley <tylersmalley@me.com>
2021-02-03 22:02:34 +00:00
Wylie Conlon ac39321fc5
Tinymath is now a Kibana package (#89383)
* Tinymath is now a Kibana package

* Rename to @kbn/tinymath

* Update import style

* Update README

* Use commonjs import syntax

* Fix to commonjs export

* More commonjs fixes
2021-01-28 13:58:37 -05:00
Tiago Costa ecf7dd4628
chore(NA): add ignore and rc files for bazel (#89524)
* chore(NA): add bazel related ignore rules

* chore(NA): add bazelrc files setup

* chore(NA): reword on bazelrc comment

* chore(NA): update .eslintignore

Co-authored-by: Tyler Smalley <tylersmalley@me.com>

* chore(NA): rename .bazelrc into .bazelrc-ci

* chore(NA): update .gitignore

Co-authored-by: Tyler Smalley <tylersmalley@me.com>

Co-authored-by: Tyler Smalley <tylersmalley@me.com>
2021-01-28 14:26:01 +00:00
Tyler Smalley a34cd20498
[@kbn/ui-framework] Removes all but dist files (#85347)
This package has long since been deprecated and no longer maintained.
The only reason it still exists is that not all plugins have migrated
away from using the kui classes to EUI. This removes all src and build
files as a step forward.

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2020-12-10 08:23:33 -08:00
Alison Goryachev f8edc51ece
Implement error reporting in monaco for painless language (#84695) 2020-12-08 10:07:07 -05:00
Tiago Costa 0eeaafa722
chore(NA): move into single pkg json (#80015)
* chore(NA): update gitignore to include first changes from moving into a single package.json

* chore(NA): update gitignore

* chore(NA): move all the dependencies into the single package.json and apply changes to bootstrap

* chore(NA): fix types problems after the single package json

* chore(NA): include code to find the dependencies used across the code

* chore(NA): introduce pure lockfile for install dependencies on build

* chore(NA): update clean task to not delete anything from xpack node_modules

* chore(NA): update gitignore to remove development temporary rules

* chore(NA): update notice file

* chore(NA): update jest snapshots

* chore(NA): fix whitelisted licenses to include a new specify form of an already included one

* chore(NA): remove check lockfile symlinks from child projects

* chore(NA): fix eslint and add missing declared deps on single pkg json

* chore(NA): correctly update notice

* chore(NA): fix failing jest test for storyshots.test.tsx

* chore(NA): fix cypress multi reporter path

* chore(NA): fix Project tests check

* chore(NA): fix problem with logic to detect used dependes on oss build

* chore(NA): include correct x-pack plugins dep discovery

* chore(NA): discover entries under dynamic requires on vis_type_timelion

* chore(NA): remove canvas

* test(NA): fix jest unit tests

* chore(NA): remove double react declaration from storyshot test file

* chore(NA): try removing isOSS check

* chore(NA): support for plugin development

* chore(NA): update logic to fix unit tests and typechecking

* chore(NA): support to run npm scripts in child kbn projects across all envs

* chore(NA): support github checks reporter on x-pack and remove cpy types as the package correctly provides them

* chore(NA): update cpy version

* chore(NA): include last kbn pm changes

* chore(NA): update style on build_production_projects.ts

* chore(NA): remove any cast fom telemetry opt in stats

* chore(NA): remove del and re-use rm -rf again

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-11-02 21:18:52 +00:00
Uladzislau Lasitsa ba8e9a52b6
Timelion y-axis label not displayed (#80007)
* Moved flot in ui-shared-deps and leavt only one version.

* Removed unneeded import

* use commonJS so we can execute code between loading specific modules

* prefix i18n keys with flot.

* Fix Internationalization

* remove duplicate pie plugin

Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-10-14 16:58:35 +03:00
Tiago Costa 0068c87d6f
chore(NA): add elastic prefix to eslint-config-kibana (#76059)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-08-31 20:13:06 +01:00
Spencer 7b23e7cd8b
[kbn/plugin-generator] remove sao, modernize (#75465)
Co-authored-by: spalger <spalger@users.noreply.github.com>
2020-08-20 18:50:36 -07:00
Spencer 4c810be335
Remove legacy optimizer (#73154)
Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-08-13 09:08:44 -07:00
Clint Andrew Hall bfbb8d2138
[pre-req] Move .storybook to storybook; standardize files (#72384) 2020-07-20 22:18:20 -04:00
Uladzislau Lasitsa d8823d8996
Migrate timelion to the NP. (#69160)
* Migrate timelion to the NP.

* fixed ci

* Fixed paths

* fixed UI settings

* Fixed ci

* fix CI

* Fixed some comments

* Fixed browser tests

* fixed state

* Fixed comments

* Fixed save expression

* Fixed navigation

* fix CI

* Fixed some problem

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Alexey Antonov <alexwizp@gmail.com>
2020-07-14 18:41:12 +03:00
Tyler Smalley afe785b43a
[build] Creates Linux aarch64 archive (#69165)
- Updates Linux Chromium builds to accept architecture argument (defaults to x64) for arm64 support.
  - Example: `python ~/chromium/build_chromium/build.py 312d84c8ce62810976feda0d3457108a6dfff9e6 arm64`
- Updates all Chromium builds to include architecture in filename. 
  - `chromium-312d84c-linux_arm64.zip` _(new)_
  - `chromium-312d84c-linux.zip` > `chromium-312d84c-linux_x64.zip`
- Moves Chromium install from data directory to `x-pack/plugins/reporting/chromium`
- Moves Chromium download cache from `x-pack/plugins/reporting/.chromium` to `.chromium`
- Installs Chromium during build (closes #53664)
- Updates build to be architecture aware (x64 and aarch64)
- Removed Chromium debug logs, they were not helpful and can not be written inside the Kibana root. If we were to keep them, we would need to write to `logging.dist`.

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2020-07-09 19:42:48 -07:00
Joel Griffith 83da3a8b4d
Add reporting assets to the eslint ignore file (#69968) 2020-06-25 14:48:31 -07:00
Søren Louv-Jansen fbb5f31698
[APM] Don’t run eslint on cypress snapshots (#67451)
* [APM] Don’t run eslint on cypress snapshots

* ignore cypress videos

* Fix interactive command

* Fix gitignore

* Use echo everywhere

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-05-29 20:00:33 +02:00
Thomas Watson 2279b3dc0b
Add /config/apm.dev.js to .eslintignore (#67442) 2020-05-28 09:46:18 +02:00
Corey Robertson b8bea5b8b2
[Canvas] move files from legacy/plugins to plugins (#65283)
* Moves the files

* Rename legacy/plugins/canvas paths

* Correct paths

* Fix shareable_runtime and storybook

* ESLint Fixes

* Fix jest test and paths
2020-05-05 20:52:56 -04:00
Søren Louv-Jansen e02350cdc7
[APM] Update path to APM app after move to NP (#65034) 2020-05-05 18:22:47 +02:00
igoristic 59315bc84d
[Monitoring] NP Migration complete client cutover (#62908)
* Final phase before the complete cutover

* NP migration

* lint fix

* More NP stuff

* Moved Stack Monitoring client plugin outside legacy and fixed all tests

* ...

* Removed unused files

* Fix for main links

* Fixed more tests

* Fixed redirect when clicking on SM icon again

* Code review feedback

* Addressed code review feedback

* Fixed return value
2020-04-30 15:59:35 -04:00
Tyler Smalley beb07c28fc
Cleanup .eslingignore and add target (#64617)
* Cleanup .eslingignore and add target

Since adding the new platform plugins target directories, we need to
update the eslintignore to reflect that.

Did a bit of organizing of the file for some sanity.

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2020-04-28 20:01:16 -07:00
Daniil Suleiman da89856503
[NP] Move visTypeVislib into NP (#63963) 2020-04-28 14:44:17 +02:00
Joe Reuter 4e56419ca4
Migrate timelion vis (#62819) 2020-04-17 10:42:27 +02:00
Manuel de la Peña d27b6c05d3
Migrate existing Cypress tests to Cypress + Cucumber (#57299)
* chore: move gitignore to the cypress directory

* chore: ignore more test files

* fix: do not check the Loading Message

It seems not relevant to the main purpose of these tests

* chore: use cypres + webpack + cucumber scaffolding

See https://github.com/TheBrainFamily/cypress-cucumber-webpack-typescript-example

* chore: add eslint and prettier for code linting

* feat: convert existing Cypress test into BDD style

* feat: add support for using proper Node version in MacOSX

* chore: use tslint

* chore: use old layout

We are keeping cypress as rootDir to follow project's structure. On the other hand,
having a second cypress directory at the 2nd level is the default structure, as shown
in the examples:
- https://github.com/TheBrainFamily/cypress-cucumber-webpack-typescript-example
- a240054d7f/examples/preprocessors__typescript-webpack

* chore: remove prelint script meanwhile we fix TS lint

* chore: move test results to a specific directory

* chore: rename variable following old code

* chore: remove non-needed lints, as we are going to use kibana build

* chore: import snapshot function from cypress

* chore: add readFile utils back from a bad removal

* chore: change format of JSON spec file

It was automatically changed by tests

* chore: move CI directory to the proper layout in order for Jenkins to work

* chore: store test-results from proper dir on Jenkins

* chore: store artifacts properly on Jenkins

* Fix type issues

* chore: rename test application to e2e (end-to-end)

We are keeping the build system within the test application, isolating dependencies

* docs: reorganise docs for APM UI e2e tests

* fix: Use proper cypress support file

* chore: use existing NPM script for running cypress on CI

* chore: update paths in CI scripts

* docs: document how the CI runs the tests

* chore: use Node 10 for tests

* chore: Use kibana's Node version for tests

* chore: run yarn install

* docs: update docs

* fix: path was wrong

* docs: fix paths and flags used to load data

* docs: elasticsearch fix flag

* docs: Bootstrap kibana before running it

* docs: remove outdated info

* chore: move background steps to the scenario

This would avoid not reading the background when the number of scenarios grows

Co-authored-by: Dario Gieselaar <d.gieselaar@gmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-26 11:00:54 -08:00
Joe Reuter 09f1cad573
Check for legacy imports in vis types and fix problems (#56763) 2020-02-10 12:48:18 +01:00
Daniil Suleiman 6feabcd533
Generate a static parser, move tests to vis_type_timelion (#55299)
* Use generated parser, move tests to vis_type_timelion

* Remove legacy tests

* Create a grunt task for generating a parser
2020-01-21 17:38:28 +03:00
Maryia Lapata 9e07a427c7
[Vis] Move Timelion Vis to vis_type_timelion (#52069)
* Deangularize timelion vis

* Refactoring

* Fix path

* Update timelion_controller.ts

* Remove unused deps

* Create vis_type_timelion

* Create ChartComponent

* Render chart in react

* Reactify timelion editor

* Change translation ids

* Use hooks

* Add @types/pegjs into renovate.json5

* Add validation, add hover suggestions

* Style fixes

* Change plugin setup, use kibana context

* Update

* Fix ticks

* Fix plotselected listener

* Fix plothover handler

* Add TS for options

* Update TS

* Restructuring

* Change plugin start

* Remove vis from timelion plugin

* Rename class

* Mock services

* Fix other comments

* Remove duplicate files

* Convert test to jest

* Remove kibana_services from timelion

* Delete visualize_app.ts.~LOCAL

* Refactoring

* Fix TS

* Refactoring, TS

* Import eui variables

* Import styling constants

* Move react components to vis_type_timelion

* Fix TS

* Move ui imports to legacy_imports.ts

* Move chain.peg to vis_type_timelion

* Fix path

* Use KibanaContext instead kibana_services.ts

* Refactoring

* Refactoring

* Add @types/flot

* Fix issue with hovered series color

* Update renovate.json5

* Pass timelionPanels as dependencies

* Move common folder to vis_type_timelion

* Move back tick_formatters.ts

* Rename styles file

* Refactoring

* Update _index.scss

* Move to_milliseconds to common

* Revert yaxes formatting

* Refactoring

* Refactoring

* Use Panel directly

* Refactoring of to_milliseconds.ts

Co-authored-by: Daniil Suleiman <31325372+sulemanof@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-17 15:30:26 +03:00
Nick Partridge bd7d5eb9f6
Shim vis_type_vislib (#53536)
* shim of kbn_vislib_vis_types (now vis_type_vislib)
* Move vislib into vis_type_vislib plugin
* Convert remaining plugin files to typescript
* Rename vis to vis_type_vislib
2020-01-15 15:48:19 -06:00
Alexey Antonov c415311221 Move @kbn/es-query into data plugin (#51014) 2019-11-26 13:28:04 -07:00
renovate[bot] feceb0f98e Update eslint related packages (#48513)
* Update eslint related packages

* add errorMessage to no-restricted-paths validation

* add license to eslintrc file

* ignore broken plugin fixture

* upgrade tangled peer deps

* give name to unnamed func to avoid typescript-eslint/typescript-eslint#1078

* migrate away from removed prefer-interface

* migrate away from removed no-angle-bracket-type-assertions rule

* migrate away from removed no-triple-slash-reference rule

* old config was invalid and made this rule a noop

* fix array-type rule config

* fix readonly paramProperties that weren't being checked

* fix propType ordering

* remove references to non-existent rules

* remove unnecessary disable that is improperly formatted

* fix comment-related spacing

* fix typo/invalid namespace overrides

* rename fn to avoid hook-alike behavior

* remove reference to old removed rule

* use caret version for prettier

* reference babel-eslint with absolute path
2019-10-21 16:32:31 -07:00
Clint Andrew Hall c7361719c9
[easy][chore] Exclude Canvas Shareable Runtime from eslint (#48187) 2019-10-15 16:09:10 -05:00
Tyler Smalley 3caa42967d
[eslint] Ignore legacy optimize directory (#46493)
We can either remove the legacy optimize directory from gitignore, or we can add to eslintignore. We have chosen to go with the latter to prevent accidental commits of the optimize directory and aide in a smoother transition between old branches. This change was made in #25944 and only effects master/8.0, which increases the likelihood a developer runs into it.

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2019-09-24 12:28:47 -07:00
Søren Louv-Jansen a5b5b8816b
[APM] Minimal e2e setup with Cypress (#43463)
* APM E2E with own package.json

* Ignore cypress folder

* Add cypress/apm as separate ts project

* Exclude from parent tsconfig

* Add p-limit as dep

* Fix readme

* Fix prettier command

* Resolve feedback

* Move date range into `loginAndWaitForPage`

* Remove redundant file

* Fixed lint errors

* Remove uneeded `data-cy` attributes

* Fix snapshots
2019-09-23 15:50:00 +02:00
Jonathan Budzenski bad947d7d1
move optimize into data folder (#25944)
* move optimize into data folder

* path

* replace optimize with data in notice glob

* update docs

* more updates

* update snapshots

* re-add folder references

* prettier

* save changes

* rm optimize from .eslintignore

* rm extra file

* fix merge
2019-08-28 10:09:58 -05:00
Tre e62ec7c5ec
[FTR] Refactor FTR to live under KBN-TEST (#42547)
Refactor the FTR to live under KBN-TEST . 

Next, refactor any and all files that the
FTR needs to live under KBN-TEST,
as needed.
2019-08-06 15:35:16 -06:00
Court Ewing 2d171c92f5 Fix path references into and out of x-pack/legacy 2019-06-20 13:34:48 -04:00
renovate[bot] fa597135bc Pin dependencies (#37404)
* Pin dependencies

* [eslint] ignore large files that take a long time to parse

* [eslint-plugin-import] force `querystring` to be considered a core module

* [eslint-plugin-import] auto-fix import order issues
2019-05-29 20:34:52 -07:00
Matt Bargar 539bc6f3a2
Improve KQL error messages (#34900)
Attempts to make KQL syntax errors more sensical to the average user.

I initially tried to use a similar solution to the one we used for detecting usage of old lucene syntax. In other words, I tried to create rules in the grammar that would match strings containing common mistakes the user might make and throw custom error messages for each situation. This proved to be more difficult for detecting errors in the regular language. While the Lucene rules could be completely separated from the main grammar, the KQL error rules had to be mixed into the main grammar which made it much more complex and had a lot of unintended side effects.

So instead I decided to lean more heavily on PEG's built in error reporting. Giving certain rules human readable names allows the parser to use those names in the error reporting instead of auto generating a long list of possible characters that might be expected based on the matching rules. Since the PEG errors contain location information I was also able to add ascii art that points the user to exactly where the error occurred in their query string. While this approach is not quite as nice as bespoke error messages that tell the user exactly what is wrong in plain English, it's much more maintainable and I think it still results in much better error messages compared to what we have today.

I've also removed the old original kuery grammar (for queries like is(response, 200)). We were only using it to display an error if I user was still using the old syntax. This version of kuery hasn't existed since 6.3 and we've had error messages telling users this since then. I think it's safe to remove the legacy parser at this point, which greatly reduces the complexity of our error reporting.
2019-04-24 16:40:38 -04:00