Skip to content

Commit

Permalink
Merge branch 'master' into scriptedFieldTests
Browse files Browse the repository at this point in the history
  • Loading branch information
spalger authored Dec 13, 2016
2 parents 78018ad + 2f6654b commit 75eb350
Show file tree
Hide file tree
Showing 898 changed files with 7,570 additions and 9,147 deletions.
10 changes: 7 additions & 3 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
/optimize
/src/fixtures/vislib/mock_data
/src/ui/public/angular-bootstrap
/test/fixtures/scenarios
/src/core_plugins/console/public/webpackShims
/src/core_plugins/console/public/tests/webpackShims
/src/core_plugins/timelion/bower_components
/src/core_plugins/timelion/vendor_components
test/fixtures/scenarios
optimize
test/fixtures/scenarios
/src/ui/public/utils/decode_geo_hash.js
4 changes: 4 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
---
extends: '@elastic/kibana'
rules:
no-unused-vars: off
no-extra-semi: off
quotes: off
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@ selenium
*.swp
*.swo
*.out
src/ui_framework/doc_site/build/*.js*
12 changes: 0 additions & 12 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,6 @@ module.exports = function (grunt) {
' * Copyright (c) <%= grunt.template.today("yyyy") %> <%= package.author.company %>;' +
' Licensed <%= package.license %> */\n'
},

lintThese: [
'Gruntfile.js',
'<%= root %>/tasks/**/*.js',
'<%= root %>/test/**/*.js',
'<%= src %>/**/*.js',
'!<%= src %>/ui/public/angular-bootstrap/**/*.js',
'!<%= src %>/core_plugins/timelion/bower_components/**/*.js',
'!<%= src %>/core_plugins/timelion/vendor_components/**/*.js',
'!<%= src %>/fixtures/**/*.js',
'!<%= root %>/test/fixtures/scenarios/**/*.js'
]
};

grunt.config.merge(config);
Expand Down
11 changes: 10 additions & 1 deletion docs/migration/migrate_6_0.asciidoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
[[breaking-changes-6.0]]
== Breaking changes in 6.0

There are not yet any breaking changes in Kibana 6.0
This section discusses the changes that you need to be aware of when migrating
your application to Kibana 6.0.

[float]
=== Removed option to use unsupported scripting languages
*Details:* Kibana 5.x allowed users to create scripted fields using any scripting language enabled in Elasticsearch.
Kibana 6.0 will only support Painless and Lucene expression based scripts.


