Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into alerting-change-u…
Browse files Browse the repository at this point in the history
…rls-to-kibana-styleguide

# Conflicts:
#	x-pack/plugins/alerts/server/alerts_client.test.ts
#	x-pack/plugins/alerts/server/alerts_client_factory.test.ts
  • Loading branch information
YulNaumenko committed Jun 1, 2020
2 parents 1f47537 + cf2aebf commit f486629
Show file tree
Hide file tree
Showing 355 changed files with 29,112 additions and 4,119 deletions.
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ target
/src/plugins/vis_type_timelion/public/_generated_/**
/src/plugins/vis_type_timelion/public/webpackShims/jquery.flot.*
/x-pack/legacy/plugins/**/__tests__/fixtures/**
/x-pack/plugins/apm/e2e/cypress/**/snapshots.js
/x-pack/plugins/apm/e2e/**/snapshots.js
/x-pack/plugins/apm/e2e/tmp/*
/x-pack/plugins/canvas/canvas_plugin
/x-pack/plugins/canvas/canvas_plugin_src/lib/flot-charts
/x-pack/plugins/canvas/shareable_runtime/build
Expand Down
3 changes: 0 additions & 3 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
/x-pack/plugins/dashboard_enhanced/ @elastic/kibana-app
/x-pack/plugins/lens/ @elastic/kibana-app
/x-pack/plugins/graph/ @elastic/kibana-app
/src/legacy/server/url_shortening/ @elastic/kibana-app
/src/legacy/server/sample_data/ @elastic/kibana-app
/src/legacy/core_plugins/kibana/public/local_application_service/ @elastic/kibana-app
/src/legacy/core_plugins/kibana/public/dev_tools/ @elastic/kibana-app
/src/plugins/dashboard/ @elastic/kibana-app
/src/plugins/discover/ @elastic/kibana-app
/src/plugins/input_control_vis/ @elastic/kibana-app
Expand Down
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ package-lock.json
*.sublime-*
npm-debug.log*
.tern-project
x-pack/plugins/apm/tsconfig.json
apm.tsconfig.json
/x-pack/legacy/plugins/apm/e2e/snapshots.js
/x-pack/plugins/apm/e2e/snapshots.js
.nyc_output

# apm plugin
/x-pack/plugins/apm/tsconfig.json
apm.tsconfig.json
56 changes: 37 additions & 19 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,44 @@ A high level overview of our contributing guidelines.
- ["My issue isn't getting enough attention"](#my-issue-isnt-getting-enough-attention)
- ["I want to help!"](#i-want-to-help)
- [How We Use Git and GitHub](#how-we-use-git-and-github)
- [Forking](#forking)
- [Branching](#branching)
- [Commits and Merging](#commits-and-merging)
- [Rebasing and fixing merge conflicts](#rebasing-and-fixing-merge-conflicts)
- [What Goes Into a Pull Request](#what-goes-into-a-pull-request)
- [Contributing Code](#contributing-code)
- [Setting Up Your Development Environment](#setting-up-your-development-environment)
- [Increase node.js heap size](#increase-nodejs-heap-size)
- [Running Elasticsearch Locally](#running-elasticsearch-locally)
- [Nightly snapshot (recommended)](#nightly-snapshot-recommended)
- [Keeping data between snapshots](#keeping-data-between-snapshots)
- [Source](#source)
- [Archive](#archive)
- [Sample Data](#sample-data)
- [Running Elasticsearch Remotely](#running-elasticsearch-remotely)
- [Running remote clusters](#running-remote-clusters)
- [Running Kibana](#running-kibana)
- [Running Kibana in Open-Source mode](#running-kibana-in-open-source-mode)
- [Unsupported URL Type](#unsupported-url-type)
- [Customizing `config/kibana.dev.yml`](#customizing-configkibanadevyml)
- [Potential Optimization Pitfalls](#potential-optimization-pitfalls)
- [Setting Up SSL](#setting-up-ssl)
- [Linting](#linting)
- [Setup Guide for VS Code Users](#setup-guide-for-vs-code-users)
- [Internationalization](#internationalization)
- [Localization](#localization)
- [Styling with SASS](#styling-with-sass)
- [Testing and Building](#testing-and-building)
- [Debugging server code](#debugging-server-code)
- [Instrumenting with Elastic APM](#instrumenting-with-elastic-apm)
- [Debugging Unit Tests](#debugging-unit-tests)
- [Unit Testing Plugins](#unit-testing-plugins)
- [Automated Accessibility Testing](#automated-accessibility-testing)
- [Cross-browser compatibility](#cross-browser-compatibility)
- [Testing compatibility locally](#testing-compatibility-locally)
- [Running Browser Automation Tests](#running-browser-automation-tests)
- [Browser Automation Notes](#browser-automation-notes)
- [Unit testing frameworks](#unit-testing-frameworks)
- [Running specific Kibana tests](#running-specific-kibana-tests)
- [Debugging Unit Tests](#debugging-unit-tests)
- [Unit Testing Plugins](#unit-testing-plugins)
- [Automated Accessibility Testing](#automated-accessibility-testing)
- [Cross-browser compatibility](#cross-browser-compatibility)
- [Testing compatibility locally](#testing-compatibility-locally)
- [Running Browser Automation Tests](#running-browser-automation-tests)
- [Building OS packages](#building-os-packages)
- [Writing documentation](#writing-documentation)
- [Release Notes Process](#release-notes-process)
Expand Down Expand Up @@ -414,7 +432,7 @@ extract them to a `JSON` file or integrate translations back to Kibana. To know
We cannot support accepting contributions to the translations from any source other than the translators we have engaged to do the work.
We are still to develop a proper process to accept any contributed translations. We certainly appreciate that people care enough about the localization effort to want to help improve the quality. We aim to build out a more comprehensive localization process for the future and will notify you once contributions can be supported, but for the time being, we are not able to incorporate suggestions.

### Syling with SASS
### Styling with SASS

When writing a new component, create a sibling SASS file of the same name and import directly into the JS/TS component file. Doing so ensures the styles are never separated or lost on import and allows for better modularization (smaller individual plugin asset footprint).

Expand Down Expand Up @@ -467,10 +485,10 @@ macOS users on a machine with a discrete graphics card may see significant speed
- Uncheck the "Prefer integrated to discrete GPU" option
- Restart iTerm

### Debugging Server Code
#### Debugging Server Code
`yarn debug` will start the server with Node's inspect flag. Kibana's development mode will start three processes on ports `9229`, `9230`, and `9231`. Chrome's developer tools need to be configured to connect to all three connections. Add `localhost:<port>` for each Kibana process in Chrome's developer tools connection tab.

### Instrumenting with Elastic APM
#### Instrumenting with Elastic APM
Kibana ships with the [Elastic APM Node.js Agent](https://github.com/elastic/apm-agent-nodejs) built-in for debugging purposes.

Its default configuration is meant to be used by core Kibana developers only, but it can easily be re-configured to your needs.
Expand Down Expand Up @@ -501,13 +519,13 @@ ELASTIC_APM_ACTIVE=true yarn start
Once the agent is active, it will trace all incoming HTTP requests to Kibana, monitor for errors, and collect process-level metrics.
The collected data will be sent to the APM Server and is viewable in the APM UI in Kibana.

### Unit testing frameworks
#### Unit testing frameworks
Kibana is migrating unit testing from Mocha to Jest. Legacy unit tests still
exist in Mocha but all new unit tests should be written in Jest. Mocha tests
are contained in `__tests__` directories. Whereas Jest tests are stored in
the same directory as source code files with the `.test.js` suffix.

### Running specific Kibana tests
#### Running specific Kibana tests

The following table outlines possible test file locations and how to invoke them:

Expand Down Expand Up @@ -540,7 +558,7 @@ Test runner arguments:
yarn test:ftr:runner --config test/api_integration/config.js --grep='should return 404 if id does not match any sample data sets'
```

### Debugging Unit Tests
#### Debugging Unit Tests

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.

Expand All @@ -567,7 +585,7 @@ In the screenshot below, you'll notice the URL is `localhost:9876/debug.html`. Y

![Browser test debugging](http://i.imgur.com/DwHxgfq.png)

### Unit Testing Plugins
#### Unit Testing Plugins

This should work super if you're using the [Kibana plugin generator](https://github.com/elastic/kibana/tree/master/packages/kbn-plugin-generator). If you're not using the generator, well, you're on your own. We suggest you look at how the generator works.

Expand All @@ -578,7 +596,7 @@ yarn test:mocha
yarn test:karma:debug # remove the debug flag to run them once and close
```

### Automated Accessibility Testing
#### Automated Accessibility Testing

To run the tests locally:

Expand All @@ -595,11 +613,11 @@ can be run locally using their browser plugins:
- [Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US)
- [Firefox](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/)

### Cross-browser Compatibility
#### Cross-browser Compatibility

#### Testing Compatibility Locally
##### Testing Compatibility Locally

##### Testing IE on OS X
###### Testing IE on OS X

* [Download VMWare Fusion](http://www.vmware.com/products/fusion/fusion-evaluation.html).
* [Download IE virtual machines](https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/#downloads) for VMWare.
Expand All @@ -610,7 +628,7 @@ can be run locally using their browser plugins:
* Now you can run your VM, open the browser, and navigate to `http://computer.local:5601` to test Kibana.
* Alternatively you can use browserstack

#### Running Browser Automation Tests
##### Running Browser Automation Tests

[Read about the `FunctionalTestRunner`](https://www.elastic.co/guide/en/kibana/current/development-functional-tests.html) to learn more about how you can run and develop functional tests for Kibana core and plugins.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## ChromeNavLink.euiIconType property

A EUI iconType that will be used for the app's icon. This icon takes precendence over the `icon` property.
A EUI iconType that will be used for the app's icon. This icon takes precedence over the `icon` property.

<b>Signature:</b>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-public](./kibana-plugin-core-public.md) &gt; [ChromeNavLink](./kibana-plugin-core-public.chromenavlink.md) &gt; [href](./kibana-plugin-core-public.chromenavlink.href.md)

## ChromeNavLink.href property

Settled state between `url`<!-- -->, `baseUrl`<!-- -->, and `active`

<b>Signature:</b>

```typescript
readonly href?: string;
```
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ export interface ChromeNavLink
| [category](./kibana-plugin-core-public.chromenavlink.category.md) | <code>AppCategory</code> | The category the app lives in |
| [disabled](./kibana-plugin-core-public.chromenavlink.disabled.md) | <code>boolean</code> | Disables a link from being clickable. |
| [disableSubUrlTracking](./kibana-plugin-core-public.chromenavlink.disablesuburltracking.md) | <code>boolean</code> | A flag that tells legacy chrome to ignore the link when tracking sub-urls |
| [euiIconType](./kibana-plugin-core-public.chromenavlink.euiicontype.md) | <code>string</code> | A EUI iconType that will be used for the app's icon. This icon takes precendence over the <code>icon</code> property. |
| [euiIconType](./kibana-plugin-core-public.chromenavlink.euiicontype.md) | <code>string</code> | A EUI iconType that will be used for the app's icon. This icon takes precedence over the <code>icon</code> property. |
| [hidden](./kibana-plugin-core-public.chromenavlink.hidden.md) | <code>boolean</code> | Hides a link from the navigation. |
| [href](./kibana-plugin-core-public.chromenavlink.href.md) | <code>string</code> | Settled state between <code>url</code>, <code>baseUrl</code>, and <code>active</code> |
| [icon](./kibana-plugin-core-public.chromenavlink.icon.md) | <code>string</code> | A URL to an image file used as an icon. Used as a fallback if <code>euiIconType</code> is not provided. |
| [id](./kibana-plugin-core-public.chromenavlink.id.md) | <code>string</code> | A unique identifier for looking up links. |
| [linkToLastSubUrl](./kibana-plugin-core-public.chromenavlink.linktolastsuburl.md) | <code>boolean</code> | Whether or not the subUrl feature should be enabled. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
<b>Signature:</b>

```typescript
export declare type ChromeNavLinkUpdateableFields = Partial<Pick<ChromeNavLink, 'active' | 'disabled' | 'hidden' | 'url' | 'subUrlBase'>>;
export declare type ChromeNavLinkUpdateableFields = Partial<Pick<ChromeNavLink, 'active' | 'disabled' | 'hidden' | 'url' | 'subUrlBase' | 'href'>>;
```

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [ElasticsearchServiceSetup](./kibana-plugin-core-server.elasticsearchservicesetup.md) &gt; [legacy](./kibana-plugin-core-server.elasticsearchservicesetup.legacy.md)

## ElasticsearchServiceSetup.legacy property

> Warning: This API is now obsolete.
>
> Use [ElasticsearchServiceStart.legacy](./kibana-plugin-core-server.elasticsearchservicestart.legacy.md) instead.
>
<b>Signature:</b>

```typescript
legacy: {
readonly createClient: (type: string, clientConfig?: Partial<ElasticsearchClientConfig>) => ICustomClusterClient;
readonly client: IClusterClient;
};
```
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,5 @@ export interface ElasticsearchServiceSetup

| Property | Type | Description |
| --- | --- | --- |
| [adminClient](./kibana-plugin-core-server.elasticsearchservicesetup.adminclient.md) | <code>IClusterClient</code> | |
| [createClient](./kibana-plugin-core-server.elasticsearchservicesetup.createclient.md) | <code>(type: string, clientConfig?: Partial&lt;ElasticsearchClientConfig&gt;) =&gt; ICustomClusterClient</code> | |
| [dataClient](./kibana-plugin-core-server.elasticsearchservicesetup.dataclient.md) | <code>IClusterClient</code> | |
| [legacy](./kibana-plugin-core-server.elasticsearchservicesetup.legacy.md) | <code>{</code><br/><code> readonly createClient: (type: string, clientConfig?: Partial&lt;ElasticsearchClientConfig&gt;) =&gt; ICustomClusterClient;</code><br/><code> readonly client: IClusterClient;</code><br/><code> }</code> | |

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

## ElasticsearchServiceStart.legacy property

> Warning: This API is now obsolete.
>
> Provided for the backward compatibility. Switch to the new elasticsearch client as soon as https://github.com/elastic/kibana/issues/35508 done.
>
<b>Signature:</b>

```typescript
Expand Down
2 changes: 1 addition & 1 deletion docs/development/core/server/kibana-plugin-core-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
| [PluginConfigDescriptor](./kibana-plugin-core-server.pluginconfigdescriptor.md) | Describes a plugin configuration properties. |
| [PluginInitializerContext](./kibana-plugin-core-server.plugininitializercontext.md) | Context that's available to plugins during initialization stage. |
| [PluginManifest](./kibana-plugin-core-server.pluginmanifest.md) | Describes the set of required and optional properties plugin can define in its mandatory JSON manifest file. |
| [RequestHandlerContext](./kibana-plugin-core-server.requesthandlercontext.md) | Plugin specific context passed to a route handler.<!-- -->Provides the following clients and services: - [savedObjects.client](./kibana-plugin-core-server.savedobjectsclient.md) - Saved Objects client which uses the credentials of the incoming request - [savedObjects.typeRegistry](./kibana-plugin-core-server.isavedobjecttyperegistry.md) - Type registry containing all the registered types. - [elasticsearch.dataClient](./kibana-plugin-core-server.scopedclusterclient.md) - Elasticsearch data client which uses the credentials of the incoming request - [elasticsearch.adminClient](./kibana-plugin-core-server.scopedclusterclient.md) - Elasticsearch admin client which uses the credentials of the incoming request - [uiSettings.client](./kibana-plugin-core-server.iuisettingsclient.md) - uiSettings client which uses the credentials of the incoming request |
| [RequestHandlerContext](./kibana-plugin-core-server.requesthandlercontext.md) | Plugin specific context passed to a route handler.<!-- -->Provides the following clients and services: - [savedObjects.client](./kibana-plugin-core-server.savedobjectsclient.md) - Saved Objects client which uses the credentials of the incoming request - [savedObjects.typeRegistry](./kibana-plugin-core-server.isavedobjecttyperegistry.md) - Type registry containing all the registered types. - [elasticsearch.legacy.client](./kibana-plugin-core-server.scopedclusterclient.md) - Elasticsearch data client which uses the credentials of the incoming request - [uiSettings.client](./kibana-plugin-core-server.iuisettingsclient.md) - uiSettings client which uses the credentials of the incoming request |
| [RouteConfig](./kibana-plugin-core-server.routeconfig.md) | Route specific configuration. |
| [RouteConfigOptions](./kibana-plugin-core-server.routeconfigoptions.md) | Additional route options. |
| [RouteConfigOptionsBody](./kibana-plugin-core-server.routeconfigoptionsbody.md) | Additional body options for a route |
Expand Down
Loading

0 comments on commit f486629

Please sign in to comment.