Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into task/fleet-82492-…
Browse files Browse the repository at this point in the history
…integration-custom-tab
  • Loading branch information
paul-tavares committed Nov 24, 2020
2 parents b29029a + 1159169 commit 4b31a39
Show file tree
Hide file tree
Showing 143 changed files with 4,569 additions and 955 deletions.
5 changes: 2 additions & 3 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,8 @@
#CC# /src/plugins/maps_oss/ @elastic/kibana-gis
#CC# /x-pack/plugins/file_upload @elastic/kibana-gis
#CC# /x-pack/plugins/maps_legacy_licensing @elastic/kibana-gis
#CC# /src/plugins/home/server/tutorials @elastic/kibana-gis
#CC# /src/plugins/tile_map/ @elastic/kibana-gis
#CC# /src/plugins/region_map/ @elastic/kibana-gis
/src/plugins/tile_map/ @elastic/kibana-gis
/src/plugins/region_map/ @elastic/kibana-gis

# Operations
/src/dev/ @elastic/kibana-operations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ migration is complete:
----
import { schema } from '@kbn/config-schema';
import { CoreSetup } from 'kibana/server';
import Boom from 'boom';
import Boom from '@hapi/boom';
export class DemoPlugin {
public setup(core: CoreSetup) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ search: {
siblingPipelineType: string;
termsAggFilter: string[];
toAbsoluteDates: typeof toAbsoluteDates;
calcAutoIntervalLessThan: typeof calcAutoIntervalLessThan;
};
getRequestInspectorStats: typeof getRequestInspectorStats;
getResponseInspectorStats: typeof getResponseInspectorStats;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ Constructs a new instance of the `ExpressionRenderHandler` class
<b>Signature:</b>

```typescript
constructor(element: HTMLElement, { onRenderError }?: Partial<ExpressionRenderHandlerParams>);
constructor(element: HTMLElement, { onRenderError, renderMode }?: Partial<ExpressionRenderHandlerParams>);
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| element | <code>HTMLElement</code> | |
| { onRenderError } | <code>Partial&lt;ExpressionRenderHandlerParams&gt;</code> | |
| { onRenderError, renderMode } | <code>Partial&lt;ExpressionRenderHandlerParams&gt;</code> | |

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export declare class ExpressionRenderHandler

| Constructor | Modifiers | Description |
| --- | --- | --- |
| [(constructor)(element, { onRenderError })](./kibana-plugin-plugins-expressions-public.expressionrenderhandler._constructor_.md) | | Constructs a new instance of the <code>ExpressionRenderHandler</code> class |
| [(constructor)(element, { onRenderError, renderMode })](./kibana-plugin-plugins-expressions-public.expressionrenderhandler._constructor_.md) | | Constructs a new instance of the <code>ExpressionRenderHandler</code> class |

## Properties

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export interface IExpressionLoaderParams
| [disableCaching](./kibana-plugin-plugins-expressions-public.iexpressionloaderparams.disablecaching.md) | <code>boolean</code> | |
| [inspectorAdapters](./kibana-plugin-plugins-expressions-public.iexpressionloaderparams.inspectoradapters.md) | <code>Adapters</code> | |
| [onRenderError](./kibana-plugin-plugins-expressions-public.iexpressionloaderparams.onrendererror.md) | <code>RenderErrorHandlerFnType</code> | |
| [renderMode](./kibana-plugin-plugins-expressions-public.iexpressionloaderparams.rendermode.md) | <code>RenderMode</code> | |
| [searchContext](./kibana-plugin-plugins-expressions-public.iexpressionloaderparams.searchcontext.md) | <code>SerializableState</code> | |
| [searchSessionId](./kibana-plugin-plugins-expressions-public.iexpressionloaderparams.searchsessionid.md) | <code>string</code> | |
| [uiState](./kibana-plugin-plugins-expressions-public.iexpressionloaderparams.uistate.md) | <code>unknown</code> | |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-expressions-public](./kibana-plugin-plugins-expressions-public.md) &gt; [IExpressionLoaderParams](./kibana-plugin-plugins-expressions-public.iexpressionloaderparams.md) &gt; [renderMode](./kibana-plugin-plugins-expressions-public.iexpressionloaderparams.rendermode.md)

## IExpressionLoaderParams.renderMode property

<b>Signature:</b>

```typescript
renderMode?: RenderMode;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-expressions-public](./kibana-plugin-plugins-expressions-public.md) &gt; [IInterpreterRenderHandlers](./kibana-plugin-plugins-expressions-public.iinterpreterrenderhandlers.md) &gt; [getRenderMode](./kibana-plugin-plugins-expressions-public.iinterpreterrenderhandlers.getrendermode.md)

