Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into ftr/set-browser-d…
Browse files Browse the repository at this point in the history
…ownload-folder
  • Loading branch information
dmlemeshko committed May 6, 2020
2 parents 754f2a5 + b71b139 commit a7bcdb7
Show file tree
Hide file tree
Showing 127 changed files with 3,077 additions and 1,906 deletions.
1 change: 1 addition & 0 deletions .backportrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"targetBranchChoices": [
{ "name": "master", "checked": true },
{ "name": "7.x", "checked": true },
"7.8",
"7.7",
"7.6",
"7.5",
Expand Down
16 changes: 16 additions & 0 deletions renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -771,6 +771,14 @@
'@types/podium',
],
},
{
groupSlug: 'pretty-ms',
groupName: 'pretty-ms related packages',
packageNames: [
'pretty-ms',
'@types/pretty-ms',
],
},
{
groupSlug: 'proper-lockfile',
groupName: 'proper-lockfile related packages',
Expand Down Expand Up @@ -864,6 +872,14 @@
'@types/sinon',
],
},
{
groupSlug: 'stats-lite',
groupName: 'stats-lite related packages',
packageNames: [
'stats-lite',
'@types/stats-lite',
],
},
{
groupSlug: 'storybook',
groupName: 'storybook related packages',
Expand Down
3 changes: 3 additions & 0 deletions src/core/MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -990,6 +990,9 @@ ls -lh plugins/my_plugin/target/public/
you might see at least one js bundle - `my_plugin.plugin.js`. This is the only artifact loaded by the platform during bootstrap in the browser. The rule of thumb is to keep its size as small as possible.
Other lazily loaded parts of your plugin present in the same folder as separate chunks under `{number}.plugin.js` names.
If you want to investigate what your plugin bundle consists of you need to run `@kbn/optimizer` with `--profile` flag to get generated [webpack stats file](https://webpack.js.org/api/stats/).
```bash
node scripts/build_kibana_platform_plugins.js --dist --no-examples --profile
```
Many OSS tools are allowing you to analyze generated stats file
- [an official tool](http://webpack.github.io/analyse/#modules) from webpack authors
- [webpack-visualizer](https://chrisbateman.github.io/webpack-visualizer/)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,18 +185,22 @@ describe('ServerMetricsCollector', () => {
let metrics = await collector.collect();
expect(metrics.concurrent_connections).toEqual(0);

sendGet('/').end(() => null);
// supertest requests are executed when calling `.then` (or awaiting them).
// however in this test we need to send the request now and await for it later in the code.
// also using `.end` is not possible as it would execute the request twice.
// so the only option is this noop `.then`.
const res1 = sendGet('/').then(res => res);
await waitForHits(1);
metrics = await collector.collect();
expect(metrics.concurrent_connections).toEqual(1);

sendGet('/').end(() => null);
const res2 = sendGet('/').then(res => res);
await waitForHits(2);
metrics = await collector.collect();
expect(metrics.concurrent_connections).toEqual(2);

waitSubject.next('go');
await delay(requestWaitDelay);
await Promise.all([res1, res2]);
metrics = await collector.collect();
expect(metrics.concurrent_connections).toEqual(0);
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
@import 'directives/index';
@import 'doc_table/index';
@import 'context/index';
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* 1. Stack content vertically so the table can scroll when its constrained by a fixed container height.
*/
doc-table {
@include euiScrollBar;
overflow: auto;
flex: 1 1 100%;
flex-direction: column; /* 1 */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { dispatchRenderComplete } from '../../../../../kibana_utils/public';
// @ts-ignore
import { getLimitedSearchResultsMessage } from './doc_table_strings';
import { getServices } from '../../../kibana_services';
import './index.scss';

export interface LazyScope extends ng.IScope {
[key: string]: any;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
@import '../../mixins';

@import 'doc_table';
@import 'components/index';

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import './doc_viewer.scss';
import React from 'react';
import { EuiTabbedContent } from '@elastic/eui';
import { getDocViewsRegistry } from '../../../kibana_services';
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import './fetch_error.scss';
import React, { Fragment } from 'react';
import { FormattedMessage, I18nProvider } from '@kbn/i18n/react';
import { EuiFlexGroup, EuiFlexItem, EuiCallOut, EuiCodeBlock, EuiSpacer } from '@elastic/eui';
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import './discover_sidebar.scss';
import React, { useCallback, useEffect, useState, useMemo } from 'react';
import { i18n } from '@kbn/i18n';
import { EuiButtonIcon, EuiTitle } from '@elastic/eui';
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import './search_embeddable.scss';
import angular from 'angular';
import _ from 'lodash';
import * as Rx from 'rxjs';
Expand Down
2 changes: 0 additions & 2 deletions src/plugins/discover/public/application/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,4 @@
// monChart__legend--small
// monChart__legend-isLoading

@import 'components/index';
@import 'angular/index';
@import 'embeddable/index';
Original file line number Diff line number Diff line change
Expand Up @@ -340,13 +340,14 @@ export class VisualizeEmbeddable extends Embeddable<VisualizeInput, VisualizeOut
this.abortController.abort();
}
this.abortController = new AbortController();
const abortController = this.abortController;
this.expression = await buildPipeline(this.vis, {
timefilter: this.timefilter,
timeRange: this.timeRange,
abortSignal: this.abortController!.signal,
});

if (this.handler) {
if (this.handler && !abortController.signal.aborted) {
this.handler.update(this.expression, expressionParams);
}
}
Expand Down
1 change: 1 addition & 0 deletions test/functional/apps/visualize/_tsvb_chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export default function({ getService, getPageObjects }: FtrProviderContext) {
const PageObjects = getPageObjects(['visualize', 'visualBuilder', 'timePicker', 'visChart']);

describe('visual builder', function describeIndexTests() {
this.tags('includeFirefox');
beforeEach(async () => {
await security.testUser.setRoles(['kibana_admin', 'test_logstash_reader']);
await PageObjects.visualize.navigateToNewVisualization();
Expand Down
2 changes: 2 additions & 0 deletions test/scripts/jenkins_xpack_build_kibana.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ echo " -> building kibana platform plugins"
node scripts/build_kibana_platform_plugins \
--scan-dir "$XPACK_DIR/test/plugin_functional/plugins" \
--scan-dir "$XPACK_DIR/test/functional_with_es_ssl/fixtures/plugins" \
--scan-dir "$XPACK_DIR/test/alerting_api_integration/plugins" \
--scan-dir "$XPACK_DIR/test/plugin_api_integration/plugins" \
--scan-dir "$XPACK_DIR/test/plugin_api_perf/plugins" \
--verbose;

# doesn't persist, also set in kibanaPipeline.groovy
Expand Down
2 changes: 0 additions & 2 deletions x-pack/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { dashboardMode } from './legacy/plugins/dashboard_mode';
import { beats } from './legacy/plugins/beats_management';
import { maps } from './legacy/plugins/maps';
import { spaces } from './legacy/plugins/spaces';
import { taskManager } from './legacy/plugins/task_manager';
import { encryptedSavedObjects } from './legacy/plugins/encrypted_saved_objects';
import { ingestManager } from './legacy/plugins/ingest_manager';

Expand All @@ -26,7 +25,6 @@ module.exports = function(kibana) {
dashboardMode(kibana),
beats(kibana),
maps(kibana),
taskManager(kibana),
encryptedSavedObjects(kibana),
ingestManager(kibana),
];
Expand Down
66 changes: 0 additions & 66 deletions x-pack/legacy/plugins/task_manager/server/index.ts

This file was deleted.

58 changes: 0 additions & 58 deletions x-pack/legacy/plugins/task_manager/server/legacy.ts

This file was deleted.

2 changes: 2 additions & 0 deletions x-pack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@
"@types/uuid": "^3.4.4",
"@types/xml-crypto": "^1.4.0",
"@types/xml2js": "^0.4.5",
"@types/stats-lite": "^2.2.0",
"@types/pretty-ms": "^5.0.0",
"@welldone-software/why-did-you-render": "^4.0.0",
"abab": "^1.0.4",
"axios": "^0.19.0",
Expand Down
13 changes: 13 additions & 0 deletions x-pack/plugins/actions/server/action_type_registry.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,19 @@ describe('register()', () => {
`);
});

test('shallow clones the given action type', () => {
const myType: ActionType = {
id: 'my-action-type',
name: 'My action type',
minimumLicenseRequired: 'basic',
executor,
};
const actionTypeRegistry = new ActionTypeRegistry(actionTypeRegistryParams);
actionTypeRegistry.register(myType);
myType.name = 'Changed';
expect(actionTypeRegistry.get('my-action-type').name).toEqual('My action type');
});

test('throws error if action type already registered', () => {
const actionTypeRegistry = new ActionTypeRegistry(actionTypeRegistryParams);
actionTypeRegistry.register({
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/actions/server/action_type_registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export class ActionTypeRegistry {
)
);
}
this.actionTypes.set(actionType.id, actionType);
this.actionTypes.set(actionType.id, { ...actionType });
this.taskManager.registerTaskDefinitions({
[`actions:${actionType.id}`]: {
title: actionType.name,
Expand Down
14 changes: 7 additions & 7 deletions x-pack/plugins/actions/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,15 +177,15 @@ export class ActionsPlugin implements Plugin<Promise<PluginSetupContract>, Plugi

const usageCollection = plugins.usageCollection;
if (usageCollection) {
initializeActionsTelemetry(
this.telemetryLogger,
plugins.taskManager,
core,
await this.kibanaIndex
);

core.getStartServices().then(async ([, startPlugins]) => {
registerActionsUsageCollector(usageCollection, startPlugins.taskManager);

initializeActionsTelemetry(
this.telemetryLogger,
plugins.taskManager,
core,
await this.kibanaIndex
);
});
}

Expand Down
Loading

0 comments on commit a7bcdb7

Please sign in to comment.