Skip to content

Commit

Permalink
Merge branch 'master' into 43904_Add_Cleanup_Action_To_UI
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine committed Dec 13, 2019
2 parents 77c9076 + 1ea9d79 commit bdd834f
Show file tree
Hide file tree
Showing 1,797 changed files with 33,464 additions and 17,238 deletions.
1 change: 1 addition & 0 deletions .ci/packer_cache.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ tar -cf "$HOME/.kibana/bootstrap_cache/$branch.tar" \
x-pack/legacy/plugins/*/node_modules \
x-pack/legacy/plugins/reporting/.chromium \
test/plugin_functional/plugins/*/node_modules \
examples/*/node_modules \
.es \
.chromedriver \
.geckodriver;
Expand Down
59 changes: 32 additions & 27 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,6 @@ module.exports = {
'react-hooks/exhaustive-deps': 'off',
},
},
{
files: ['src/plugins/eui_utils/**/*.{js,ts,tsx}'],
rules: {
'react-hooks/exhaustive-deps': 'off',
},
},
{
files: ['src/plugins/kibana_react/**/*.{js,ts,tsx}'],
rules: {
Expand Down Expand Up @@ -170,13 +164,6 @@ module.exports = {
'react-hooks/rules-of-hooks': 'off',
},
},
{
files: ['x-pack/legacy/plugins/infra/**/*.{js,ts,tsx}'],
rules: {
'react-hooks/exhaustive-deps': 'off',
'react-hooks/rules-of-hooks': 'off',
},
},
{
files: ['x-pack/legacy/plugins/lens/**/*.{js,ts,tsx}'],
rules: {
Expand Down Expand Up @@ -209,13 +196,6 @@ module.exports = {
'react-hooks/rules-of-hooks': 'off',
},
},
{
files: ['x-pack/legacy/plugins/watcher/**/*.{js,ts,tsx}'],
rules: {
'react-hooks/rules-of-hooks': 'off',
'react-hooks/exhaustive-deps': 'off',
},
},

/**
* Prettier
Expand Down Expand Up @@ -317,7 +297,8 @@ module.exports = {
'src/legacy/**/*',
'x-pack/**/*',
'!x-pack/**/*.test.*',
'src/plugins/**/(public|server)/**/*',
'!x-pack/test/**/*',
'(src|x-pack)/plugins/**/(public|server)/**/*',
'src/core/(public|server)/**/*',
],
from: [
Expand All @@ -337,16 +318,35 @@ module.exports = {
'!src/core/server/types',
'!src/core/server/*.test.mocks.ts',

'src/plugins/**/public/**/*',
'!src/plugins/**/public/index.{js,ts,tsx}',

'src/plugins/**/server/**/*',
'!src/plugins/**/server/index.{js,ts,tsx}',
'(src|x-pack)/plugins/**/(public|server)/**/*',
'!(src|x-pack)/plugins/**/(public|server)/(index|mocks).{js,ts,tsx}',
],
allowSameFolder: true,
errorMessage: 'Plugins may only import from top-level public and server modules.',
},
{
target: ['src/core/**/*'],
target: [
'(src|x-pack)/plugins/**/*',
'!(src|x-pack)/plugins/*/server/**/*',

'src/legacy/core_plugins/**/*',
'!src/legacy/core_plugins/*/server/**/*',
'!src/legacy/core_plugins/*/index.{js,ts,tsx}',

'x-pack/legacy/plugins/**/*',
'!x-pack/legacy/plugins/*/server/**/*',
'!x-pack/legacy/plugins/*/index.{js,ts,tsx}',
],
from: [
'src/core/server',
'src/core/server/**/*',
'(src|x-pack)/plugins/*/server/**/*',
],
errorMessage:
'Server modules cannot be imported into client modules or shared modules.',
},
{
target: ['src/**/*'],
from: ['x-pack/**/*'],
errorMessage: 'OSS cannot import x-pack files.',
},
Expand All @@ -360,6 +360,11 @@ module.exports = {
],
errorMessage: 'The core cannot depend on any plugins.',
},
{
target: ['(src|x-pack)/plugins/*/public/**/*'],
from: ['ui/**/*', 'uiExports/**/*'],
errorMessage: 'Plugins cannot import legacy UI code.',
},
{
from: ['src/legacy/ui/**/*', 'ui/**/*'],
target: [
Expand Down
26 changes: 15 additions & 11 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
# App
/x-pack/legacy/plugins/lens/ @elastic/kibana-app
/x-pack/legacy/plugins/graph/ @elastic/kibana-app
/src/plugins/share/ @elastic/kibana-app
/src/legacy/server/url_shortening/ @elastic/kibana-app
/src/legacy/server/sample_data/ @elastic/kibana-app

# App Architecture
Expand All @@ -14,7 +16,6 @@
/src/plugins/kibana_react/ @elastic/kibana-app-arch
/src/plugins/kibana_utils/ @elastic/kibana-app-arch
/src/plugins/navigation/ @elastic/kibana-app-arch
/src/plugins/share/ @elastic/kibana-app-arch
/src/plugins/ui_actions/ @elastic/kibana-app-arch
/src/plugins/visualizations/ @elastic/kibana-app-arch
/x-pack/plugins/advanced_ui_actions/ @elastic/kibana-app-arch
Expand All @@ -28,7 +29,6 @@
/src/legacy/core_plugins/kibana/server/routes/api/suggestions/ @elastic/kibana-app-arch
/src/legacy/core_plugins/visualizations/ @elastic/kibana-app-arch
/src/legacy/server/index_patterns/ @elastic/kibana-app-arch
/src/legacy/server/url_shortening/ @elastic/kibana-app-arch

# APM
/x-pack/legacy/plugins/apm/ @elastic/apm-ui
Expand Down Expand Up @@ -97,15 +97,19 @@
/x-pack/plugins/security/ @elastic/kibana-security
/x-pack/test/api_integration/apis/security/ @elastic/kibana-security

# Kibana Stack Services
/src/dev/i18n @elastic/kibana-stack-services
/packages/kbn-analytics/ @elastic/kibana-stack-services
/src/legacy/core_plugins/ui_metric/ @elastic/kibana-stack-services
/src/plugins/usage_collection/ @elastic/kibana-stack-services
/x-pack/legacy/plugins/telemetry @elastic/kibana-stack-services
/x-pack/legacy/plugins/alerting @elastic/kibana-stack-services
/x-pack/legacy/plugins/actions @elastic/kibana-stack-services
/x-pack/legacy/plugins/task_manager @elastic/kibana-stack-services
# Kibana Localization
/src/dev/i18n @elastic/kibana-localization

# Pulse
/packages/kbn-analytics/ @elastic/pulse
/src/legacy/core_plugins/ui_metric/ @elastic/pulse
/src/plugins/usage_collection/ @elastic/pulse
/x-pack/legacy/plugins/telemetry @elastic/pulse

# Kibana Alerting Services
/x-pack/legacy/plugins/alerting @elastic/kibana-alerting-services
/x-pack/legacy/plugins/actions @elastic/kibana-alerting-services
/x-pack/legacy/plugins/task_manager @elastic/kibana-alerting-services

# Design
**/*.scss @elastic/kibana-design
Expand Down
13 changes: 0 additions & 13 deletions .github/labeler.yml

This file was deleted.

15 changes: 15 additions & 0 deletions .github/workflows/pr-project-assigner.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
on:
pull_request:
types: [labeled, unlabeled]

jobs:
assign_to_project:
runs-on: ubuntu-latest
name: Assign a PR to project based on label
steps:
- name: Assign to project
uses: elastic/github-actions/project-assigner@v1.0.0
id: project_assigner
with:
issue-mappings: '[{"label": "Team:AppAch", "projectName": "kibana-app-arch", "columnId": 6173897}]'
ghToken: ${{ secrets.GITHUB_TOKEN }}
17 changes: 17 additions & 0 deletions .github/workflows/project-assigner.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
on:
issues:
types: [labeled, unlabeled]

jobs:
assign_to_project:
runs-on: ubuntu-latest
name: Assign issue or PR to project based on label
steps:
- name: Assign to project
uses: elastic/github-actions/project-assigner@v1.0.0
id: project_assigner
with:
issue-mappings: '[{"label": "Team:AppArch", "projectName": "kibana-app-arch", "columnId": 6173895}]'
ghToken: ${{ secrets.GITHUB_TOKEN }}


38 changes: 37 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ node scripts/makelogs --auth <username>:<password>
> The default username and password combination are `elastic:changeme`
> Make sure to execute `node scripts/makelogs` *after* elasticsearch is up and running!
### Running Elasticsearch Remotely

You can save some system resources, and the effort of generating sample data, if you have a remote Elasticsearch cluster to connect to. (**Elasticians: you do! Check with your team about where to find credentials**)
Expand All @@ -239,6 +240,41 @@ kibana.index: '.{YourGitHubHandle}-kibana'
xpack.task_manager.index: '.{YourGitHubHandle}-task-manager-kibana'
```

### Running remote clusters
Setup remote clusters for cross cluster search (CCS) and cross cluster replication (CCR).

Start your primary cluster by running:
```bash
yarn es snapshot -E path.data=../data_prod1
```

Start your remote cluster by running:
```bash
yarn es snapshot -E transport.port=9500 -E http.port=9201 -E path.data=../data_prod2
```

Once both clusters are running, start kibana. Kibana will connect to the primary cluster.

Setup the remote cluster in Kibana from either `Management` -> `Elasticsearch` -> `Remote Clusters` UI or by running the following script in `Console`.
```
PUT _cluster/settings
{
"persistent": {
"cluster": {
"remote": {
"cluster_one": {
"seeds": [
"localhost:9500"
]
}
}
}
}
}
```

Follow the [cross-cluster search](https://www.elastic.co/guide/en/kibana/current/management-cross-cluster-search.html) instructions for setting up index patterns to search across clusters.

### Running Kibana

Start the development server.
Expand Down Expand Up @@ -506,7 +542,7 @@ yarn test:browser --dev # remove the --dev flag to run them once and close
* In System Preferences > Sharing, change your computer name to be something simple, e.g. "computer".
* Run Kibana with `yarn start --host=computer.local` (substituting your computer name).
* Now you can run your VM, open the browser, and navigate to `http://computer.local:5601` to test Kibana.
* Alternatively you can use browserstack
* Alternatively you can use browserstack

#### Running Browser Automation Tests

Expand Down
34 changes: 20 additions & 14 deletions config/apm.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,22 @@ const { join } = require('path');
const { execSync } = require('child_process');
const merge = require('lodash.merge');

module.exports = merge({
active: false,
serverUrl: 'https://f1542b814f674090afd914960583265f.apm.us-central1.gcp.cloud.es.io:443',
// The secretToken below is intended to be hardcoded in this file even though
// it makes it public. This is not a security/privacy issue. Normally we'd
// instead disable the need for a secretToken in the APM Server config where
// the data is transmitted to, but due to how it's being hosted, it's easier,
// for now, to simply leave it in.
secretToken: 'R0Gjg46pE9K9wGestd',
globalLabels: {},
centralConfig: false,
logUncaughtExceptions: true
}, devConfig());
module.exports = merge(
{
active: false,
serverUrl: 'https://f1542b814f674090afd914960583265f.apm.us-central1.gcp.cloud.es.io:443',
// The secretToken below is intended to be hardcoded in this file even though
// it makes it public. This is not a security/privacy issue. Normally we'd
// instead disable the need for a secretToken in the APM Server config where
// the data is transmitted to, but due to how it's being hosted, it's easier,
// for now, to simply leave it in.
secretToken: 'R0Gjg46pE9K9wGestd',
globalLabels: {},
centralConfig: false,
logUncaughtExceptions: true,
},
devConfig()
);

const rev = gitRev();
if (rev !== null) module.exports.globalLabels.git_rev = rev;
Expand All @@ -66,7 +69,10 @@ try {

function gitRev() {
try {
return execSync('git rev-parse --short HEAD', { encoding: 'utf-8' }).trim();
return execSync('git rev-parse --short HEAD', {
encoding: 'utf-8',
stdio: ['ignore', 'pipe', 'ignore'],
}).trim();
} catch (e) {
return null;
}
Expand Down
19 changes: 19 additions & 0 deletions docs/apm/troubleshooting.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,22 @@ Finally, this problem can also occur if you've changed the index name that you w
The default index pattern can be found {apm-server-ref}/elasticsearch-output.html#index-option-es[here].
If you change this setting, you must also configure the `setup.template.name` and `setup.template.pattern` options.
See {apm-server-ref}/configuration-template.html[Load the Elasticsearch index template].

==== Unknown route

The {apm-app-ref}/transactions.html[transaction overview] will only display helpful information
when the transactions in your services are named correctly.
If you're seeing "GET unknown route" or "unknown route" in the APM app,
it could be a sign that something isn't working like it should.

Elastic APM Agents come with built-in support for popular frameworks out-of-the-box.
This means, among other things, that the Agent will try to automatically name HTTP requests.
As an example, the Node.js Agent uses the route that handled the request, while the Java Agent uses the Servlet name.

"Unknown route" indicates that the Agent can't determine what to name the request,
perhaps because the technology you're using isn't supported, the Agent has been installed incorrectly,
or because something is happening to the request that the Agent doesn't understand.

To resolve this, you'll need to head over to the relevant {apm-agents-ref}[Agent documentation].
Specifically, view the Agent's supported technologies page.
You can also use the Agent's public API to manually set a name for the transaction.
2 changes: 1 addition & 1 deletion docs/development/core/public/kibana-plugin-public.app.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ export interface App extends AppBase
| Property | Type | Description |
| --- | --- | --- |
| [chromeless](./kibana-plugin-public.app.chromeless.md) | <code>boolean</code> | Hide the UI chrome when the application is mounted. Defaults to <code>false</code>. Takes precedence over chrome service visibility settings. |
| [mount](./kibana-plugin-public.app.mount.md) | <code>(context: AppMountContext, params: AppMountParameters) =&gt; AppUnmount &#124; Promise&lt;AppUnmount&gt;</code> | A mount function called when the user navigates to this app's route. |
| [mount](./kibana-plugin-public.app.mount.md) | <code>AppMount &#124; AppMountDeprecated</code> | A mount function called when the user navigates to this app's route. May have signature of [AppMount](./kibana-plugin-public.appmount.md) or [AppMountDeprecated](./kibana-plugin-public.appmountdeprecated.md)<!-- -->. |
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@

## App.mount property

A mount function called when the user navigates to this app's route.
A mount function called when the user navigates to this app's route. May have signature of [AppMount](./kibana-plugin-public.appmount.md) or [AppMountDeprecated](./kibana-plugin-public.appmountdeprecated.md)<!-- -->.

<b>Signature:</b>

```typescript
mount: (context: AppMountContext, params: AppMountParameters) => AppUnmount | Promise<AppUnmount>;
mount: AppMount | AppMountDeprecated;
```

## Remarks

When function has two arguments, it will be called with a [context](./kibana-plugin-public.appmountcontext.md) as the first argument. This behavior is \*\*deprecated\*\*, and consumers should instead use [CoreSetup.getStartServices()](./kibana-plugin-public.coresetup.getstartservices.md)<!-- -->.

Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ export interface ApplicationSetup
| Method | Description |
| --- | --- |
| [register(app)](./kibana-plugin-public.applicationsetup.register.md) | Register an mountable application to the system. |
| [registerMountContext(contextName, provider)](./kibana-plugin-public.applicationsetup.registermountcontext.md) | Register a context provider for application mounting. Will only be available to applications that depend on the plugin that registered this context. |
| [registerMountContext(contextName, provider)](./kibana-plugin-public.applicationsetup.registermountcontext.md) | Register a context provider for application mounting. Will only be available to applications that depend on the plugin that registered this context. Deprecated, use [CoreSetup.getStartServices()](./kibana-plugin-public.coresetup.getstartservices.md)<!-- -->. |

Loading

0 comments on commit bdd834f

Please sign in to comment.