Skip to content

Commit c74c62a

Browse files
Merge branch 'master' into stabilize-rollup-test
2 parents a84db15 + e7b6386 commit c74c62a

File tree

1,740 files changed

+25808
-11462
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,740 files changed

+25808
-11462
lines changed

.ci/end2end.groovy

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pipeline {
2525
durabilityHint('PERFORMANCE_OPTIMIZED')
2626
}
2727
triggers {
28-
issueCommentTrigger('(?i).*jenkins\\W+run\\W+(?:the\\W+)?e2e(?:\\W+please)?.*')
28+
issueCommentTrigger('(?i)(retest|.*jenkins\\W+run\\W+(?:the\\W+)?e2e?.*)')
2929
}
3030
parameters {
3131
booleanParam(name: 'FORCE', defaultValue: false, description: 'Whether to force the run.')
@@ -60,8 +60,14 @@ pipeline {
6060
}
6161
}
6262
steps {
63+
notifyStatus('Starting services', 'PENDING')
6364
dir("${APM_ITS}"){
64-
sh './scripts/compose.py start master --no-kibana --no-xpack-secure'
65+
sh './scripts/compose.py start master --no-kibana'
66+
}
67+
}
68+
post {
69+
unsuccessful {
70+
notifyStatus('Environmental issue', 'FAILURE')
6571
}
6672
}
6773
}
@@ -77,10 +83,16 @@ pipeline {
7783
JENKINS_NODE_COOKIE = 'dontKillMe'
7884
}
7985
steps {
86+
notifyStatus('Preparing kibana', 'PENDING')
8087
dir("${BASE_DIR}"){
8188
sh script: "${CYPRESS_DIR}/ci/prepare-kibana.sh"
8289
}
8390
}
91+
post {
92+
unsuccessful {
93+
notifyStatus('Kibana warm up failed', 'FAILURE')
94+
}
95+
}
8496
}
8597
stage('Smoke Tests'){
8698
options { skipDefaultCheckout() }
@@ -91,6 +103,7 @@ pipeline {
91103
}
92104
}
93105
steps{
106+
notifyStatus('Running smoke tests', 'PENDING')
94107
dir("${BASE_DIR}"){
95108
sh '''
96109
jobs -l
@@ -112,6 +125,12 @@ pipeline {
112125
archiveArtifacts(allowEmptyArchive: false, artifacts: 'apm-its.log')
113126
}
114127
}
128+
unsuccessful {
129+
notifyStatus('Test failures', 'FAILURE')
130+
}
131+
success {
132+
notifyStatus('Tests passed', 'SUCCESS')
133+
}
115134
}
116135
}
117136
}
@@ -123,3 +142,7 @@ pipeline {
123142
}
124143
}
125144
}
145+
146+
def notifyStatus(String description, String status) {
147+
withGithubNotify.notify('end2end-for-apm-ui', description, status, getBlueoceanDisplayURL())
148+
}

.github/CODEOWNERS

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@
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
7778

7879
# Machine Learning
@@ -149,13 +150,15 @@
149150
# Kibana Alerting Services
150151
/x-pack/legacy/plugins/alerting/ @elastic/kibana-alerting-services
151152
/x-pack/legacy/plugins/actions/ @elastic/kibana-alerting-services
153+
/x-pack/plugins/alerting/ @elastic/kibana-alerting-services
152154
/x-pack/plugins/actions/ @elastic/kibana-alerting-services
153155
/x-pack/plugins/event_log/ @elastic/kibana-alerting-services
154156
/x-pack/plugins/task_manager/ @elastic/kibana-alerting-services
155157
/x-pack/test/alerting_api_integration/ @elastic/kibana-alerting-services
156158
/x-pack/test/plugin_api_integration/plugins/task_manager/ @elastic/kibana-alerting-services
157159
/x-pack/test/plugin_api_integration/test_suites/task_manager/ @elastic/kibana-alerting-services
158160
/x-pack/legacy/plugins/triggers_actions_ui/ @elastic/kibana-alerting-services
161+
/x-pack/plugins/triggers_actions_ui/ @elastic/kibana-alerting-services
159162
/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/ @elastic/kibana-alerting-services
160163
/x-pack/test/functional_with_es_ssl/fixtures/plugins/alerts/ @elastic/kibana-alerting-services
161164

@@ -175,3 +178,9 @@
175178
/x-pack/plugins/searchprofiler/ @elastic/es-ui
176179
/x-pack/legacy/plugins/snapshot_restore/ @elastic/es-ui
177180
/x-pack/plugins/watcher/ @elastic/es-ui
181+
182+
# Endpoint
183+
/x-pack/plugins/endpoint/ @elastic/endpoint-app-team
184+
/x-pack/test/api_integration/apis/endpoint/ @elastic/endpoint-app-team
185+
/x-pack/test/functional/apps/endpoint/ @elastic/endpoint-app-team
186+
/x-pack/test/functional/es_archives/endpoint/ @elastic/endpoint-app-team

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/api/dashboard/import-dashboard.asciidoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ experimental[] Import dashboards and corresponding saved objects.
1616

1717
`force`::
1818
(Optional, boolean) Overwrite any existing objects on ID conflict.
19-
19+
2020
`exclude`::
2121
(Optional, array) Saved object types that you want to exclude from the import.
2222

@@ -28,14 +28,14 @@ Use the complete response body from the <<dashboard-api-export, Export dashboard
2828
[[dashboard-api-import-response-body]]
2929
==== Response body
3030

31-
`objects`::
32-
(array) A top level property that includes the saved objects.
31+
`objects`::
32+
(array) A top level property that includes the saved objects.
3333

3434
[[dashboard-api-import-codes]]
3535
==== Response code
3636

3737
`200`::
38-
Indicates a successful call, even if there are errors importing individual saved objects. If there ar errors, the error information is returned in the response body on an object-by-object basis.
38+
Indicates a successful call, even if there are errors importing individual saved objects. If there are errors, the error information is returned in the response body on an object-by-object basis.
3939

4040
[[dashboard-api-import-example]]
4141
==== Example

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/search_explorer/public/application.tsx

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,13 @@ import {
2828
EuiSideNav,
2929
} from '@elastic/eui';
3030

31-
import { AppMountContext, AppMountParameters } from '../../../src/core/public';
31+
import { AppMountParameters, CoreStart } from '../../../src/core/public';
3232
import { EsSearchTest } from './es_strategy';
3333
import { Page } from './page';
3434
import { DemoStrategy } from './demo_strategy';
3535
import { DocumentationPage } from './documentation';
3636
import { SearchApiPage } from './search_api';
37+
import { AppPluginStartDependencies, SearchBarComponentParams } from './types';
3738

3839
const Home = () => <DocumentationPage />;
3940

@@ -44,7 +45,7 @@ interface PageDef {
4445
}
4546

4647
type NavProps = RouteComponentProps & {
47-
navigateToApp: AppMountContext['core']['application']['navigateToApp'];
48+
navigateToApp: CoreStart['application']['navigateToApp'];
4849
pages: PageDef[];
4950
};
5051

@@ -71,7 +72,7 @@ const Nav = withRouter(({ history, navigateToApp, pages }: NavProps) => {
7172

7273
const buildPage = (page: PageDef) => <Page title={page.title}>{page.component}</Page>;
7374

74-
const SearchApp = ({ basename, context }: { basename: string; context: AppMountContext }) => {
75+
const SearchApp = ({ basename, data, application }: SearchBarComponentParams) => {
7576
const pages: PageDef[] = [
7677
{
7778
id: 'home',
@@ -86,12 +87,12 @@ const SearchApp = ({ basename, context }: { basename: string; context: AppMountC
8687
{
8788
title: 'ES search strategy',
8889
id: 'esSearch',
89-
component: <EsSearchTest search={context.search!.search} />,
90+
component: <EsSearchTest search={data.search.search} />,
9091
},
9192
{
9293
title: 'Demo search strategy',
9394
id: 'demoSearch',
94-
component: <DemoStrategy search={context.search!.search} />,
95+
component: <DemoStrategy search={data.search.search} />,
9596
},
9697
];
9798

@@ -103,7 +104,7 @@ const SearchApp = ({ basename, context }: { basename: string; context: AppMountC
103104
<Router basename={basename}>
104105
<EuiPage>
105106
<EuiPageSideBar>
106-
<Nav navigateToApp={context.core.application.navigateToApp} pages={pages} />
107+
<Nav navigateToApp={application.navigateToApp} pages={pages} />
107108
</EuiPageSideBar>
108109
<Route path="/" exact component={Home} />
109110
{routes}
@@ -113,10 +114,14 @@ const SearchApp = ({ basename, context }: { basename: string; context: AppMountC
113114
};
114115

115116
export const renderApp = (
116-
context: AppMountContext,
117+
coreStart: CoreStart,
118+
deps: AppPluginStartDependencies,
117119
{ appBasePath, element }: AppMountParameters
118120
) => {
119-
ReactDOM.render(<SearchApp basename={appBasePath} context={context} />, element);
121+
ReactDOM.render(
122+
<SearchApp basename={appBasePath} data={deps.data} application={coreStart.application} />,
123+
element
124+
);
120125

121126
return () => ReactDOM.unmountComponentAtNode(element);
122127
};

0 commit comments

Comments
 (0)