Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix uiSettings tests #29258

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
e7c28fd
throw config error based on the joi validation error (#29137)
kobelb Jan 23, 2019
ece86f6
Switch implicit server.log behavior with tmpl to logWithMetadata (#29…
kobelb Jan 23, 2019
f56ed2c
Fix template (#28922)
Nox911 Jan 23, 2019
80a1933
[Uptime] Remove broken stacked chart in monitor detail page. (#29019)
andrewvc Jan 23, 2019
8f54a6f
[Uptime] Disable update button for SDP (#29150)
justinkambic Jan 23, 2019
e706908
Small improvements to add cluster page (#29142)
Jan 23, 2019
09f8904
[Maps] Move alpha from style descriptor to layer descriptor (#29059)
nreese Jan 23, 2019
a11e471
Updates React et al to 16.6 (#24707)
jasonrhodes Jan 23, 2019
476a88e
[Uptime] Add crosshair sync for monitor page charts (#28631)
justinkambic Jan 23, 2019
b21ee11
Fix index presence detection to work in ccs-only setups (#28926)
weltenwort Jan 23, 2019
c96068c
[Uptime] Fix "last updated" field (#28720)
justinkambic Jan 23, 2019
bc86c52
Record failed ES queue jobs when saving the result fails (don't retry…
joelgriffith Jan 23, 2019
adbe6bb
[ML] Fixing job cloning when it has an unknown created_by value (#29175)
jgowdyelastic Jan 23, 2019
e0992aa
[i18n] Translate partials (#28653)
Bamieh Jan 23, 2019
c052613
[dashboard+gis] remove dark mode options (#29017)
Jan 23, 2019
45a4d3b
[kbn-es] Add support to kbn-es and kbn-test for data archives (#28723)
joshdover Jan 23, 2019
76212da
[Maps] fix panel cuttoff in K7 design (#29209)
nreese Jan 23, 2019
9bdee51
[home/sampleData] add empty migrationVersion to auto-migration object…
Jan 24, 2019
10e52a0
fix(NA): replace process.env.HOME with require('os').homedir(). (#27557)
mistic Jan 24, 2019
bfa417c
Localize strings in Rollup and ILM apps. (#29034)
cjcenizal Jan 24, 2019
a95be51
add follower badge to index management (#29177)
bmcconaghy Jan 24, 2019
78299c0
[es] when specifying path with vars always use encodeURIComponent (#2…
Jan 24, 2019
15658b7
[Uptime] Change add-data link to point to uptime app. (#29200)
andrewvc Jan 24, 2019
735cc82
[ML] explorer controller refactor (#28750)
walterra Jan 24, 2019
ad48848
[ML] Adding missed applyAsync calls (#28814)
jgowdyelastic Jan 24, 2019
45b8ff9
[ML] Adding ability to override number of sample lines in File Data V…
jgowdyelastic Jan 24, 2019
5b6ecbc
Deleted dead code (#28761)
sulemanof Jan 24, 2019
9d33143
[APM] Remove v1 and make required ECS changes (#28068)
sorenlouv Jan 24, 2019
1082855
Merge master
chrisdavies Jan 24, 2019
049a2ee
Fix uiSettings tests
chrisdavies Jan 24, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"xpack.graph": "x-pack/plugins/graph",
"xpack.grokDebugger": "x-pack/plugins/grokdebugger",
"xpack.idxMgmt": "x-pack/plugins/index_management",
"xpack.indexLifecycleMgmt": "x-pack/plugins/index_lifecycle_management",
"xpack.infra": "x-pack/plugins/infra",
"xpack.licenseMgmt": "x-pack/plugins/license_management",
"xpack.ml": "x-pack/plugins/ml",
Expand Down
2 changes: 1 addition & 1 deletion docs/api/dashboard-import/import.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ POST api/kibana/dashboards/import?exclude=index-pattern
"hits": 0,
"description": "",
"panelsJSON": "[{\"gridData\":{\"w\":24,\"h\":15,\"x\":0,\"y\":0,\"i\":\"1\"},\"version\":\"7.0.0-alpha1\",\"panelIndex\":\"1\",\"type\":\"visualization\",\"id\":\"80b956f0-b2cd-11e8-ad8e-85441f0c2e5c\",\"embeddableConfig\":{}}]",
"optionsJSON": "{\"darkTheme\":false,\"useMargins\":true,\"hidePanelTitles\":false}",
"optionsJSON": "{\"useMargins\":true,\"hidePanelTitles\":false}",
"version": 1,
"timeRestore": false,
"kibanaSavedObjectMeta": {
Expand Down
2 changes: 1 addition & 1 deletion docs/api/url_shortening/shorten_url.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ the shortened URL token for the provided request body.
--------------------------------------------------
POST api/shorten_url
{
"url": "/app/kibana#/dashboard?_g=()&_a=(description:'',filters:!(),fullScreenMode:!f,options:(darkTheme:!f,hidePanelTitles:!f,useMargins:!t),panels:!((embeddableConfig:(),gridData:(h:15,i:'1',w:24,x:0,y:0),id:'8f4d0c00-4c86-11e8-b3d7-01146121b73d',panelIndex:'1',type:visualization,version:'7.0.0-alpha1')),query:(language:lucene,query:''),timeRestore:!f,title:'New%20Dashboard',viewMode:edit)",
"url": "/app/kibana#/dashboard?_g=()&_a=(description:'',filters:!(),fullScreenMode:!f,options:(hidePanelTitles:!f,useMargins:!t),panels:!((embeddableConfig:(),gridData:(h:15,i:'1',w:24,x:0,y:0),id:'8f4d0c00-4c86-11e8-b3d7-01146121b73d',panelIndex:'1',type:visualization,version:'7.0.0-alpha1')),query:(language:lucene,query:''),timeRestore:!f,title:'New%20Dashboard',viewMode:edit)",
}
--------------------------------------------------
// KIBANA
Expand Down
1 change: 0 additions & 1 deletion docs/management/advanced-options.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ mentioned use "_default_".
`timepicker:timeDefaults`:: The default time filter selection.
`timepicker:refreshIntervalDefaults`:: The time filter's default refresh interval.
`timepicker:quickRanges`:: The list of ranges to show in the Quick section of the time picker. This should be an array of objects, with each object containing `from`, `to` (see {ref}/common-options.html#date-math[accepted formats]), `display` (the title to be displayed), and `section` (which column to put the option in).
`dashboard:defaultDarkTheme`:: Set this property to `true` to make new dashboards use the dark theme by default.
`filters:pinnedByDefault`:: Set this property to `true` to make filters have a global state by default.
`filterEditor:suggestValues`:: Set this property to `false` to prevent the filter editor from suggesting values for fields.
`notifications:banner`:: You can specify a custom banner to display temporary notices to all users. This field supports
Expand Down
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,11 @@
"pug": "^2.0.3",
"querystring-browser": "1.0.4",
"raw-loader": "0.5.1",
"react": "^16.3.0",
"react": "^16.6.0",
"react-addons-shallow-compare": "15.6.2",
"react-anything-sortable": "^1.7.4",
"react-color": "^2.13.8",
"react-dom": "^16.3.0",
"react-dom": "^16.6.0",
"react-grid-layout": "^0.16.2",
"react-input-range": "^1.3.0",
"react-markdown": "^3.1.4",
Expand Down Expand Up @@ -324,9 +324,10 @@
"classnames": "2.2.5",
"dedent": "^0.7.0",
"delete-empty": "^2.0.0",
"enzyme": "3.2.0",
"enzyme-adapter-react-16": "^1.1.1",
"enzyme-to-json": "3.3.1",
"enzyme": "^3.7.0",
"enzyme-adapter-react-16": "^1.6.0",
"enzyme-adapter-utils": "^1.8.1",
"enzyme-to-json": "^3.3.4",
"eslint": "^5.6.0",
"eslint-config-prettier": "^3.1.0",
"eslint-plugin-babel": "^5.2.0",
Expand Down
7 changes: 7 additions & 0 deletions packages/kbn-es/src/cli_commands/snapshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ exports.help = (defaults = {}) => {
--version Version of ES to download [default: ${defaults.version}]
--base-path Path containing cache/installations [default: ${basePath}]
--install-path Installation path, defaults to 'source' within base-path
--data-archive Path to zip or tarball containing an ES data directory to seed the cluster with.
--password Sets password for elastic user [default: ${password}]
-E Additional key=value settings to pass to Elasticsearch
--download-only Download the snapshot but don't actually start it
Expand All @@ -49,6 +50,7 @@ exports.run = async (defaults = {}) => {
alias: {
basePath: 'base-path',
installPath: 'install-path',
dataArchive: 'data-archive',
esArgs: 'E',
},

Expand All @@ -62,6 +64,11 @@ exports.run = async (defaults = {}) => {
await cluster.downloadSnapshot(options);
} else {
const { installPath } = await cluster.installSnapshot(options);

if (options.dataArchive) {
await cluster.extractDataDirectory(installPath, options.dataArchive);
}

await cluster.run(installPath, { esArgs: options.esArgs });
}
};
7 changes: 7 additions & 0 deletions packages/kbn-es/src/cli_commands/source.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ exports.help = (defaults = {}) => {
--source-path Path to ES source [default: ${defaults['source-path']}]
--base-path Path containing cache/installations [default: ${basePath}]
--install-path Installation path, defaults to 'source' within base-path
--data-archive Path to zip or tarball containing an ES data directory to seed the cluster with.
--password Sets password for elastic user [default: ${password}]
-E Additional key=value settings to pass to Elasticsearch

Expand All @@ -49,6 +50,7 @@ exports.run = async (defaults = {}) => {
basePath: 'base-path',
installPath: 'install-path',
sourcePath: 'source-path',
dataArchive: 'data-archive',
esArgs: 'E',
},

Expand All @@ -57,5 +59,10 @@ exports.run = async (defaults = {}) => {

const cluster = new Cluster();
const { installPath } = await cluster.installSource(options);

if (options.dataArchive) {
await cluster.extractDataDirectory(installPath, options.dataArchive);
}

await cluster.run(installPath, { esArgs: options.esArgs });
};
25 changes: 24 additions & 1 deletion packages/kbn-es/src/cluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@

const execa = require('execa');
const chalk = require('chalk');
const path = require('path');
const { downloadSnapshot, installSnapshot, installSource, installArchive } = require('./install');
const { ES_BIN } = require('./paths');
const { log: defaultLog, parseEsLog, extractConfigFiles } = require('./utils');
const { log: defaultLog, parseEsLog, extractConfigFiles, decompress } = require('./utils');
const { createCliError } = require('./errors');
const { promisify } = require('util');
const treeKillAsync = promisify(require('tree-kill'));
Expand Down Expand Up @@ -116,6 +117,28 @@ exports.Cluster = class Cluster {
return { installPath };
}

/**
* Unpakcs a tar or zip file containing the data directory for an
* ES cluster.
*
* @param {String} installPath
* @param {String} archivePath
*/
async extractDataDirectory(installPath, archivePath) {
this._log.info(chalk.bold(`Extracting data directory`));
this._log.indent(4);

// decompress excludes the root directory as that is how our archives are
// structured. This works in our favor as we can explicitly extract into the data dir
const extractPath = path.resolve(installPath, 'data');
this._log.info(`Data archive: ${archivePath}`);
this._log.info(`Extract path: ${extractPath}`);

await decompress(archivePath, extractPath);

this._log.indent(-4);
}

/**
* Starts ES and returns resolved promise once started
*
Expand Down
5 changes: 5 additions & 0 deletions packages/kbn-test/src/es/es_test_cluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export function createEsTestCluster(options = {}) {
log,
basePath = resolve(KIBANA_ROOT, '.es'),
esFrom = esTestConfig.getBuildFrom(),
dataArchive,
} = options;

const randomHash = Math.random()
Expand Down Expand Up @@ -74,6 +75,10 @@ export function createEsTestCluster(options = {}) {
throw new Error(`unknown option esFrom "${esFrom}"`);
}

if (dataArchive) {
await cluster.extractDataDirectory(installPath, dataArchive);
}

await cluster.start(installPath, {
esArgs: [
`cluster.name=${clusterName}`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export async function runElasticsearch({ config, options }) {
log,
basePath: resolve(KIBANA_ROOT, '.es'),
esFrom: esFrom || config.get('esTestCluster.from'),
dataArchive: config.get('esTestCluster.dataArchive'),
});

const esArgs = config.get('esTestCluster.serverArgs');
Expand Down
3 changes: 2 additions & 1 deletion src/dev/register_git_hook/register_git_hook.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import chalk from 'chalk';
import { chmod, unlink, writeFile } from 'fs';
import dedent from 'dedent';
import normalizePath from 'normalize-path';
import os from 'os';
import { resolve } from 'path';
import { promisify } from 'util';
import SimpleGit from 'simple-git';
Expand Down Expand Up @@ -128,7 +129,7 @@ export async function registerPrecommitGitHook(log) {
await getPrecommitGitHookScriptPath(REPO_ROOT),
getKbnPrecommitGitHookScript(
REPO_ROOT,
normalizePath(process.env.HOME.replace(/'/g, '\'')),
normalizePath(os.homedir()),
process.platform
)
);
Expand Down
1 change: 1 addition & 0 deletions src/functional_test_runner/lib/config/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ export const schema = Joi.object().keys({
license: Joi.string().default('oss'),
from: Joi.string().default('snapshot'),
serverArgs: Joi.array(),
dataArchive: Joi.string(),
}).default(),

kbnTestServer: Joi.object().keys({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ describe('plugins/elasticsearch', () => {
beforeEach(function () {
server = {
log: sinon.stub(),
logWithMetadata: sinon.stub(),
plugins: {
elasticsearch: {
getCluster: sinon.stub().withArgs('admin').returns({ callWithInternalUser: sinon.stub() }),
Expand Down Expand Up @@ -120,17 +121,17 @@ describe('plugins/elasticsearch', () => {
it('warns if a node is only off by a patch version', async () => {
setNodes('5.1.1');
await ensureEsVersion(server, KIBANA_VERSION);
sinon.assert.callCount(server.log, 2);
expect(server.log.getCall(0).args[0]).to.contain('debug');
expect(server.log.getCall(1).args[0]).to.contain('warning');
sinon.assert.callCount(server.logWithMetadata, 2);
expect(server.logWithMetadata.getCall(0).args[0]).to.contain('debug');
expect(server.logWithMetadata.getCall(1).args[0]).to.contain('warning');
});

it('warns if a node is off by a patch version and without http publish address', async () => {
setNodeWithoutHTTP('5.1.1');
await ensureEsVersion(server, KIBANA_VERSION);
sinon.assert.callCount(server.log, 2);
expect(server.log.getCall(0).args[0]).to.contain('debug');
expect(server.log.getCall(1).args[0]).to.contain('warning');
sinon.assert.callCount(server.logWithMetadata, 2);
expect(server.logWithMetadata.getCall(0).args[0]).to.contain('debug');
expect(server.logWithMetadata.getCall(1).args[0]).to.contain('warning');
});

it('errors if a node incompatible and without http publish address', async () => {
Expand All @@ -147,28 +148,28 @@ describe('plugins/elasticsearch', () => {
setNodes('5.1.1');

await ensureEsVersion(server, KIBANA_VERSION);
sinon.assert.callCount(server.log, 2);
expect(server.log.getCall(0).args[0]).to.contain('debug');
expect(server.log.getCall(1).args[0]).to.contain('warning');
sinon.assert.callCount(server.logWithMetadata, 2);
expect(server.logWithMetadata.getCall(0).args[0]).to.contain('debug');
expect(server.logWithMetadata.getCall(1).args[0]).to.contain('warning');

await ensureEsVersion(server, KIBANA_VERSION);
sinon.assert.callCount(server.log, 3);
expect(server.log.getCall(2).args[0]).to.contain('debug');
sinon.assert.callCount(server.logWithMetadata, 3);
expect(server.logWithMetadata.getCall(2).args[0]).to.contain('debug');
});

it('warns again if the node list changes', async () => {
setNodes('5.1.1');

await ensureEsVersion(server, KIBANA_VERSION);
sinon.assert.callCount(server.log, 2);
expect(server.log.getCall(0).args[0]).to.contain('debug');
expect(server.log.getCall(1).args[0]).to.contain('warning');
sinon.assert.callCount(server.logWithMetadata, 2);
expect(server.logWithMetadata.getCall(0).args[0]).to.contain('debug');
expect(server.logWithMetadata.getCall(1).args[0]).to.contain('warning');

setNodes('5.1.2');
await ensureEsVersion(server, KIBANA_VERSION);
sinon.assert.callCount(server.log, 4);
expect(server.log.getCall(2).args[0]).to.contain('debug');
expect(server.log.getCall(3).args[0]).to.contain('warning');
sinon.assert.callCount(server.logWithMetadata, 4);
expect(server.logWithMetadata.getCall(2).args[0]).to.contain('debug');
expect(server.logWithMetadata.getCall(3).args[0]).to.contain('warning');
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ describe('plugins/elasticsearch', () => {

// Setup the server mock
server = {
log: sinon.stub(),
logWithMetadata: sinon.stub(),
info: { port: 5601 },
config: function () { return { get, set }; },
plugins: {
Expand Down
2 changes: 1 addition & 1 deletion src/legacy/core_plugins/elasticsearch/lib/create_proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export function createProxy(server) {
handler(req, h) {
const { query, payload: body } = req;
return callWithRequest(req, 'transport.request', {
path: `/${req.params.index}/_search`,
path: `/${encodeURIComponent(req.params.index)}/_search`,
method: 'POST',
query,
body
Expand Down
17 changes: 8 additions & 9 deletions src/legacy/core_plugins/elasticsearch/lib/ensure_es_version.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export function ensureEsVersion(server, kibanaVersion) {
const { callWithInternalUser } = server.plugins.elasticsearch.getCluster('admin');
const isProd = server.config().get('env.prod');

server.log(['plugin', 'debug'], 'Checking Elasticsearch version');
server.logWithMetadata(['plugin', 'debug'], 'Checking Elasticsearch version');
return callWithInternalUser('nodes.info', {
filterPath: [
'nodes.*.version',
Expand Down Expand Up @@ -92,15 +92,14 @@ export function ensureEsVersion(server, kibanaVersion) {
const warningNodeNames = getHumanizedNodeNames(simplifiedNodes).join(', ');
if (lastWarnedNodesForServer.get(server) !== warningNodeNames) {
lastWarnedNodesForServer.set(server, warningNodeNames);
server.log(['warning'], {
tmpl: (
`You're running Kibana ${kibanaVersion} with some different versions of ` +
server.logWithMetadata(['warning'],
`You're running Kibana ${kibanaVersion} with some different versions of ` +
'Elasticsearch. Update Kibana or Elasticsearch to the same ' +
`version to prevent compatibility issues: ${warningNodeNames}`
),
kibanaVersion,
nodes: simplifiedNodes,
});
`version to prevent compatibility issues: ${warningNodeNames}`,
{
kibanaVersion,
nodes: simplifiedNodes,
});
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export const createHeartbeatInstructions = context => ({
defaultMessage: 'Start Heartbeat',
}),
textPre: i18n.translate('kbn.common.tutorials.heartbeatInstructions.start.osxTextPre', {
defaultMessage: 'The `setup` command loads the Kibana dashboards. If the dashboards are already set up, omit this command.',
defaultMessage: 'The `setup` command loads the Kibana index pattern.',
}),
commands: [
'./heartbeat setup',
Expand All @@ -115,7 +115,7 @@ export const createHeartbeatInstructions = context => ({
defaultMessage: 'Start Heartbeat',
}),
textPre: i18n.translate('kbn.common.tutorials.heartbeatInstructions.start.debTextPre', {
defaultMessage: 'The `setup` command loads the Kibana dashboards. If the dashboards are already set up, omit this command.',
defaultMessage: 'The `setup` command loads the Kibana index pattern.',
}),
commands: [
'sudo heartbeat setup',
Expand All @@ -127,7 +127,7 @@ export const createHeartbeatInstructions = context => ({
defaultMessage: 'Start Heartbeat',
}),
textPre: i18n.translate('kbn.common.tutorials.heartbeatInstructions.start.rpmTextPre', {
defaultMessage: 'The `setup` command loads the Kibana dashboards. If the dashboards are already set up, omit this command.',
defaultMessage: 'The `setup` command loads the Kibana index pattern.',
}),
commands: [
'sudo heartbeat setup',
Expand All @@ -139,7 +139,7 @@ export const createHeartbeatInstructions = context => ({
defaultMessage: 'Start Heartbeat',
}),
textPre: i18n.translate('kbn.common.tutorials.heartbeatInstructions.start.windowsTextPre', {
defaultMessage: 'The `setup` command loads the Kibana dashboards. If the dashboards are already set up, omit this command.',
defaultMessage: 'The `setup` command loads the Kibana index pattern.',
}),
commands: [
'.\\heartbeat.exe setup',
Expand Down
1 change: 0 additions & 1 deletion src/legacy/core_plugins/kibana/public/dashboard/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ State communicated to the embeddable.
// TODO:
filters: FilterObject,
timeRange: TimeRangeObject,
darkTheme: boolean,
}
```

Expand Down
Loading