*Impact:* You will need to migrate your groovy, python, javascript, etc. scripted fields to Painless or Lucene expressions.
37 changes: 27 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@
"makelogs": "makelogs",
"mocha": "mocha",
"mocha:debug": "mocha --debug-brk",
"sterilize": "grunt sterilize"
"sterilize": "grunt sterilize",
"uiFramework:start": "webpack-dev-server --config src/ui_framework/doc_site/webpack.config.js --hot --inline --content-base src/ui_framework/doc_site/build"
},
"repository": {
"type": "git",
Expand All @@ -72,7 +73,7 @@
"@bigfunger/decompress-zip": "0.2.0-stripfix3",
"@bigfunger/jsondiffpatch": "0.1.38-webpack",
"@elastic/datemath": "2.3.0",
"@elastic/kibana-ui-framework": "0.0.11",
"@elastic/kibana-ui-framework": "0.0.13",
"@spalger/filesaver": "1.1.2",
"@spalger/leaflet-draw": "0.2.3",
"@spalger/leaflet-heat": "0.1.3",
Expand Down Expand Up @@ -103,8 +104,8 @@
"d3": "3.5.6",
"d3-cloud": "1.2.1",
"dragula": "3.7.0",
"elasticsearch": "12.0.0-rc5",
"elasticsearch-browser": "12.0.0-rc5",
"elasticsearch": "12.1.2",
"elasticsearch-browser": "12.1.2",
"encode-uri-query": "1.0.0",
"even-better": "7.0.2",
"expiry-js": "0.1.7",
Expand Down Expand Up @@ -165,17 +166,19 @@
"wreck": "6.2.0"
},
"devDependencies": {
"@elastic/eslint-config-kibana": "0.0.3",
"@elastic/eslint-config-kibana": "0.2.1",
"angular-mocks": "1.4.7",
"auto-release-sinon": "1.0.3",
"babel-eslint": "4.1.8",
"babel-eslint": "6.1.2",
"chai": "3.5.0",
"cheerio": "0.22.0",
"chokidar": "1.6.0",
"chromedriver": "2.24.1",
"classnames": "2.2.5",
"del": "1.2.1",
"elasticdump": "2.1.1",
"eslint": "1.10.3",
"eslint-plugin-mocha": "1.1.0",
"eslint": "3.11.1",
"eslint-plugin-mocha": "4.7.0",
"event-stream": "3.3.2",
"expect.js": "0.3.1",
"faker": "1.1.0",
Expand All @@ -189,9 +192,11 @@
"grunt-karma": "2.0.0",
"grunt-run": "0.6.0",
"grunt-simple-mocha": "0.4.0",
"gruntify-eslint": "1.0.1",
"gulp-sourcemaps": "1.7.3",
"handlebars": "4.0.5",
"highlight.js": "9.0.0",
"history": "2.1.1",
"html-loader": "0.4.3",
"husky": "0.8.1",
"image-diff": "1.6.0",
"intern": "3.2.3",
Expand All @@ -203,6 +208,7 @@
"karma-ie-launcher": "0.2.0",
"karma-mocha": "0.2.0",
"karma-safari-launcher": "0.1.1",
"keymirror": "0.1.1",
"license-checker": "5.1.2",
"load-grunt-config": "0.19.2",
"makelogs": "3.1.1",
Expand All @@ -211,15 +217,26 @@
"murmurhash3js": "3.0.1",
"ncp": "2.0.0",
"nock": "8.0.0",
"node-sass": "3.8.0",
"npm": "3.10.8",
"portscanner": "1.0.0",
"proxyquire": "1.7.10",
"react": "15.2.0",
"react-addons-test-utils": "15.2.0",
"react-dom": "15.2.0",
"react-redux": "4.4.5",
"react-router": "2.0.0",
"react-router-redux": "4.0.4",
"redux": "3.0.0",
"redux-thunk": "0.1.0",
"sass-loader": "4.0.0",
"simple-git": "1.37.0",
"sinon": "1.17.2",
"source-map": "0.5.6",
"source-map-support": "0.2.10",
"supertest": "1.2.0",
"supertest-as-promised": "2.0.2"
"supertest-as-promised": "2.0.2",
"webpack-dev-server": "1.14.1"
},
"engines": {
"node": "6.9.0",
Expand Down
4 changes: 2 additions & 2 deletions src/cli/cluster/__tests__/_mock_cluster_fork.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default class MockClusterFork extends EventEmitter {
dead = true;
this.emit('exit');
cluster.emit('exit', this, this.exitCode || 0);
}());
})();
}),
},
isDead: sinon.spy(() => dead),
Expand All @@ -39,6 +39,6 @@ export default class MockClusterFork extends EventEmitter {
await wait();
dead = false;
this.emit('online');
}());
})();
}
}
23 changes: 10 additions & 13 deletions src/cli/cluster/cluster_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,19 +86,16 @@ module.exports = class ClusterManager {
const chokidar = require('chokidar');
const fromRoot = require('../../utils/from_root');

const watchPaths = uniq(
[
fromRoot('src/core_plugins'),
fromRoot('src/server'),
fromRoot('src/ui'),
fromRoot('src/utils'),
fromRoot('config'),
...extraPaths
]
.map(path => resolve(path))
);

this.watcher = chokidar.watch(watchPaths, {
const watchPaths = [
fromRoot('src/core_plugins'),
fromRoot('src/server'),
fromRoot('src/ui'),
fromRoot('src/utils'),
fromRoot('config'),
...extraPaths
].map(path => resolve(path));

this.watcher = chokidar.watch(uniq(watchPaths), {
cwd: fromRoot('.'),
ignored: /[\\\/](\..*|node_modules|bower_components|public|__tests__)[\\\/]/
});
Expand Down
14 changes: 7 additions & 7 deletions src/cli/cluster/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ import { EventEmitter } from 'events';

import { BinderFor, fromRoot } from '../../utils';

let cliPath = fromRoot('src/cli');
let baseArgs = _.difference(process.argv.slice(2), ['--no-watch']);
let baseArgv = [process.execPath, cliPath].concat(baseArgs);
const cliPath = fromRoot('src/cli');
const baseArgs = _.difference(process.argv.slice(2), ['--no-watch']);
const baseArgv = [process.execPath, cliPath].concat(baseArgs);

cluster.setupMaster({
exec: cliPath,
silent: false
});

let dead = fork => {
const dead = fork => {
return fork.isDead() || fork.killed;
};

Expand All @@ -40,7 +40,7 @@ module.exports = class Worker extends EventEmitter {
this.clusterBinder = new BinderFor(cluster);
this.processBinder = new BinderFor(process);

let argv = _.union(baseArgv, opts.argv || []);
const argv = _.union(baseArgv, opts.argv || []);
this.env = {
kbnWorkerType: this.type,
kbnWorkerArgv: JSON.stringify(argv)
Expand Down Expand Up @@ -124,8 +124,8 @@ module.exports = class Worker extends EventEmitter {
}

flushChangeBuffer() {
let files = _.unique(this.changes.splice(0));
let prefix = files.length > 1 ? '\n - ' : '';
const files = _.unique(this.changes.splice(0));
const prefix = files.length > 1 ? '\n - ' : '';
return files.reduce(function (list, file) {
return `${list || ''}${prefix}"${file}"`;
}, '');
Expand Down
12 changes: 6 additions & 6 deletions src/cli/command.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ Command.prototype.unknownArgv = function (argv) {
* @return {[type]} [description]
*/
Command.prototype.collectUnknownOptions = function () {
let title = `Extra ${this._name} options`;
const title = `Extra ${this._name} options`;

this.allowUnknownOption();
this.getUnknownOptions = function () {
let opts = {};
let unknowns = this.unknownArgv();
const opts = {};
const unknowns = this.unknownArgv();

while (unknowns.length) {
let opt = unknowns.shift().split('=');
const opt = unknowns.shift().split('=');
if (opt[0].slice(0, 2) !== '--') {
this.error(`${title} "${opt[0]}" must start with "--"`);
}
Expand All @@ -75,14 +75,14 @@ Command.prototype.collectUnknownOptions = function () {
};

Command.prototype.parseOptions = _.wrap(Command.prototype.parseOptions, function (parse, argv) {
let opts = parse.call(this, argv);
const opts = parse.call(this, argv);
this.unknownArgv(opts.unknown);
return opts;
});

Command.prototype.action = _.wrap(Command.prototype.action, function (action, fn) {
return action.call(this, function (...args) {
let ret = fn.apply(this, args);
const ret = fn.apply(this, args);
if (ret && typeof ret.then === 'function') {
ret.then(null, function (e) {
console.log('FATAL CLI ERROR', e.stack);
Expand Down
18 changes: 9 additions & 9 deletions src/cli/help.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ module.exports = function (command, spaces) {
return command.outputHelp();
}

let defCmd = _.find(command.commands, function (cmd) {
const defCmd = _.find(command.commands, function (cmd) {
return cmd._name === 'serve';
});

let desc = !command.description() ? '' : command.description();
let cmdDef = !defCmd ? '' : `=${defCmd._name}`;
const desc = !command.description() ? '' : command.description();
const cmdDef = !defCmd ? '' : `=${defCmd._name}`;

return (
`
Expand All @@ -31,11 +31,11 @@ function indent(str, n) {
}

function commandsSummary(program) {
let cmds = _.compact(program.commands.map(function (cmd) {
let name = cmd._name;
const cmds = _.compact(program.commands.map(function (cmd) {
const name = cmd._name;
if (name === '*') return;
let opts = cmd.options.length ? ' [options]' : '';
let args = cmd._args.map(function (arg) {
const opts = cmd.options.length ? ' [options]' : '';
const args = cmd._args.map(function (arg) {
return humanReadableArgName(arg);
}).join(' ');

Expand All @@ -45,7 +45,7 @@ function commandsSummary(program) {
];
}));

let cmdLColWidth = cmds.reduce(function (width, cmd) {
const cmdLColWidth = cmds.reduce(function (width, cmd) {
return Math.max(width, cmd[0].length);
}, 0);

Expand All @@ -69,6 +69,6 @@ ${indent(cmd.optionHelp(), 2)}
}

function humanReadableArgName(arg) {
let nameOutput = arg.name + (arg.variadic === true ? '...' : '');
const nameOutput = arg.name + (arg.variadic === true ? '...' : '');
return arg.required ? '<' + nameOutput + '>' : '[' + nameOutput + ']';
}
2 changes: 1 addition & 1 deletion src/cli/log.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import _ from 'lodash';
import ansicolors from 'ansicolors';

let log = _.restParam(function (color, label, rest1) {
const log = _.restParam(function (color, label, rest1) {
console.log.apply(console, [color(` ${_.trim(label)} `)].concat(rest1));
});

Expand Down
8 changes: 4 additions & 4 deletions src/cli_plugin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import listCommand from './list';
import installCommand from './install';
import removeCommand from './remove';

let argv = process.env.kbnWorkerArgv ? JSON.parse(process.env.kbnWorkerArgv) : process.argv.slice();
let program = new Command('bin/kibana-plugin');
const argv = process.env.kbnWorkerArgv ? JSON.parse(process.env.kbnWorkerArgv) : process.argv.slice();
const program = new Command('bin/kibana-plugin');

program
.version(pkg.version)
Expand All @@ -23,7 +23,7 @@ program
.command('help <command>')
.description('get the help for a specific command')
.action(function (cmdName) {
let cmd = _.find(program.commands, { _name: cmdName });
const cmd = _.find(program.commands, { _name: cmdName });
if (!cmd) return program.error(`unknown command ${cmdName}`);
cmd.help();
});
Expand All @@ -35,7 +35,7 @@ program
});

// check for no command name
let subCommand = argv[2] && !String(argv[2][0]).match(/^-|^\.|\//);
const subCommand = argv[2] && !String(argv[2][0]).match(/^-|^\.|\//);
if (!subCommand) {
program.defaultHelp();
}
Expand Down
2 changes: 1 addition & 1 deletion src/cli_plugin/install/__tests__/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe('kibana cli', function () {

describe('commander options', function () {

let program = {
const program = {
command: function () { return program; },
description: function () { return program; },
option: function () { return program; },
Expand Down
2 changes: 1 addition & 1 deletion src/cli_plugin/install/downloaders/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { createWriteStream, createReadStream, unlinkSync, statSync } from 'fs';

function openSourceFile({ sourcePath }) {
try {
let fileInfo = statSync(sourcePath);
const fileInfo = statSync(sourcePath);

const readStream = createReadStream(sourcePath);

Expand Down
Loading

0 comments on commit 75eb350

Please sign in to comment.