Skip to content

Commit 4264930

Browse files
Merge branch 'master' into 56427-metric-alert-type
2 parents 58b6489 + 2623976 commit 4264930

File tree

1,079 files changed

+18239
-12986
lines changed

Some content is hidden

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

1,079 files changed

+18239
-12986
lines changed

.ci/Jenkinsfile_coverage

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,7 @@ stage("Kibana Pipeline") { // This stage is just here to help the BlueOcean UI a
1313
]) {
1414
parallel([
1515
'kibana-intake-agent': {
16-
withEnv([
17-
'NODE_ENV=test' // Needed for jest tests only
18-
]) {
19-
kibanaPipeline.intakeWorker('kibana-intake', './test/scripts/jenkins_unit.sh')()
20-
}
16+
kibanaPipeline.intakeWorker('kibana-intake', './test/scripts/jenkins_unit.sh')()
2117
},
2218
'x-pack-intake-agent': {
2319
withEnv([

.github/CODEOWNERS

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,10 @@
7272
# Observability UIs
7373
/x-pack/legacy/plugins/infra/ @elastic/logs-metrics-ui
7474
/x-pack/plugins/infra/ @elastic/logs-metrics-ui
75-
/x-pack/legacy/plugins/integrations_manager/ @elastic/epm
75+
/x-pack/plugins/ingest_manager/ @elastic/ingest
76+
/x-pack/legacy/plugins/ingest_manager/ @elastic/ingest
7677
/x-pack/plugins/observability/ @elastic/logs-metrics-ui @elastic/apm-ui @elastic/uptime @elastic/ingest
78+
/x-pack/legacy/plugins/monitoring/ @elastic/stack-monitoring-ui
7779

7880
# Machine Learning
7981
/x-pack/legacy/plugins/ml/ @elastic/ml-ui
@@ -177,3 +179,16 @@
177179
/x-pack/plugins/searchprofiler/ @elastic/es-ui
178180
/x-pack/legacy/plugins/snapshot_restore/ @elastic/es-ui
179181
/x-pack/plugins/watcher/ @elastic/es-ui
182+
183+
# Endpoint
184+
/x-pack/plugins/endpoint/ @elastic/endpoint-app-team
185+
/x-pack/test/api_integration/apis/endpoint/ @elastic/endpoint-app-team
186+
/x-pack/test/functional/apps/endpoint/ @elastic/endpoint-app-team
187+
/x-pack/test/functional/es_archives/endpoint/ @elastic/endpoint-app-team
188+
189+
# SIEM
190+
/x-pack/legacy/plugins/siem/ @elastic/siem
191+
/x-pack/plugins/siem/ @elastic/siem
192+
/x-pack/test/detection_engine_api_integration @elastic/siem
193+
/x-pack/test/api_integration/apis/siem @elastic/siem
194+
/x-pack/plugins/case @elastic/siem

CONTRIBUTING.md

Lines changed: 14 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,9 @@ Granted that you share your thoughts, we might even be able to come up with crea
5555

5656
First of all, **sorry about that!** We want you to have a great time with Kibana.
5757

58-
Hosting meaningful discussions on GitHub can be challenging. For that reason, we'll sometimes ask that you join us on IRC _([#kibana](https://kiwiirc.com/client/irc.freenode.net/?#kibana) on freenode)_ to chat about your issues. You may also experience **faster response times** when engaging us via IRC.
59-
6058
There's hundreds of open issues and prioritizing what to work on is an important aspect of our daily jobs. We prioritize issues according to impact and difficulty, so some issues can be neglected while we work on more pressing issues.
6159

62-
Feel free to bump your issues if you think they've been neglected for a prolonged period, or just jump on IRC and let us have it!
60+
Feel free to bump your issues if you think they've been neglected for a prolonged period.
6361

6462
### "I want to help!"
6563

@@ -471,11 +469,11 @@ The following table outlines possible test file locations and how to invoke them
471469

472470
| Test runner | Test location | Runner command (working directory is kibana root) |
473471
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
474-
| Jest | `src/**/*.test.js`<br>`src/**/*.test.ts` | `node scripts/jest -t regexp [test path]` |
475-
| Jest (integration) | `**/integration_tests/**/*.test.js` | `node scripts/jest_integration -t regexp [test path]` |
472+
| Jest | `src/**/*.test.js`<br>`src/**/*.test.ts` | `yarn test:jest -t regexp [test path]` |
473+
| Jest (integration) | `**/integration_tests/**/*.test.js` | `yarn test:jest_integration -t regexp [test path]` |
476474
| Mocha | `src/**/__tests__/**/*.js`<br>`!src/**/public/__tests__/*.js`<br>`packages/kbn-datemath/test/**/*.js`<br>`packages/kbn-dev-utils/src/**/__tests__/**/*.js`<br>`tasks/**/__tests__/**/*.js` | `node scripts/mocha --grep=regexp [test path]` |
477-
| Functional | `test/*integration/**/config.js`<br>`test/*functional/**/config.js`<br>`test/accessibility/config.js` | `node scripts/functional_tests_server --config test/[directory]/config.js`<br>`node scripts/functional_test_runner --config test/[directory]/config.js --grep=regexp` |
478-
| Karma | `src/**/public/__tests__/*.js` | `npm run test:dev` |
475+
| Functional | `test/*integration/**/config.js`<br>`test/*functional/**/config.js`<br>`test/accessibility/config.js` | `yarn test:ftr:server --config test/[directory]/config.js`<br>`yarn test:ftr:runner --config test/[directory]/config.js --grep=regexp` |
476+
| Karma | `src/**/public/__tests__/*.js` | `yarn test:karma:debug` |
479477

480478
For X-Pack tests located in `x-pack/` see [X-Pack Testing](x-pack/README.md#testing)
481479

@@ -486,56 +484,38 @@ Test runner arguments:
486484
Examples:
487485
- Run the entire elasticsearch_service test suite:
488486
```
489-
node scripts/jest src/core/server/elasticsearch/elasticsearch_service.test.ts
487+
yarn test:jest src/core/server/elasticsearch/elasticsearch_service.test.ts
490488
```
491489
- Run the jest test case whose description matches `stops both admin and data clients`:
492490
```
493-
node scripts/jest -t 'stops both admin and data clients' src/core/server/elasticsearch/elasticsearch_service.test.ts
491+
yarn test:jest -t 'stops both admin and data clients' src/core/server/elasticsearch/elasticsearch_service.test.ts
494492
```
495493
- Run the api integration test case whose description matches the given string:
496494
```
497-
node scripts/functional_tests_server --config test/api_integration/config.js
498-
node scripts/functional_test_runner --config test/api_integration/config.js --grep='should return 404 if id does not match any sample data sets'
495+
yarn test:ftr:server --config test/api_integration/config.js
496+
yarn test:ftr:runner --config test/api_integration/config.js --grep='should return 404 if id does not match any sample data sets'
499497
```
500498
501499
### Debugging Unit Tests
502500
503501
The standard `yarn test` task runs several sub tasks and can take several minutes to complete, making debugging failures pretty painful. In order to ease the pain specialized tasks provide alternate methods for running the tests.
504502
505-
To execute both server and browser tests, but skip linting, use `yarn test:quick`.
506-
507-
```bash
508-
yarn test:quick
509-
```
510-
511-
Use `yarn test:mocha` when you want to run the mocha tests.
512-
513-
```bash
514-
yarn test:mocha
515-
```
516-
517-
When you'd like to execute individual server-side test files, you can use the command below. Note that this command takes care of configuring Mocha with Babel compilation for you, and you'll be better off avoiding a globally installed `mocha` package. This command is great for development and for quickly identifying bugs.
518-
519-
```bash
520-
node scripts/mocha <file>
521-
```
522-
523503
You could also add the `--debug` option so that `node` is run using the `--debug-brk` flag. You'll need to connect a remote debugger such as [`node-inspector`](https://github.com/node-inspector/node-inspector) to proceed in this mode.
524504
525505
```bash
526506
node scripts/mocha --debug <file>
527507
```
528508

529-
With `yarn test:browser`, you can run only the browser tests. Coverage reports are available for browser tests by running `yarn test:coverage`. You can find the results under the `coverage/` directory that will be created upon completion.
509+
With `yarn test:karma`, you can run only the browser tests. Coverage reports are available for browser tests by running `yarn test:coverage`. You can find the results under the `coverage/` directory that will be created upon completion.
530510

531511
```bash
532-
yarn test:browser
512+
yarn test:karma
533513
```
534514

535-
Using `yarn test:dev` initializes an environment for debugging the browser tests. Includes an dedicated instance of the kibana server for building the test bundle, and a karma server. When running this task the build is optimized for the first time and then a karma-owned instance of the browser is opened. Click the "debug" button to open a new tab that executes the unit tests.
515+
Using `yarn test:karma:debug` initializes an environment for debugging the browser tests. Includes an dedicated instance of the kibana server for building the test bundle, and a karma server. When running this task the build is optimized for the first time and then a karma-owned instance of the browser is opened. Click the "debug" button to open a new tab that executes the unit tests.
536516

537517
```bash
538-
yarn test:dev
518+
yarn test:karma:debug
539519
```
540520

541521
In the screenshot below, you'll notice the URL is `localhost:9876/debug.html`. You can append a `grep` query parameter to this URL and set it to a string value which will be used to exclude tests which don't match. For example, if you changed the URL to `localhost:9876/debug.html?query=my test` and then refreshed the browser, you'd only see tests run which contain "my test" in the test description.
@@ -551,7 +531,7 @@ To run the tests for just your particular plugin run the following command from
551531

552532
```bash
553533
yarn test:mocha
554-
yarn test:browser --dev # remove the --dev flag to run them once and close
534+
yarn test:karma:debug # remove the debug flag to run them once and close
555535
```
556536

557537
### Automated Accessibility Testing

docs/management/advanced-options.asciidoc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,6 @@ into the document when displaying it.
7070
`metrics:max_buckets`:: The maximum numbers of buckets that a single
7171
data source can return. This might arise when the user selects a
7272
short interval (for example, 1s) for a long time period (1 year).
73-
`pageNavigation`:: The style of navigation menu for Kibana.
74-
Choices are Individual, the legacy style where every plugin is represented in the nav,
75-
and Grouped, a new format that bundles related plugins together in nested navigation.
7673
`query:allowLeadingWildcards`:: Allows a wildcard (*) as the first character
7774
in a query clause. Only applies when experimental query features are
7875
enabled in the query bar. To disallow leading wildcards in Lucene queries,

examples/demo_search/public/demo_search_strategy.ts

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,7 @@
1818
*/
1919

2020
import { Observable } from 'rxjs';
21-
import {
22-
ISearchContext,
23-
SYNC_SEARCH_STRATEGY,
24-
ISearchGeneric,
25-
} from '../../../src/plugins/data/public';
21+
import { ISearchContext, SYNC_SEARCH_STRATEGY } from '../../../src/plugins/data/public';
2622
import { TSearchStrategyProvider, ISearchStrategy } from '../../../src/plugins/data/public';
2723

2824
import { DEMO_SEARCH_STRATEGY, IDemoResponse } from '../common';
@@ -54,15 +50,15 @@ import { DEMO_SEARCH_STRATEGY, IDemoResponse } from '../common';
5450
* @param search - a search function to access other strategies that have already been registered.
5551
*/
5652
export const demoClientSearchStrategyProvider: TSearchStrategyProvider<typeof DEMO_SEARCH_STRATEGY> = (
57-
context: ISearchContext,
58-
search: ISearchGeneric
53+
context: ISearchContext
5954
): ISearchStrategy<typeof DEMO_SEARCH_STRATEGY> => {
55+
const syncStrategyProvider = context.getSearchStrategy(SYNC_SEARCH_STRATEGY);
56+
const { search } = syncStrategyProvider(context);
6057
return {
61-
search: (request, options) =>
62-
search(
63-
{ ...request, serverStrategy: DEMO_SEARCH_STRATEGY },
64-
options,
65-
SYNC_SEARCH_STRATEGY
66-
) as Observable<IDemoResponse>,
58+
search: (request, options) => {
59+
return search({ ...request, serverStrategy: DEMO_SEARCH_STRATEGY }, options) as Observable<
60+
IDemoResponse
61+
>;
62+
},
6763
};
6864
};

examples/demo_search/public/index.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,10 @@
1717
* under the License.
1818
*/
1919

20-
import { PluginInitializer, PluginInitializerContext } from 'kibana/public';
20+
import { PluginInitializer } from 'kibana/public';
2121

2222
import { DemoDataPlugin } from './plugin';
2323

2424
export { DEMO_SEARCH_STRATEGY } from '../common';
2525

26-
export const plugin: PluginInitializer<void, void> = (
27-
initializerContext: PluginInitializerContext
28-
) => new DemoDataPlugin(initializerContext);
26+
export const plugin: PluginInitializer<void, void> = () => new DemoDataPlugin();

examples/demo_search/public/plugin.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919

2020
import { DataPublicPluginSetup } from '../../../src/plugins/data/public';
21-
import { Plugin, CoreSetup, PluginInitializerContext } from '../../../src/core/public';
21+
import { Plugin, CoreSetup } from '../../../src/core/public';
2222
import { DEMO_SEARCH_STRATEGY } from '../common';
2323
import { demoClientSearchStrategyProvider } from './demo_search_strategy';
2424
import { IDemoRequest, IDemoResponse } from '../common';
@@ -47,10 +47,8 @@ declare module '../../../src/plugins/data/public' {
4747
}
4848

4949
export class DemoDataPlugin implements Plugin {
50-
constructor(private initializerContext: PluginInitializerContext) {}
5150
public setup(core: CoreSetup, deps: DemoDataSearchSetupDependencies) {
5251
deps.data.search.registerSearchStrategyProvider(
53-
this.initializerContext.opaqueId,
5452
DEMO_SEARCH_STRATEGY,
5553
demoClientSearchStrategyProvider
5654
);

examples/embeddable_examples/public/multi_task_todo/multi_task_todo_embeddable_factory.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,13 @@ import {
2323
MultiTaskTodoEmbeddable,
2424
MULTI_TASK_TODO_EMBEDDABLE,
2525
MultiTaskTodoInput,
26+
MultiTaskTodoOutput,
2627
} from './multi_task_todo_embeddable';
2728

28-
export class MultiTaskTodoEmbeddableFactory extends EmbeddableFactory {
29+
export class MultiTaskTodoEmbeddableFactory extends EmbeddableFactory<
30+
MultiTaskTodoInput,
31+
MultiTaskTodoOutput
32+
> {
2933
public readonly type = MULTI_TASK_TODO_EMBEDDABLE;
3034

3135
public isEditable() {
@@ -36,6 +40,15 @@ export class MultiTaskTodoEmbeddableFactory extends EmbeddableFactory {
3640
return new MultiTaskTodoEmbeddable(initialInput, parent);
3741
}
3842

43+
/**
44+
* Check out todo_embeddable_factory for a better example that asks for data from
45+
* the user. This just returns default data. That's okay too though, if you want to
46+
* start with default data and expose an "edit" action to modify it.
47+
*/
48+
public async getExplicitInput() {
49+
return { title: 'default title', tasks: ['Im default data'] };
50+
}
51+
3952
public getDisplayName() {
4053
return i18n.translate('embeddableExamples.multiTaskTodo.displayName', {
4154
defaultMessage: 'Multi-task todo item',

examples/embeddable_examples/public/plugin.ts

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,20 @@
1717
* under the License.
1818
*/
1919

20-
import { IEmbeddableSetup, IEmbeddableStart } from '../../../src/plugins/embeddable/public';
20+
import {
21+
IEmbeddableSetup,
22+
IEmbeddableStart,
23+
EmbeddableFactory,
24+
} from '../../../src/plugins/embeddable/public';
2125
import { Plugin, CoreSetup, CoreStart } from '../../../src/core/public';
2226
import { HelloWorldEmbeddableFactory, HELLO_WORLD_EMBEDDABLE } from './hello_world';
23-
import { TODO_EMBEDDABLE, TodoEmbeddableFactory } from './todo';
24-
import { MULTI_TASK_TODO_EMBEDDABLE, MultiTaskTodoEmbeddableFactory } from './multi_task_todo';
27+
import { TODO_EMBEDDABLE, TodoEmbeddableFactory, TodoInput, TodoOutput } from './todo';
28+
import {
29+
MULTI_TASK_TODO_EMBEDDABLE,
30+
MultiTaskTodoEmbeddableFactory,
31+
MultiTaskTodoOutput,
32+
MultiTaskTodoInput,
33+
} from './multi_task_todo';
2534
import {
2635
SEARCHABLE_LIST_CONTAINER,
2736
SearchableListContainerFactory,
@@ -45,12 +54,9 @@ export class EmbeddableExamplesPlugin
4554
new HelloWorldEmbeddableFactory()
4655
);
4756

48-
deps.embeddable.registerEmbeddableFactory(TODO_EMBEDDABLE, new TodoEmbeddableFactory());
49-
50-
deps.embeddable.registerEmbeddableFactory(
51-
MULTI_TASK_TODO_EMBEDDABLE,
52-
new MultiTaskTodoEmbeddableFactory()
53-
);
57+
deps.embeddable.registerEmbeddableFactory<
58+
EmbeddableFactory<MultiTaskTodoInput, MultiTaskTodoOutput>
59+
>(MULTI_TASK_TODO_EMBEDDABLE, new MultiTaskTodoEmbeddableFactory());
5460
}
5561

5662
public start(core: CoreStart, deps: EmbeddableExamplesStartDependencies) {
@@ -66,6 +72,11 @@ export class EmbeddableExamplesPlugin
6672
LIST_CONTAINER,
6773
new ListContainerFactory(deps.embeddable.getEmbeddableFactory)
6874
);
75+
76+
deps.embeddable.registerEmbeddableFactory<EmbeddableFactory<TodoInput, TodoOutput>>(
77+
TODO_EMBEDDABLE,
78+
new TodoEmbeddableFactory(core.overlays.openModal)
79+
);
6980
}
7081

7182
public stop() {}

0 commit comments

Comments
 (0)