## IInterpreterRenderHandlers.getRenderMode property

<b>Signature:</b>

```typescript
getRenderMode: () => RenderMode;
```
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export interface IInterpreterRenderHandlers
| --- | --- | --- |
| [done](./kibana-plugin-plugins-expressions-public.iinterpreterrenderhandlers.done.md) | <code>() =&gt; void</code> | Done increments the number of rendering successes |
| [event](./kibana-plugin-plugins-expressions-public.iinterpreterrenderhandlers.event.md) | <code>(event: any) =&gt; void</code> | |
| [getRenderMode](./kibana-plugin-plugins-expressions-public.iinterpreterrenderhandlers.getrendermode.md) | <code>() =&gt; RenderMode</code> | |
| [onDestroy](./kibana-plugin-plugins-expressions-public.iinterpreterrenderhandlers.ondestroy.md) | <code>(fn: () =&gt; void) =&gt; void</code> | |
| [reload](./kibana-plugin-plugins-expressions-public.iinterpreterrenderhandlers.reload.md) | <code>() =&gt; void</code> | |
| [uiState](./kibana-plugin-plugins-expressions-public.iinterpreterrenderhandlers.uistate.md) | <code>PersistedState</code> | |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-expressions-server](./kibana-plugin-plugins-expressions-server.md) &gt; [IInterpreterRenderHandlers](./kibana-plugin-plugins-expressions-server.iinterpreterrenderhandlers.md) &gt; [getRenderMode](./kibana-plugin-plugins-expressions-server.iinterpreterrenderhandlers.getrendermode.md)

## IInterpreterRenderHandlers.getRenderMode property

<b>Signature:</b>

```typescript
getRenderMode: () => RenderMode;
```
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export interface IInterpreterRenderHandlers
| --- | --- | --- |
| [done](./kibana-plugin-plugins-expressions-server.iinterpreterrenderhandlers.done.md) | <code>() =&gt; void</code> | Done increments the number of rendering successes |
| [event](./kibana-plugin-plugins-expressions-server.iinterpreterrenderhandlers.event.md) | <code>(event: any) =&gt; void</code> | |
| [getRenderMode](./kibana-plugin-plugins-expressions-server.iinterpreterrenderhandlers.getrendermode.md) | <code>() =&gt; RenderMode</code> | |
| [onDestroy](./kibana-plugin-plugins-expressions-server.iinterpreterrenderhandlers.ondestroy.md) | <code>(fn: () =&gt; void) =&gt; void</code> | |
| [reload](./kibana-plugin-plugins-expressions-server.iinterpreterrenderhandlers.reload.md) | <code>() =&gt; void</code> | |
| [uiState](./kibana-plugin-plugins-expressions-server.iinterpreterrenderhandlers.uistate.md) | <code>PersistedState</code> | |
Expand Down
6 changes: 4 additions & 2 deletions docs/setup/settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,12 @@ Please use the `defaultRoute` advanced setting instead.
The default application to load. *Default: `"home"`*

|[[kibana-index]] `kibana.index:`
| {kib} uses an index in {es} to store saved searches, visualizations, and
| *deprecated* This setting is deprecated and will be removed in 8.0. Multitenancy by changing
`kibana.index` will not be supported starting in 8.0. See https://ela.st/kbn-remove-legacy-multitenancy[8.0 Breaking Changes]
for more details. {kib} uses an index in {es} to store saved searches, visualizations, and
dashboards. {kib} creates a new index if the index doesn’t already exist.
If you configure a custom index, the name must be lowercase, and conform to the
{es} {ref}/indices-create-index.html[index name limitations].
{es} {ref}/indices-create-index.html[index name limitations].
*Default: `".kibana"`*

