Skip to content

Commit bb64a7f

Browse files
committed
Merge remote-tracking branch 'upstream/master' into kbn-74911-remove-legacy-mode
2 parents 8c812f7 + 1e20cd4 commit bb64a7f

File tree

251 files changed

+4806
-2665
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

251 files changed

+4806
-2665
lines changed

.eslintrc.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -296,10 +296,7 @@ module.exports = {
296296
errorMessage: `Plugins may only import from src/core/server and src/core/public.`,
297297
},
298298
{
299-
target: [
300-
'(src|x-pack)/plugins/*/server/**/*',
301-
'!x-pack/plugins/apm/**/*', // https://github.com/elastic/kibana/issues/67210
302-
],
299+
target: ['(src|x-pack)/plugins/*/server/**/*'],
303300
from: ['(src|x-pack)/plugins/*/public/**/*'],
304301
errorMessage: `Server code can not import from public, use a common directory.`,
305302
},

docs/developer/getting-started/index.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ you can switch to the correct version when using nvm by running:
3030
nvm use
3131
----
3232

33-
Install the latest version of https://yarnpkg.com[yarn].
33+
Install the latest version of https://classic.yarnpkg.com/en/docs/install[yarn v1].
3434

3535
Bootstrap {kib} and install all the dependencies:
3636

