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

Kibana index template #14112

Merged
merged 36 commits into from
Sep 23, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
4b2f6cb
[savedObjects/delete+bulk_get] add failing tests
spalger Sep 21, 2017
859a5ce
[savedObjects/delete+bulk_get] improve 404 handling
spalger Sep 21, 2017
cf1b5a7
[savedObjects/client] fix mocha tests
spalger Sep 21, 2017
5032648
Merge branch 'master' of github.com:elastic/kibana into fix/savedObje…
spalger Sep 22, 2017
b99bf09
[savedObjects/tests] remove extra test wrapper
spalger Sep 22, 2017
00aaac6
[apiIntegration/kbnServer] basically disable es healthcheck
spalger Sep 22, 2017
a93cae0
[savedObjects/create] add integration test
spalger Sep 22, 2017
ec21fe4
[savedObjects/find] add failing integration tests
spalger Sep 22, 2017
3c6ee2f
[savedObjects/find] fix failing test
spalger Sep 22, 2017
de1a3fc
[savedObjects/client] explain reason for generic 404s
spalger Sep 22, 2017
8d2e623
[savedObjects/get] add integration tests
spalger Sep 22, 2017
bcd3880
[savedObjects/find] test request with unkown type
spalger Sep 22, 2017
dae161d
[savedObjects/find] add some more weird param tests
spalger Sep 22, 2017
058e66d
[savedObjects/find] test that weird params pass when no index
spalger Sep 22, 2017
69272c7
[savedObjects/update] use generic 404
spalger Sep 22, 2017
4353cd2
fix typos
spalger Sep 22, 2017
7381d0c
[savedObjects/update] add integration tests
spalger Sep 22, 2017
56842cf
remove debugging uncomment
spalger Sep 22, 2017
64e7bfb
[savedObjects/tests] move backup kibana index delete out of tests
spalger Sep 22, 2017
73df8dd
[savedObjects/tests/esArchives] remove logstash data
spalger Sep 22, 2017
ba595f8
[savedObjects] update test
spalger Sep 22, 2017
d80cf10
[uiSettings] remove detailed previously leaked from API
spalger Sep 22, 2017
a69a725
Merge branch 'master' of github.com:elastic/kibana into HEAD
spalger Sep 22, 2017
6445e5a
[server/savedObjects] take ownership of healthcheck and mappings
spalger Sep 21, 2017
bf74624
[savedObjects/healthCheck/ensureConfigExists] add integration test
spalger Sep 22, 2017
69adf0f
[savedObjects] remove healthCheck
spalger Sep 22, 2017
9dd6ece
[savedObjects] track isEsUsable state
spalger Sep 22, 2017
31021ec
[uiSettings] create or upgrade saved config reactivly
spalger Sep 22, 2017
4e35ad9
[uiSettings] no need for uiSettings status anymore
spalger Sep 22, 2017
43f4e0d
[savedObjects/esAvailability] refactor to contain rxjs
spalger Sep 22, 2017
9f7421f
[savedObjects/esAvailability] only check when es goes between green a…
spalger Sep 22, 2017
78c7631
[savedObjects/esAvailability] touchup some docs
spalger Sep 22, 2017
4f1f74c
[elasticsearch] waitUntilReady() is now based on plugin status
spalger Sep 22, 2017
f9f0f10
[savedObjects/esAvailability] add mergeMapLatest() to get custom thot…
spalger Sep 22, 2017
b1980c9
[savedObjects/esAvailablity] use mergeMapLatest for better throttling
spalger Sep 22, 2017
70a224e
[cli/serve/tests] disable plugin so startup is more predicatable
spalger Sep 22, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@
"rimraf": "2.4.3",
"rison-node": "1.0.0",
"rjs-repack-loader": "1.0.6",
"rxjs": "5.4.3",
"script-loader": "0.6.1",
"semver": "5.1.0",
"style-loader": "0.12.3",
Expand Down
1 change: 0 additions & 1 deletion src/cli/cluster/cluster_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export default class ClusterManager {
const serverArgv = [];
const optimizerArgv = [
'--plugins.initialize=false',
'--uiSettings.enabled=false',
'--server.autoListen=false',
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ logging:
json: true
optimize:
enabled: false
plugins:
initialize: false
2 changes: 1 addition & 1 deletion src/cli/serve/__tests__/reload_logging_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ describe(`Server logging configuration`, function () {
}

function switchToPlainTextLog() {
json = 3; // ignore both "reloading" messages + ui settings status message
json = 2; // ignore both "reloading" messages
setLoggingJson(false);
child.kill(`SIGHUP`); // reload logging config
}
Expand Down
9 changes: 7 additions & 2 deletions src/core_plugins/elasticsearch/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,14 @@ export default function (kibana) {
createProxy(server, 'POST', '/{index}/_search');
createProxy(server, 'POST', '/_msearch');

server.expose('waitUntilReady', () => {
return new Promise(resolve => {
this.status.once('green', resolve);
});
});

// Set up the health check service and start it.
const { start, waitUntilReady } = healthCheck(this, server);
server.expose('waitUntilReady', waitUntilReady);
const { start } = healthCheck(this, server);
start();
}
});
Expand Down
120 changes: 0 additions & 120 deletions src/core_plugins/elasticsearch/lib/__tests__/create_kibana_index.js

This file was deleted.

13 changes: 0 additions & 13 deletions src/core_plugins/elasticsearch/lib/__tests__/fixtures/mappings.js

This file was deleted.

68 changes: 0 additions & 68 deletions src/core_plugins/elasticsearch/lib/__tests__/health_check.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@ import expect from 'expect.js';

const NoConnections = require('elasticsearch').errors.NoConnections;

import mappings from './fixtures/mappings';
import healthCheck from '../health_check';
import kibanaVersion from '../kibana_version';
import { esTestConfig } from '../../../../test_utils/es';
import * as patchKibanaIndexNS from '../patch_kibana_index';
import * as migrateConfigNS from '../migrate_config';

const esPort = esTestConfig.getPort();
const esUrl = esTestConfig.getUrl();
Expand All @@ -33,8 +30,6 @@ describe('plugins/elasticsearch', () => {

// Stub the Kibana version instead of drawing from package.json.
sandbox.stub(kibanaVersion, 'get').returns(COMPATIBLE_VERSION_NUMBER);
sandbox.stub(patchKibanaIndexNS, 'patchKibanaIndex');
sandbox.stub(migrateConfigNS, 'migrateConfig');

// setup the plugin stub
plugin = {
Expand Down Expand Up @@ -80,9 +75,6 @@ describe('plugins/elasticsearch', () => {
getCluster: sinon.stub().returns(cluster)
}
},
getKibanaIndexMappingsDsl() {
return mappings;
},
ext: sinon.stub()
};

Expand Down Expand Up @@ -126,7 +118,6 @@ describe('plugins/elasticsearch', () => {

sinon.assert.calledOnce(cluster.callWithInternalUser.withArgs('ping'));
sinon.assert.calledTwice(cluster.callWithInternalUser.withArgs('nodes.info', sinon.match.any));
sinon.assert.calledOnce(cluster.callWithInternalUser.withArgs('cluster.health', sinon.match.any));
sinon.assert.notCalled(plugin.status.red);
sinon.assert.calledOnce(plugin.status.green);

Expand Down Expand Up @@ -155,68 +146,9 @@ describe('plugins/elasticsearch', () => {

sinon.assert.calledTwice(ping);
sinon.assert.calledTwice(cluster.callWithInternalUser.withArgs('nodes.info', sinon.match.any));
sinon.assert.calledOnce(cluster.callWithInternalUser.withArgs('cluster.health', sinon.match.any));
sinon.assert.calledOnce(plugin.status.green);
expect(plugin.status.green.args[0][0]).to.be('Kibana index ready');
});
});

it('should set the cluster red if the health check status is red, then to green', function () {
cluster.callWithInternalUser.withArgs('ping').returns(Promise.resolve());

const clusterHealth = cluster.callWithInternalUser.withArgs('cluster.health', sinon.match.any);
clusterHealth.onCall(0).returns(Promise.resolve({ timed_out: false, status: 'red' }));
clusterHealth.onCall(1).returns(Promise.resolve({ timed_out: false, status: 'green' }));

return health.run()
.then(function () {
sinon.assert.calledOnce(plugin.status.yellow);
expect(plugin.status.yellow.args[0][0]).to.be('Waiting for Elasticsearch');
sinon.assert.calledOnce(plugin.status.red);
expect(plugin.status.red.args[0][0]).to.be(
'Elasticsearch is still initializing the kibana index.'
);
sinon.assert.calledOnce(cluster.callWithInternalUser.withArgs('ping'));
sinon.assert.calledTwice(cluster.callWithInternalUser.withArgs('nodes.info', sinon.match.any));
sinon.assert.calledTwice(cluster.callWithInternalUser.withArgs('cluster.health', sinon.match.any));
sinon.assert.calledOnce(plugin.status.green);
expect(plugin.status.green.args[0][0]).to.be('Kibana index ready');
});
});

it('should set the cluster yellow if the health check timed_out and create index', function () {
cluster.callWithInternalUser.withArgs('ping').returns(Promise.resolve());

const clusterHealth = cluster.callWithInternalUser.withArgs('cluster.health', sinon.match.any);
clusterHealth.onCall(0).returns(Promise.resolve({ timed_out: true, status: 'red' }));
clusterHealth.onCall(1).returns(Promise.resolve({ timed_out: false, status: 'green' }));

cluster.callWithInternalUser.withArgs('indices.create', sinon.match.any).returns(Promise.resolve());

return health.run()
.then(function () {
sinon.assert.calledTwice(plugin.status.yellow);
expect(plugin.status.yellow.args[0][0]).to.be('Waiting for Elasticsearch');
expect(plugin.status.yellow.args[1][0]).to.be('No existing Kibana index found');

sinon.assert.calledOnce(cluster.callWithInternalUser.withArgs('ping'));
sinon.assert.calledOnce(cluster.callWithInternalUser.withArgs('indices.create', sinon.match.any));
sinon.assert.calledTwice(cluster.callWithInternalUser.withArgs('nodes.info', sinon.match.any));
sinon.assert.calledTwice(clusterHealth);
});
});

describe('#waitUntilReady', function () {
it('polls health until index is ready', function () {
const clusterHealth = cluster.callWithInternalUser.withArgs('cluster.health', sinon.match.any);
clusterHealth.onCall(0).returns(Promise.resolve({ timed_out: true }));
clusterHealth.onCall(1).returns(Promise.resolve({ status: 'red' }));
clusterHealth.onCall(2).returns(Promise.resolve({ status: 'green' }));

return health.waitUntilReady().then(function () {
sinon.assert.calledThrice(clusterHealth);
});
});
});
});
});
72 changes: 0 additions & 72 deletions src/core_plugins/elasticsearch/lib/__tests__/is_upgradeable.js

This file was deleted.

Loading