| `kibana.autocompleteTimeout:` {ess-icon}
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,6 @@
"pdfmake": "^0.1.65",
"pegjs": "0.10.0",
"pngjs": "^3.4.0",
"podium": "^3.1.2",
"prop-types": "^15.7.2",
"proper-lockfile": "^3.2.0",
"proxy-from-env": "1.0.0",
Expand Down Expand Up @@ -654,7 +653,7 @@
"file-loader": "^4.2.0",
"file-saver": "^1.3.8",
"formsy-react": "^1.1.5",
"geckodriver": "^1.20.0",
"geckodriver": "^1.21.0",
"glob-watcher": "5.0.3",
"graphql-code-generator": "^0.18.2",
"graphql-codegen-add": "^0.18.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-legacy-logging/src/legacy_logging_server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import { ServerExtType, Server } from '@hapi/hapi';
import Podium from 'podium';
import Podium from '@hapi/podium';
import { setupLogging } from './setup_logging';
import { attachMetaData } from './metadata';
import { legacyLoggingConfigSchema } from './schema';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,10 @@ it('uses cache on second run and exist cleanly', async () => {
});

it('prepares assets for distribution', async () => {
if (process.env.CODE_COVERAGE) {
// test fails when testing coverage because source includes instrumentation, so skip it
return;
}
const config = OptimizerConfig.create({
repoRoot: MOCK_REPO_DIR,
pluginScanDirs: [Path.resolve(MOCK_REPO_DIR, 'plugins'), Path.resolve(MOCK_REPO_DIR, 'x-pack')],
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "Apache-2.0",
"private": true,
"scripts": {
"build": "../../node_modules/.bin/tsc",
"build": "rm -rf target && ../../node_modules/.bin/tsc",
"kbn:bootstrap": "yarn build",
"kbn:watch": "yarn build --watch"
},
Expand Down
66 changes: 66 additions & 0 deletions src/core/server/kibana_config.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
import { config } from './kibana_config';
import { applyDeprecations, configDeprecationFactory } from '@kbn/config';

const CONFIG_PATH = 'kibana';

const applyKibanaDeprecations = (settings: Record<string, any> = {}) => {
const deprecations = config.deprecations!(configDeprecationFactory);
const deprecationMessages: string[] = [];
const _config: any = {};
_config[CONFIG_PATH] = settings;
const migrated = applyDeprecations(
_config,
deprecations.map((deprecation) => ({
deprecation,
path: CONFIG_PATH,
})),
(msg) => deprecationMessages.push(msg)
);
return {
messages: deprecationMessages,
migrated,
};
};

it('set correct defaults ', () => {
const configValue = config.schema.validate({});
expect(configValue).toMatchInlineSnapshot(`
Object {
"autocompleteTerminateAfter": "PT1M40S",
"autocompleteTimeout": "PT1S",
"enabled": true,
"index": ".kibana",
}
`);
});

describe('deprecations', () => {
['.foo', '.kibana'].forEach((index) => {
it('logs a warning if index is set', () => {
const { messages } = applyKibanaDeprecations({ index });
expect(messages).toMatchInlineSnapshot(`
Array [
"\\"kibana.index\\" is deprecated. Multitenancy by changing \\"kibana.index\\" will not be supported starting in 8.0. See https://ela.st/kbn-remove-legacy-multitenancy for more details",
]
`);
});
});
});
14 changes: 14 additions & 0 deletions src/core/server/kibana_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,22 @@
*/

import { schema, TypeOf } from '@kbn/config-schema';
import { ConfigDeprecationProvider } from '@kbn/config';

export type KibanaConfigType = TypeOf<typeof config.schema>;

const deprecations: ConfigDeprecationProvider = () => [
(settings, fromPath, log) => {
const kibana = settings[fromPath];
if (kibana?.index) {
log(
`"kibana.index" is deprecated. Multitenancy by changing "kibana.index" will not be supported starting in 8.0. See https://ela.st/kbn-remove-legacy-multitenancy for more details`
);
}
return settings;
},
];

export const config = {
path: 'kibana',
schema: schema.object({
Expand All @@ -29,4 +42,5 @@ export const config = {
autocompleteTerminateAfter: schema.duration({ defaultValue: 100000 }),
autocompleteTimeout: schema.duration({ defaultValue: 1000 }),
}),
deprecations,
};
23 changes: 19 additions & 4 deletions src/dev/build/tasks/patch_native_modules_task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,30 @@ const packages: Package[] = [
destinationPath: 'node_modules/re2/build/Release/re2.node',
extractMethod: 'gunzip',
archives: {
darwin: {
'darwin-x64': {
url: 'https://github.com/uhop/node-re2/releases/download/1.15.4/darwin-x64-72.gz',
sha256: '983106049bb86e21b7f823144b2b83e3f1408217401879b3cde0312c803512c9',
},
linux: {
'linux-x64': {
url: 'https://github.com/uhop/node-re2/releases/download/1.15.4/linux-x64-72.gz',
sha256: '8b6692037f7b0df24dabc9c9b039038d1c3a3110f62121616b406c482169710a',
},
win32: {

// ARM build is currently done manually as Github Actions used in upstream project
// do not natively support an ARM target.

// From a AWS Graviton instance:
// * checkout the node-re2 project,
// * install Node using the same minor used by Kibana
// * npm install, which will also create a build
// * gzip -c build/Release/re2.node > linux-arm64-72.gz
// * upload to kibana-ci-proxy-cache bucket
'linux-arm64': {
url:
'https://storage.googleapis.com/kibana-ci-proxy-cache/node-re2/uhop/node-re2/releases/download/1.15.4/linux-arm64-72.gz',
sha256: '5942353ec9cf46a39199818d474f7af137cfbb1bc5727047fe22f31f36602a7e',
},
'win32-x64': {
url: 'https://github.com/uhop/node-re2/releases/download/1.15.4/win32-x64-72.gz',
sha256: '0a6991e693577160c3e9a3f196bd2518368c52d920af331a1a183313e0175604',
},
Expand Down Expand Up @@ -84,7 +99,7 @@ async function patchModule(
`Can't patch ${pkg.name}'s native module, we were expecting version ${pkg.version} and found ${installedVersion}`
);
}
const platformName = platform.getName();
const platformName = platform.getNodeArch();
const archive = pkg.archives[platformName];
const archiveName = path.basename(archive.url);
const downloadPath = config.resolveFromRepo(DOWNLOAD_DIRECTORY, pkg.name, archiveName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ PWD=$(pwd)
du -sh $COMBINED_EXRACT_DIR

echo "### Jest: replacing path in json files"
for i in coverage-final xpack-coverage-final; do
sed -i "s|/dev/shm/workspace/kibana|${PWD}|g" $COMBINED_EXRACT_DIR/jest/${i}.json &
for i in oss oss-integration xpack; do
sed -i "s|/dev/shm/workspace/kibana|${PWD}|g" $COMBINED_EXRACT_DIR/jest/${i}-coverage-final.json &
done
wait

Expand Down
1 change: 1 addition & 0 deletions src/plugins/data/common/search/aggs/buckets/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ export * from './lib/ip_range';
export * from './migrate_include_exclude_format';
export * from './significant_terms';
export * from './terms';
export * from './lib/time_buckets/calc_auto_interval';
2 changes: 2 additions & 0 deletions src/plugins/data/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ import {
includeTotalLoaded,
toKibanaSearchResponse,
getTotalLoaded,
calcAutoIntervalLessThan,
} from '../common';

export {
Expand Down Expand Up @@ -282,6 +283,7 @@ export const search = {
siblingPipelineType,
termsAggFilter,
toAbsoluteDates,
calcAutoIntervalLessThan,
},
getRequestInspectorStats,
getResponseInspectorStats,
Expand Down
Loading

0 comments on commit 4b31a39

Please sign in to comment.