Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/6.x' into 6.x
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasolson committed Jan 12, 2018
2 parents aaa5f56 + c2a611b commit 9578180
Show file tree
Hide file tree
Showing 242 changed files with 156,853 additions and 1,018 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
/src/ui/public/utils/decode_geo_hash.js
/src/core_plugins/timelion/public/webpackShims/jquery.flot.*
/ui_framework/doc_site/build
/tasks/vendor
4 changes: 2 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ attention.
- Have you signed the [contributor license agreement](https://www.elastic.co/contributor-agreement)?
- Have you followed the [contributor guidelines](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md)?
- If submitting code, have you included unit tests that cover the changes?
- If submitting code, have you tested and built your code locally prior to submission with `npm test && npm run build`?
- If submitting code, have you tested and built your code locally prior to submission with `yarn test && yarn build`?
- If submitting code, is your pull request against master? Unless there is a good reason otherwise, we prefer pull requests against master and will backport as needed.
-->
-->
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ selenium
*.out
ui_framework/doc_site/build
!ui_framework/doc_site/build/index.html
yarn.lock
package-lock.json
.yo-rc.json
/.vscode
Expand Down
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

44 changes: 23 additions & 21 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,16 +158,18 @@ Install the version of node.js listed in the `.node-version` file _(this can be
nvm install "$(cat .node-version)"
```

Install `npm` dependencies
Install the latest version of [yarn](https://yarnpkg.com).

Install dependencies

```bash
npm install
yarn
```

Start elasticsearch.

```bash
npm run elasticsearch
yarn elasticsearch
```

> You'll need to have a `java` binary in `PATH` or set `JAVA_HOME`.
Expand All @@ -182,12 +184,12 @@ node scripts/makelogs
Start the development server.
```bash
npm start
yarn start
```

> On Windows, you'll need you use Git Bash, Cygwin, or a similar shell that exposes the `sh` command. And to successfully build you'll need Cygwin optional packages zip, tar, and shasum.
Now you can point your web browser to https://localhost:5601 and start using Kibana! When running `npm start`, Kibana will also log that it is listening on port 5603 due to the base path proxy, but you should still access Kibana on port 5601.
Now you can point your web browser to https://localhost:5601 and start using Kibana! When running `yarn start`, Kibana will also log that it is listening on port 5603 due to the base path proxy, but you should still access Kibana on port 5601.

#### Customizing `config/kibana.dev.yml`

Expand All @@ -203,7 +205,7 @@ In development mode, Kibana runs a customized version of [Webpack](http://webpac

#### Setting Up SSL

Kibana includes a self-signed certificate that can be used for development purposes: `npm start -- --ssl`.
Kibana includes a self-signed certificate that can be used for development purposes: `yarn start --ssl`.

### Linting

Expand All @@ -230,23 +232,23 @@ Before running the tests you will need to install the projects dependencies as d
Once that's done, just run:

```bash
npm run test && npm run build -- --skip-os-packages
yarn test && yarn build --skip-os-packages
```

### Debugging Unit Tests

The standard `npm run test` task runs several sub tasks and can take several minutes to complete, making debugging failures pretty painful. In order to ease the pain specialized tasks provide alternate methods for running the tests.
The standard `yarn test` task runs several sub tasks and can take several minutes to complete, making debugging failures pretty painful. In order to ease the pain specialized tasks provide alternate methods for running the tests.

To execute both server and browser tests, but skip linting, use `npm run test:quick`.
To execute both server and browser tests, but skip linting, use `yarn test:quick`.

```bash
npm run test:quick
yarn test:quick
```

Use `npm run test:server` when you want to run only the server tests.
Use `yarn test:server` when you want to run only the server tests.

```bash
npm run test:server
yarn test:server
```

When you'd like to execute individual server-side test files, you can use the command below. Note that this command takes care of configuring Mocha with Babel compilation for you, and you'll be better off avoiding a globally installed `mocha` package. This command is great for development and for quickly identifying bugs.
Expand All @@ -261,16 +263,16 @@ You could also add the `--debug` option so that `node` is run using the `--debug
node scripts/mocha --debug <file>
```

With `npm run test:browser`, you can run only the browser tests. Coverage reports are available for browser tests by running `npm run test:coverage`. You can find the results under the `coverage/` directory that will be created upon completion.
With `yarn test:browser`, you can run only the browser tests. Coverage reports are available for browser tests by running `yarn test:coverage`. You can find the results under the `coverage/` directory that will be created upon completion.

```bash
npm run test:browser
yarn test:browser
```

Using `npm run test:dev` initializes an environment for debugging the browser tests. Includes an dedicated instance of the kibana server for building the test bundle, and a karma server. When running this task the build is optimized for the first time and then a karma-owned instance of the browser is opened. Click the "debug" button to open a new tab that executes the unit tests.
Using `yarn test:dev` initializes an environment for debugging the browser tests. Includes an dedicated instance of the kibana server for building the test bundle, and a karma server. When running this task the build is optimized for the first time and then a karma-owned instance of the browser is opened. Click the "debug" button to open a new tab that executes the unit tests.

```bash
npm run test:dev
yarn test:dev
```

In the screenshot below, you'll notice the URL is `localhost:9876/debug.html`. You can append a `grep` query parameter to this URL and set it to a string value which will be used to exclude tests which don't match. For example, if you changed the URL to `localhost:9876/debug.html?query=my test` and then refreshed the browser, you'd only see tests run which contain "my test" in the test description.
Expand All @@ -285,8 +287,8 @@ This should work super if you're using the [Kibana plugin generator](https://git
To run the tests for just your particular plugin run the following command from your plugin:

```bash
npm run test:server
npm run test:browser -- --dev # remove the --dev flag to run them once and close
yarn test:server
yarn test:browser --dev # remove the --dev flag to run them once and close
```

### Cross-browser Compatibility
Expand All @@ -300,7 +302,7 @@ npm run test:browser -- --dev # remove the --dev flag to run them once and close
* Open VMWare and go to Window > Virtual Machine Library. Unzip the virtual machine and drag the .vmx file into your Virtual Machine Library.
* Right-click on the virtual machine you just added to your library and select "Snapshots...", and then click the "Take" button in the modal that opens. You can roll back to this snapshot when the VM expires in 90 days.
* In System Preferences > Sharing, change your computer name to be something simple, e.g. "computer".
* Run Kibana with `npm start -- --host=computer.local` (substituting your computer name).
* Run Kibana with `yarn start --host=computer.local` (substituting your computer name).
* Now you can run your VM, open the browser, and navigate to `http://computer.local:5601` to test Kibana.

#### Running Browser Automation Tests
Expand All @@ -316,13 +318,13 @@ Packages are built using fpm, pleaserun, dpkg, and rpm. fpm and pleaserun can b
apt-get install ruby-dev rpm
gem install fpm -v 1.5.0
gem install pleaserun -v 0.0.24
npm run build -- --skip-archives
yarn build --skip-archives
```

To specify a package to build you can add `rpm` or `deb` as an argument.

```bash
npm run build -- --rpm
yarn build --rpm
```

Distributable packages can be found in `target/` after the build completes.
Expand Down
6 changes: 3 additions & 3 deletions docs/development/core/development-basepath.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ To accomplish this the `serve` task does a few things:

This proxy can sometimes have unintended side effects in development, so when
needed you can opt out by passing the `--no-base-path` flag to the `serve` task
or `npm start`.
or `yarn start`.

["source","shell"]
-----------
npm start -- --no-base-path
-----------
yarn start --no-base-path
-----------
10 changes: 5 additions & 5 deletions docs/development/core/development-dependencies.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ Before you can use an external library with Kibana you have to install it. You
do that using...

[float]
==== npm (preferred method)
==== yarn (preferred method)

Once you've http://npmsearch.com[found] a dependency you want to add, you can
install it like so:

["source","shell"]
-----------
npm install --save some-neat-library
yarn add some-neat-library
-----------

At the top of a javascript file, just import the library using it's name:
Expand All @@ -28,13 +28,13 @@ import someNeatLibrary from 'some-neat-library';
-----------

Just like working in node.js, front-end code can require node modules installed
by npm without any additional configuration.
by yarn without any additional configuration.

[float]
==== webpackShims

When a library you want to use does use es6 or common.js modules but is not
available on npm, you can copy the source of the library into a webpackShim.
available with yarn, you can copy the source of the library into a webpackShim.

["source","shell"]
-----------
Expand Down Expand Up @@ -97,7 +97,7 @@ module.exports = window.angular;
What this shim does is fairly simple if you go line by line:

. makes sure that jQuery is loaded before angular (which actually runs the shim above)
. load the angular.js file from the npm installation
. load the angular.js file from the node_modules directory
. load the angular-elastic plugin, a plugin we want to always be included whenever we import angular
. use the `ui/modules` module to add the module exported by angular-elastic as a dependency to the `kibana` angular module
. finally, export the window.angular variable. This means that writing `import angular from 'angular';` will properly set the angular variable to the angular library, rather than undefined which is the default behavior.
8 changes: 4 additions & 4 deletions docs/development/core/development-functional-tests.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@ There are three ways to run the tests depending on your goals:

1. Easiest option:
** Description: Starts up Kibana & Elasticsearch servers, followed by running tests. This is much slower when running the tests multiple times because slow startup time for the servers. Recommended for single-runs.
** `npm run test:ui`
** `yarn test:ui`
*** does everything in a single command, including running Elasticsearch and Kibana locally
*** tears down everything after the tests run
*** exit code reports success/failure of the tests

2. Best for development:
** Description: Two commands, run in separate terminals, separate the components that are long-running and slow from those that are ephemeral and fast. Tests can be re-run much faster, and this still runs Elasticsearch & Kibana locally.
** `npm run test:ui:server`
** `yarn test:ui:server`
*** starts Elasticsearch and Kibana servers
*** slow to start
*** can be reused for multiple executions of the tests, thereby saving some time when re-running tests
*** automatically restarts the Kibana server when relevant changes are detected
** `node scripts/functional_test_runner`
*** runs the tests against Kibana & Elasticsearch servers that were started `npm run test:ui:server`
*** runs the tests against Kibana & Elasticsearch servers that were started `yarn test:ui:server`
*** exit code reports success or failure of the tests

3. Custom option:
Expand Down Expand Up @@ -405,4 +405,4 @@ const log = getService(‘log’);
// log.debug only writes when using the `--debug` or `--verbose` flag.
log.debug(‘done clicking menu’);
-----------
-----------
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,18 @@ To get started copy and paste this example to `test/functional/config.js`:
["source","js"]
-----------
import { resolve } from 'path';
import { resolveKibanaPath } from '@elastic/plugin-helpers';
import { MyServiceProvider } from './services/my_service';
import { MyAppPageProvider } from './services/my_app_page;
// allow overriding the default kibana directory
// using the KIBANA_DIR environment variable
const KIBANA_CONFIG_PATH = resolve(process.env.KIBANA_DIR || '../kibana', 'test/functional/config.js');
// the default export of config files must be a config provider
// that returns an object with the projects config values
export default async function ({ readConfigFile }) {
// read the Kibana config file so that we can utilize some of
// its services and PageObjects
const kibanaConfig = await readConfigFile(KIBANA_CONFIG_PATH);
const kibanaConfig = await readConfigFile(resolveKibanaPath('test/functional/config.js'));
return {
// list paths to the files that contain your plugins tests
Expand Down Expand Up @@ -81,7 +79,7 @@ From the root of your repo you should now be able to run the `FunctionalTestRunn

["source","shell"]
-----------
node ../kibana/scripts/functional_test_runner
node ../../kibana/scripts/functional_test_runner
-----------

[float]
Expand Down
15 changes: 14 additions & 1 deletion docs/development/plugin/development-plugin-resources.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,20 @@ Many Kibana developers hang out on `irc.freenode.net` in the `#kibana` channel.
[float]
==== Plugin Generator

Check out the https://github.com/elastic/generator-kibana-plugin[plugin generator] to kick-start your plugin.
Check out the https://github.com/elastic/template-kibana-plugin/[plugin generator] to kick-start your plugin.

[float]
==== Directory structure for plugins

The Kibana directory must be named `kibana`, and your plugin directory must be located within the sibling `kibana-extra` folder, for example:

["source","shell"]
-----------
.
├── kibana
├── kibana-extra/foo-plugin
└── kibana-extra/bar-plugin
-----------

[float]
==== References in the code
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ options or data change, and a destroy method which will be called to cleanup.
The render function receives the data object and status object which tells what actually changed.
Render function needs to return a promise, which should be resolved once the visualization is done rendering.

Status object has the following properties: `vis`, `aggs`, `resize`, `data`. Each of them is set to true if the matching
Status object has the following properties: `aggs`, `data`, `params`, `resize`, `time`, `uiState`. Each of them is set to true if the matching
object changed since last call to the render function or set to false otherwise. You can use it to make your
visualization rendering more efficient.

Expand Down
1 change: 1 addition & 0 deletions docs/setup/settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ error messages.
`logging.silent:`:: *Default: false* Set the value of this setting to `true` to suppress all logging output.
`logging.verbose`:: *Default: false* Set the value of this setting to `true` to log all events, including system usage
information and all requests.
`logging.useUTC`:: *Default: true* Set the value of this setting to `false` to log events using the timezone of the server, rather than UTC.

`path.data`:: *Default: `data`* The path where Kibana stores persistent data not saved in Elasticsearch.

Expand Down
20 changes: 12 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
},
"dependencies": {
"@elastic/datemath": "2.3.0",
"@elastic/eui": "0.0.10",
"@elastic/eui": "0.0.11",
"@elastic/filesaver": "1.1.2",
"@elastic/numeral": "2.3.0",
"@elastic/test-subj-selector": "0.2.1",
Expand Down Expand Up @@ -151,25 +151,23 @@
"lodash": "3.10.1",
"lru-cache": "4.1.1",
"markdown-it": "8.3.2",
"mathjs": "3.16.2",
"minimatch": "2.0.10",
"mkdirp": "0.5.1",
"moment": "2.13.0",
"moment-timezone": "0.5.4",
"mustache": "2.3.0",
"ngreact": "0.5.1",
"no-ui-slider": "1.2.0",
"node-fetch": "1.3.2",
"pegjs": "0.9.0",
"pivotal-ui": "11.0.0",
"postcss-loader": "2.0.6",
"prop-types": "15.5.8",
"proxy-from-env": "1.0.0",
"pui-react-overlay-trigger": "8.3.3",
"pui-react-tooltip": "8.3.3",
"querystring-browser": "1.0.4",
"raw-loader": "0.5.1",
"react": "16.0.0",
"react-ace": "5.2.2",
"react-addons-test-utils": "15.6.2",
"react-ace": "5.5.0",
"react-anything-sortable": "1.7.3",
"react-color": "2.11.7",
"react-dom": "16.0.0",
Expand Down Expand Up @@ -212,6 +210,7 @@
"vision": "4.1.0",
"webpack": "3.6.0",
"webpack-merge": "4.1.0",
"whatwg-fetch": "^2.0.3",
"wreck": "12.4.0",
"yauzl": "2.7.0"
},
Expand Down Expand Up @@ -250,7 +249,7 @@
"grunt-cli": "0.1.13",
"grunt-contrib-clean": "1.0.0",
"grunt-contrib-copy": "0.8.1",
"grunt-esvm": "3.2.11",
"grunt-esvm": "3.2.12",
"grunt-karma": "2.0.0",
"grunt-run": "0.7.0",
"grunt-simple-mocha": "0.4.0",
Expand Down Expand Up @@ -303,8 +302,13 @@
"yeoman-generator": "1.1.1",
"yo": "2.0.0"
},
"resolutions": {
"angular": "1.6.5",
"moment": "2.13.0",
"react": "16.0.0"
},
"engines": {
"node": "6.12.2",
"npm": "3.10.10"
"yarn": "^1.3.2"
}
}
2 changes: 1 addition & 1 deletion src/cli/serve/serve.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function readServerSettings(opts, extraCliOptions) {

if (opts.dev) {
set('env', 'development');
set('optimize.lazy', true);
set('optimize.watch', true);

if (opts.ssl) {
set('server.ssl.enabled', true);
Expand Down
Loading

0 comments on commit 9578180

Please sign in to comment.