docs/developer/plugin/external-plugin-functional-tests.asciidoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ To get started copy and paste this example to `test/functional/config.js`:
1313
["source","js"]
1414
-----------
1515
import { resolve } from 'path';
16-
import { resolveKibanaPath } from '@kbn/plugin-helpers';
16+
import { REPO_ROOT } from '@kbn/dev-utils';
1717
1818
import { MyServiceProvider } from './services/my_service';
1919
import { MyAppPageProvider } from './services/my_app_page';
@@ -24,7 +24,7 @@ export default async function ({ readConfigFile }) {
2424
2525
// read the {kib} config file so that we can utilize some of
2626
// its services and PageObjects
27-
const kibanaConfig = await readConfigFile(resolveKibanaPath('test/functional/config.js'));
27+
const kibanaConfig = await readConfigFile(resolve(REPO_ROOT, 'test/functional/config.js'));
2828
2929
return {
3030
// list paths to the files that contain your plugins tests
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) &gt; [ACTION\_GLOBAL\_APPLY\_FILTER](./kibana-plugin-plugins-data-public.action_global_apply_filter.md)
4+
5+
## ACTION\_GLOBAL\_APPLY\_FILTER variable
6+
7+
<b>Signature:</b>
8+
9+
```typescript
10+
ACTION_GLOBAL_APPLY_FILTER = "ACTION_GLOBAL_APPLY_FILTER"
11+
```

docs/development/plugins/data/public/kibana-plugin-plugins-data-public.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989

9090
| Variable | Description |
9191
| --- | --- |
92+
| [ACTION\_GLOBAL\_APPLY\_FILTER](./kibana-plugin-plugins-data-public.action_global_apply_filter.md) | |
9293
| [AggGroupLabels](./kibana-plugin-plugins-data-public.agggrouplabels.md) | |
9394
| [AggGroupNames](./kibana-plugin-plugins-data-public.agggroupnames.md) | |
9495
| [baseFormattersPublic](./kibana-plugin-plugins-data-public.baseformatterspublic.md) | |

docs/settings/monitoring-settings.asciidoc

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
<titleabbrev>Monitoring settings</titleabbrev>
66
++++
77

8-
By default, the Monitoring application is enabled, but data collection
9-
is disabled. When you first start {kib} monitoring, you are prompted to
10-
enable data collection. If you are using {stack-security-features}, you must be
11-
signed in as a user with the `cluster:manage` privilege to enable
12-
data collection. The built-in `superuser` role has this privilege and the
13-
built-in `elastic` user has this role.
8+
By default, *{stack-monitor-app}* is enabled, but data collection is disabled.
9+
When you first start {kib} monitoring, you are prompted to enable data
10+
collection. If you are using {stack-security-features}, you must be signed in as
11+
a user with the `cluster:manage` privilege to enable data collection. The
12+
built-in `superuser` role has this privilege and the built-in `elastic` user has
13+
this role.
1414

1515
You can adjust how monitoring data is
1616
collected from {kib} and displayed in {kib} by configuring settings in the
@@ -49,7 +49,7 @@ For more information, see
4949
in {kib} to the {es} monitoring cluster and to verify licensing status on the {es}
5050
monitoring cluster. +
5151
+
52-
Every other request performed by the Stack Monitoring UI to the monitoring {es}
52+
Every other request performed by *{stack-monitor-app}* to the monitoring {es}
5353
cluster uses the authenticated user's credentials, which must be the same on
5454
both the {es} monitoring cluster and the {es} production cluster. +
5555
+
@@ -60,7 +60,7 @@ For more information, see
6060
in {kib} to the {es} monitoring cluster and to verify licensing status on the {es}
6161
monitoring cluster. +
6262
+
63-
Every other request performed by the Stack Monitoring UI to the monitoring {es}
63+
Every other request performed by *{stack-monitor-app}* to the monitoring {es}
6464
cluster uses the authenticated user's credentials, which must be the same on
6565
both the {es} monitoring cluster and the {es} production cluster. +
6666
+
@@ -83,7 +83,7 @@ These settings control how data is collected from {kib}.
8383
|===
8484
| `monitoring.kibana.collection.enabled`
8585
| Set to `true` (default) to enable data collection from the {kib} NodeJS server
86-
for {kib} Dashboards to be featured in the Monitoring.
86+
for {kib} dashboards to be featured in *{stack-monitor-app}*.
8787

8888
| `monitoring.kibana.collection.interval`
8989
| Specifies the number of milliseconds to wait in between data sampling on the
@@ -96,16 +96,26 @@ These settings control how data is collected from {kib}.
9696
[[monitoring-ui-settings]]
9797
==== Monitoring UI settings
9898

99-
These settings adjust how the {kib} Monitoring page displays monitoring data.
99+
These settings adjust how *{stack-monitor-app}* displays monitoring data.
100100
However, the defaults work best in most circumstances. For more information
101101
about configuring {kib}, see
102-
{kibana-ref}/settings.html[Setting Kibana Server Properties].
102+
{kibana-ref}/settings.html[Setting {kib} server properties].
103103

104104
[cols="2*<"]
105105
|===
106106
| `monitoring.ui.elasticsearch.logFetchCount`
107-
| Specifies the number of log entries to display in the Monitoring UI. Defaults to
108-
`10`. The maximum value is `50`.
107+
| Specifies the number of log entries to display in *{stack-monitor-app}*.
108+
Defaults to `10`. The maximum value is `50`.
109+
110+
| `monitoring.ui.enabled`
111+
| Set to `false` to hide *{stack-monitor-app}*. The monitoring back-end
112+
continues to run as an agent for sending {kib} stats to the monitoring
113+
cluster. Defaults to `true`.
114+
115+
| `monitoring.ui.logs.index`
116+
| Specifies the name of the indices that are shown on the
117+
<<logs-monitor-page,*Logs*>> page in *{stack-monitor-app}*. The default value
118+
is `filebeat-*`.
109119

110120
| `monitoring.ui.max_bucket_size`
111121
| Specifies the number of term buckets to return out of the overall terms list when
@@ -120,18 +130,13 @@ about configuring {kib}, see
120130
`monitoring.ui.collection.interval` in `elasticsearch.yml`, use the same
121131
value in this setting.
122132

123-
| `monitoring.ui.enabled`
124-
| Set to `false` to hide the Monitoring UI in {kib}. The monitoring back-end
125-
continues to run as an agent for sending {kib} stats to the monitoring
126-
cluster. Defaults to `true`.
127-
128133
|===
129134

130135
[float]
131136
[[monitoring-ui-cgroup-settings]]
132137
===== Monitoring UI container settings
133138

134-
The Monitoring UI exposes the Cgroup statistics that we collect for you to make
139+
*{stack-monitor-app}* exposes the Cgroup statistics that we collect for you to make
135140
better decisions about your container performance, rather than guessing based on
136141
the overall machine performance. If you are not running your applications in a
137142
container, then Cgroup statistics are not useful.
Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,38 @@
11
{
22
"name": "@kbn/dev-utils",
3-
"main": "./target/index.js",
43
"version": "1.0.0",
5-
"license": "Apache-2.0",
64
"private": true,
5+
"license": "Apache-2.0",
6+
"main": "./target/index.js",
77
"scripts": {
88
"build": "tsc",
99
"kbn:bootstrap": "yarn build",
1010
"kbn:watch": "yarn build --watch"
1111
},
1212
"dependencies": {
13+
"@babel/core": "^7.11.1",
1314
"axios": "^0.19.0",
1415
"chalk": "^4.1.0",
16+
"cheerio": "0.22.0",
1517
"dedent": "^0.7.0",
1618
"execa": "^4.0.2",
1719
"exit-hook": "^2.2.0",
1820
"getopts": "^2.2.5",
21+
"globby": "^8.0.1",
1922
"load-json-file": "^6.2.0",
20-
"normalize-path": "^3.0.0",
23+
"markdown-it": "^10.0.0",
2124
"moment": "^2.24.0",
25+
"normalize-path": "^3.0.0",
2226
"rxjs": "^6.5.5",
2327
"strip-ansi": "^6.0.0",
2428
"tree-kill": "^1.2.2",
25-
"tslib": "^2.0.0"
29+
"vinyl": "^2.2.0"
2630
},
2731
"devDependencies": {
28-
"typescript": "4.0.2",
32+
"@kbn/babel-preset": "1.0.0",
2933
"@kbn/expect": "1.0.0",
30-
"chance": "1.0.18"
34+
"@types/vinyl": "^2.0.4",
35+
"chance": "1.0.18",
36+
"typescript": "4.0.2"
3137
}
3238
}
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
import File from 'vinyl';
21+
import * as Babel from '@babel/core';
22+
23+
const transformedFiles = new WeakSet<File>();
24+
25+
/**
26+
* Returns a promise that resolves when the file has been
27+
* mutated so the contents of the file are tranformed with
28+
* babel, include inline sourcemaps, and the filename has
29+
* been updated to use .js.
30+
*
31+
* If the file was previously transformed with this function
32+
* the promise will just resolve immediately.
33+
*/
34+
export async function transformFileWithBabel(file: File) {
35+
if (!(file.contents instanceof Buffer)) {
36+
throw new Error('file must be buffered');
37+
}
38+
39+
if (transformedFiles.has(file)) {
40+
return;
41+
}
42+
43+
const source = file.contents.toString('utf8');
44+
const result = await Babel.transformAsync(source, {
45+
babelrc: false,
46+
configFile: false,
47+
sourceMaps: 'inline',
48+
filename: file.path,
49+
presets: [require.resolve('@kbn/babel-preset/node_preset')],
50+
});
51+
52+
if (!result || typeof result.code !== 'string') {
53+
throw new Error('babel transformation failed without an error...');
54+
}
55+
56+
file.contents = Buffer.from(result.code);
57+
file.extname = '.js';
58+
transformedFiles.add(file);
59+
}

packages/kbn-dev-utils/src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,6 @@ export * from './stdio';
4141
export * from './ci_stats_reporter';
4242
export * from './plugin_list';
4343
export * from './simple_kibana_platform_plugin_discovery';
44+
export * from './streams';
45+
export * from './babel';
46+
export * from './parse_kibana_platform_plugin';
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
import Path from 'path';
21+
import loadJsonFile from 'load-json-file';
22+
23+
export interface KibanaPlatformPlugin {
24+
readonly directory: string;
25+
readonly manifestPath: string;
26+
readonly manifest: {
27+
id: string;
28+
ui: boolean;
29+
server: boolean;
30+
[key: string]: unknown;
31+
};
32+
}
33+
34+
export function parseKibanaPlatformPlugin(manifestPath: string): KibanaPlatformPlugin {
35+
if (!Path.isAbsolute(manifestPath)) {
36+
throw new TypeError('expected new platform manifest path to be absolute');
37+
}
38+
39+
const manifest = loadJsonFile.sync(manifestPath);
40+
if (!manifest || typeof manifest !== 'object' || Array.isArray(manifest)) {
41+
throw new TypeError('expected new platform plugin manifest to be a JSON encoded object');
42+
}
43+
44+
if (typeof manifest.id !== 'string') {
45+
throw new TypeError('expected new platform plugin manifest to have a string id');
46+
}
47+
48+
return {
49+
directory: Path.dirname(manifestPath),
50+
manifestPath,
51+
manifest: {
52+
...manifest,
53+
54+
ui: !!manifest.ui,
55+
server: !!manifest.server,
56+
id: manifest.id,
57+
},
58+
};
59+
}

0 commit comments

Comments
 (0)