Commit graph

219 commits

Author SHA1 Message Date
Spencer 07f4e5ad77
[6.x] [typescript] add typescript support for the server and browser (#19104) (#19223)
Backports the following commits to 6.x:
 - [typescript] add typescript support for the server and browser  (#19104)
2018-05-21 10:42:59 -07:00
archana 05640a3258 Revert "Option to run kibana from build for CI" (#19224)
* Revert "[DOCS] Removes redundant index.asciidoc files (#19192)"

This reverts commit d11b5aae9a.

* Revert "[typescript] add typescript support for the server and browser (#19104)"

This reverts commit c6112067fc.

* Revert "Option to run kibana from build for CI (#19125)"

This reverts commit 5969860303.
2018-05-18 14:10:47 -05:00
archana 2a2ccd1eba Option to run kibana from build for CI (#19125) 2018-05-18 12:46:34 -05:00
Aleh Zasypkin 4f75ab2673
[6.x] [kbn-pm] Max concurrency per batch (#19024) 2018-05-18 10:15:19 +02:00
archana eae18989a3
Functional test setup with kbn-test package (#18568) (#19174)
Restructure testing with kbn-test package

 - Run with multiple configs, move cli options to config
 - Package-ify kbn-test
 - Eventually we'll have functional_test_runner live in a package
of its own, and then this kbn-test will use that as a dependency,
probably still as a devDependency.
 - Implement functional_tests_server
 - Collapse single and multiple config apis into one command

Use kbn-es

Replace es_test_cluster + es_test_config with kbn/test utils

Implement new createEsTestCluster

Improve scripts, jsdocs, cli top-level tools

Lift error handling to the top level
2018-05-17 13:42:43 -05:00
spalger 34d8276f82 [eslint/import-resolver] ensure compat with slightly older versions of node for IDE support
(cherry picked from commit 0ad665f216)
2018-05-17 08:06:52 -07:00
Spencer 23f159d04d
[eslint] unify resolver configs (#19102) (#19141)
* [eslint] unify resolver configs

Our eslint resolver settings currently rely on the fact that we define
our resolver with a string globally, and an object in the overrides.
This causes the override value to completely override/replace the global
setting, which is desired, but when the global setting is converted to
an object they are merged, causing both resolvers to run.

This is a problem because some dependencies in the UI side of things
will resolve with the node resolver, but will resolve incorrectly
because they are intended to use some webpack specific override.

While trying to add TypeScript I needed to pass argument to the node
resolver which uncovered this issue. The change here moves us away from
using the node resolver directly and instead uses the kibana resolver
with `forceNode: true` set when linting server code and `forceNode:
false` when resolving imports that will be handled by webpack.

* [import-resolver] use object spread operator
2018-05-16 16:26:30 -07:00
Spencer 7dbec2e1e7
[6.x] [mocha] remove grunt-simple-mocha (#19079) (#19139)
* [mocha] run tests with mocha script, remove grunt-simple-mocha

* [ci] force colored output

* [ci] disable color when reading the yarn bin

* [dev/build/exec] support tooling log having its own chalk

* [dev/mocha] avoid changing the cwd of the process

* [dev/mocha] only match files, speed up negative matches

* [cli/serve/test] strip ansi control characters from logs

* [ci] disable color in all `yarn bin` invocations

* [dev/mocha] cleanup old runInBand check

* [dev/mocha] enable gloabl leak checks
2018-05-16 16:25:59 -07:00
spalger 7df7ab92d6 Revert "Functional test setup with kbn-test package (#18568)"
This reverts commit c2265e3931.
2018-05-15 13:16:36 -07:00
Aleh Zasypkin 05e4db527d Rename @kbn/babel-preset/common & node & webpack to @kbn/babel-preset/common_preset & node_preset & webpack_preset. (#19025) 2018-05-15 12:35:17 -05:00
archana c2265e3931 Functional test setup with kbn-test package (#18568)
Restructure testing with kbn-test package

 - Run with multiple configs, move cli options to config
 - Package-ify kbn-test
 - Eventually we'll have functional_test_runner live in a package
of its own, and then this kbn-test will use that as a dependency,
probably still as a devDependency.
 - Implement functional_tests_server
 - Collapse single and multiple config apis into one command

Use kbn-es

Replace es_test_cluster + es_test_config with kbn/test utils

Implement new createEsTestCluster

Improve scripts, jsdocs, cli top-level tools

Lift error handling to the top level
2018-05-15 12:33:01 -05:00
Tim Roes e5ea9dd2a6
Update React to 16.3 (#18768) (#19033)
* Update React to 16.3

* Switch off specific eslint rules

* Update enzyme snapshots

* Incorporate PR feedback
2018-05-14 15:15:18 +02:00
Tyler Smalley bc388bfc52 [kbn-es] Updates location of ES OSS snapshot (#18938)
ES snapshots are located again within the base elasticsearch directory and NOT within an additionally nested elasticsearch-oss directory

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2018-05-09 09:29:34 -07:00
Spencer 8db03827c7
[6.x] Fix procRunner/x-pack ftr scripts (#18789) (#18887)
* [x-pack/ftr] call fatalErrorHandler when functional tests fail

* [kbn/dev-tools/withProcRunner] require a log as the first arg

* [kbn/dev-tools/procRunner] use correct promise, convert to getter

* [x-pack/ftr] avoid race condition that prevents success message logging

When starting the kibana server it is possible for log messages to come
after the server is started, so we added a pause that waits for 5
seconds of logging silence before logging the success message. The
observable used fails to complete though if a log message is never
written AFTER the Kibana server starts. To counter this the observable
is started with `null` so it will always start at least one 5 second
timer and always complete even if there is no log data after Kibana
server starts.

* fix typo
2018-05-08 09:55:59 -07:00
Spencer a6c0c62121 [uiExports] migrate uiApp "uses" to explicit imports in apps (#17828)
* [uiExports] migrate uiApp "uses" to explicit imports in apps

* [uiApp] update tests for getModules() method

* [optimize/uiExports] improve naming and comments

* [uiExports] sort imports so they load in the same order as before

* [testHarness] load hacks when testing in the browser

* [x-pack/uiExports] use new uiExports modules

* [testHarness] describe why we import uiExports/hacks

* [optimize] remove needless [].concat()

* [optimize/createUiExportsModule] string.includes > string.indexOf

* [uiExports/createUiExportsModule] remove needless capture of module exports

(cherry picked from commit e1a2fcbd96)
2018-05-03 12:19:12 -07:00
Larry Gregory 56fe6cbb33
Disallow use of "dangerouslySetInnerHTML" on React components (#17759) (#18565)
Disallows use of "dangerouslySetInnerHTML" on React components, except where explicitly whitelisted
2018-04-25 11:58:48 -04:00
Tyler Smalley a8ee0775c7 [kbn-es] Fixes ES snapshot path for OSS builds (#17860)
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2018-04-24 15:45:40 -07:00
Jenkins CI bc5b51554d Migrate x-pack-kibana source to kibana 2018-04-24 13:49:26 -07:00
Kim Joar Bekkelund 62d96637d6
Upgrade to Prettier 1.12.1 (#17791) (#17817)
* Upgrade to Prettier 1.12.1

* Add back dev dep
2018-04-20 13:15:57 +02:00
Spencer 6a7c04737f
[kbn-es] add basic integration tests for exit code/promise handling (#17600) (#17783) 2018-04-19 13:37:01 -07:00
Lukas Olson f6f5e691f0 Fix date math parser to not use hardcoded length (#17751)
* Fix date math parser to not use hardcoded length

* Add test
2018-04-18 14:09:51 -07:00
Kim Joar Bekkelund c41b9dd73b
Introduce @kbn/system-loader (#17595) (#17782)
* Introduce @kbn/plugin-system

* Throw if plugin exposes a promise from 'start'

* TS updates

* rename

* Better error if missing plugin

* Api to add multiple specs at the same time

* isPromise prettier-ified

* Rename 'plugin' to 'system'

* Metadata + some cleanups

* Make it possible to type system metadata

* Throw if stop is async

* Add tests for System class
2018-04-18 22:53:41 +02:00
Spencer 7621b410f9
[6.x] Move to Yarn 1.6.0 (#17741) (#17749) 2018-04-17 10:35:22 -07:00
Tim Roes 8df8b16e93
Move ng_mock wrapper to test_utils (#17712) (#17733) 2018-04-17 09:17:53 +02:00
Spencer 3096c36117
[eslint-import-resolver] support mapping plugins to directories (#17667) (#17690)
* [eslint-import-resolver] support mapping plugins to directories

* use shorthand syntax
2018-04-12 16:21:51 -07:00
Aleh Zasypkin 2fe8a8c099
[kbn/pm] Get rid of --skip-kibana in favour of --exclude kibana. (#17686) 2018-04-12 21:57:03 +02:00
Aleh Zasypkin 4e3bde555d
[6.x][kbn/pm] Allow to include/exclude projects in kbn watch. (#17680) 2018-04-12 18:41:36 +02:00
Spencer 9635145a5f [eslint-import-resolver] Add installation docs
(cherry picked from commit 22d70fcb22)
2018-04-11 16:13:31 -07:00
Spencer ede4502fa4
[6.x] [eslint-import-resolver-kibana] bring in repo as package (#17665) (#17666)
* [eslint-import-resolver-kibana] bring in repo as package

* [eslint-import-resolver] enable prettier
2018-04-11 16:12:50 -07:00
Spencer 3bf90dc9f1
[6.x] [plugin-helpers] fix order of arguments passed to commander actions (#17663) (#17664) 2018-04-11 13:20:03 -07:00
Spencer 967a3a69be
[plugin-helpers] report task failures to CLI with exitCode 1 (#17647) (#17649)
* [plugin-helpers] return promises/fail cli when async tasks fail

* [plugin-helpers] rename taskRunner to commanderAction

* [plugin-helpers] await async assertion
2018-04-10 17:45:09 -07:00
Shaunak Kashyap bf7a0d2e82 Removing old files that are no longer used (#17640) 2018-04-10 10:45:23 -07:00
Kim Joar Bekkelund ed63f6d5a0
Use Jest on cli tests (#16389) (#17635)
* Move CLI tests to Jest

* Get rid of logs from the output

* Allow skipped tests

* Move integration tests into integration_tests folder
2018-04-10 18:55:39 +02:00
Kim Joar Bekkelund 789ad24c84
Upgrade to TypeScript 2.8.1 (#17617) (#17634) 2018-04-10 12:56:30 +02:00
Spencer b9350316dd
[6.x] [@kbn/es] fix promise and CLI error handling (#17596) (#17598)
* [kbn-es/cluster] fix promise handling to properly route success/failure

* [kbn-es/cli] catch errors that bubble to the CLI and log with a bit of style

* [kbn-es] fix promise handling when building from source

* [kbn-es] check for inverse of .stop() condition

* [kbn-es/cluster] resolve promise is cluster stops cleanly

* [kbn-es/cluster/start] reject if ES exits before starting
2018-04-06 13:20:32 -07:00
Tim Roes 36273e8169
Fix styling of disabled kuiCheckboxes (#17522) (#17540)
* Fix styling of disabled kuiCheckboxes

* Fix typo in SASS variable
2018-04-04 16:38:43 +02:00
spalger 4c24c02d13 [yarn] update lockfile 2018-03-28 16:56:06 -07:00
Tyler Smalley 0b787c5d57 [kbn-es] Wait for close event (#17448)
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2018-03-28 14:23:40 -07:00
Spencer b36e7aff43
More attempts to fix procRunner hangs in CI (#17325) (#17443)
* [kbn-dev-utils/procRunner] try using execa to avoid never-exitting procs

* [kbn-dev-utils/procRunner] don't listen for close event, rely on stdio streams ending
2018-03-28 13:36:49 -07:00
Aleh Zasypkin d8b500ef86
[kbn-pm] Implement kbn watch. (#17391) 2018-03-26 19:17:50 +02:00
Tyler Smalley 0ece786976 [kbn-es] Allows error to bubble up (#17358)
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2018-03-23 07:29:11 -07:00
Matt Bargar 4f2fbe7fb6
[6.x] Add query enhancements opt-in switch to query bar (#17232) (#17353)
* Add query enhancements opt-in switch to query bar (#17232)

Makes our language updates more visible to users and removes mentions of Kuery as a separate language. Users still get the old lucene experience by default, but have the option to opt-in to "experimental query features" directly in the query bar. Goal is to get more feedback by making these new features more prominent and less of a jump from lucene.

* fix test
2018-03-22 18:00:25 -04:00
Lukas Olson b665a30c26 Kibana query language autocomplete (#15945)
* First stab at refactoring typeahead

* Don't double submit on enter

* Add item templating

* Introduce simple kuery language

* Rename to kql and add modules

* Update KQL syntax

* Automatically insert matching pairs

* Don't match quotes after alphanumeric chars

* Get field and value suggestions

* Remove accidental changes

* Remove unnecessary test

* Don't submit on enter

* Fix typeahead

* Suggest matching recent searches

* Suggest operators

* Suggest conjunctions

* Use template, separate suggestions into separate modules

* Whoops, add this module back

* Add clarifying comment

* Fix history log key

* Don't update suggestions on every key press

* Fix key handling

* Update terminology to be clearer

* Fix typo

* Simplify building of nodes

* Don't always hide on submit

* Check items exists

* Add icon directive which wraps EuiIcon.

* kql design start

* remove comment bits

* Simplify select next/prev and reset selected on hide/backspace

* Add test

* Put persistedLog on scope so it can be tested

* Fix typos

* Build up AST for sublist by returning functions that take a field name

* Remove single quoted strings and add double quote to special characters

* Build nodes with arg nodes instead of args themselves

* Add support for exact phrase search for quoted values

* Update typeahead items when language changes

* Finish that work I didn't do in the last commit

* This commit makes Bargs very happy cuz it does a lot

* Add wildcard field support to range query

* Remove range support for wildcard values

* Remove KQL as a separate language

Updates kuery to use KQL's grammar. This will lead to a smoother
transition for both us and Kuery users. We mainly added KQL as a
separate language so that we could notify Kuery users that the syntax
had changed. I realized we could do the same by trying to parse their
query strings with the old grammar if the new grammar fails, and if the
old grammar parses successfully we can display an error message with a
link to the docs describing the syntax changes. Since Kuery now uses the
more simple KQL syntax, I've also re-enabled the filter bar when Kuery
is selected.

* Fix typeahead behavior

* Update conjunctions

* Use scope apply

* Suggest conjunctions after ranges

* Support strings in wildcard node constructor and add tests for wildcard node

* test updates

* Removing unused serializeStyle and toKueryExpression, updating tests

* Fix functional test

* Fix typo

* Show fields that match in any part of the name

* Alter order of operators

* Preserve focus after selecting by click

* Ports tests for `fromKueryExpression` to `fromKqlExpression`

* More KQL syntax tests

* Suggest conjunctions after ranges

* Fix suggestions inside parens

* fromLiteralExpression tests

* remove serializeStyle arguments which no longer exist in the function definition

* tests for getFields

* Case insensitive search for field names

* update tests for is.js

* add wildcard fieldname test for range.js

* Fix removed div

* Fix line spacing for autocomplete suggestions

* Fix conjunction suggestions with escaped preceding literals

* Escape special characters in fields and values

* Don't suggest the value that's already selected

* Update icons

* Sort prefix first

* Simplify cursor detection and suggest booleans

* Use quotes for suggested values

* get rid of references to KQL

* Don't show errors from parsing

* That didn't even exist

* Use config to determine if values are suggested

* Update suggestions on home/end

* remove hack

* Update reference to kql

* Suggestions for quoted values

* Clean up grammar

* Better support for cursor inside spaces

* Create grunt task to generate parsers from peg files

* Simplify wildcard handling

* Don't filter out the exact fields/values

* Update parsing modules

* Fix peg task

* Make operator syntax more visible

* Update OR verbiage

* Simplify and improve match pairs

* Revert "Simplify wildcard handling"

This reverts commit 915861beab.

* Support escaped backslashes inside quoted strings

* Support escaped keywords

* Remove lodash dependency cuz w33ble

* Escape user input and fix conjunction description

* Clear suggestions after submitting

* Fix insertion of suggestion to account for selection

* Remove unnecessary?

* Remove extraneous file

* Better name for method

* Move functions out of event handler

* Don't wrap result in promise

* Don't show kuery suggestions for lucene

* some cleanup and polish for kql autocomplete

* Omit description completely for values

* Don't suggest and/or for quoted strings that end in spaces

* Submit recent search suggestions on select

* Scroll selected suggestion into view

* Better handling of key events and hiding typeahead

* Update suggestions to work in other apps with multiple index patterns

* Only update suggestions if not submitting

* Hide suggestions on focus

* Simplify wildcard (again)

* Fix console error

* Remove references to kql

* Fix match pairs so that suggestions occur with cursor in correct place

* Memoize value suggestions

* Debounce model updates

* Add tests for suggestion providers

* Add setting and docs

* Add custom error, helper for detecting leading wildcards, and check for
leading wildcards in the Value rule of the grammar.

* Better handling of suggestion clicks

* Dedup suggestions

* Sort keywords first

* Fix value suggestions memoizing

* Check if query exists

* Reduce size of dialog and fix ranges

* Create grunt task to generate parsers from peg files

* Lazy load typeahead items

* Fix wildcard tests

* Fix value suggestion tests

* Fix typeahead tests

* Fix value suggestion memoize resolver

* Leave comment

* Add a ttl for the value suggestion resolver

* Move grunt config to config/

* Bargs can suck it

* Fix more tests that bargs broke (and one I did too)

* Fix tests
2018-03-22 08:52:30 -07:00
Spencer ccdf59e319
[6.x] [kbn-es] download to destPath.tmp rather than /tmp (#17322) (#17323)
When kbn-es downloads a snapshot, it writes the in progress download to
`/tmp` rather than the destination path in case the download fails part
way through, then renames the file from `/tmp` to the final location.
This is a good practice, but in CI the `/tmp` directory isn't stored on
the same disk as the project, which causes a rename error to occur
because we're attempting to rename across devices.

This updates the download logic to write to `${destPath}.tmp` instead,
and do the same renaming, so that we can avoid cross-device errors.
2018-03-21 17:49:52 -07:00
Tyler Smalley ffd2fe83e3
[kbn-es] Package for managing Elasticsearch during dev and testing (#17168) (#17273)
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2018-03-21 17:48:49 -07:00
Spencer 3820258699
[dev-utils/procRunner] wrap stop and close promises in timeouts (#17320) (#17321)
In an attempt to debug random stalls we are seeing in CI, the proc runner will now send SIGKILL if a process does not exit after receiving the standard exit signal it receives (usually SIGTERM). Additionally, if the child process object never emits "close" or "exit" another timeout will trigger an error
2018-03-21 17:08:52 -07:00
Kim Joar Bekkelund a76d1b6e89
[plugin helpers] Using --pure-lockfile instead of --frozen-lockfile (#17275) (#17277) 2018-03-20 20:37:16 +01:00
Bill McConaghy f5ba3025bd
moving plugin template to React and EUI (#16937) (#17253)
* moving plugin template to React and EUI

* fixing method reference error

* adding whitespace and comments per PR feedback

* adjusting test

* fixing test

* reducing Angular dependency and fixing issue with hack not loading properly

* fixing tests

* reacting to PR feedback
2018-03-20 08:44:05 -04:00
archana f7eed88df5 Update packages/README.md (#17167)
* Update packages/README.md

* Update packages/README.md

* Split

* Update README.md
2018-03-15 02:32:32 -05:00
archana ee45b74858 Correct casing in kbn-dev-utils (#17166)
* Remove kbn-dev-utils

* Restore kbn-dev-utils with proper casing
2018-03-15 02:00:05 -05:00