Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into lens/fix-persiste…
Browse files Browse the repository at this point in the history
…nce-bug-72855
  • Loading branch information
flash1293 committed Aug 6, 2020
2 parents 94293c2 + 13fd9e3 commit 8e182aa
Show file tree
Hide file tree
Showing 687 changed files with 2,819 additions and 1,521 deletions.
13 changes: 13 additions & 0 deletions .ci/pipeline-library/src/test/prChanges.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,17 @@ class PrChangesTest extends KibanaBasePipelineTest {

assertFalse(prChanges.areChangesSkippable())
}

@Test
void 'areChangesSkippable() with plugin readme changes'() {
props([
githubPrs: [
getChanges: { [
[filename: 'src/plugins/foo/README.asciidoc'],
] },
],
])

assertFalse(prChanges.areChangesSkippable())
}
}
6 changes: 0 additions & 6 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,6 @@ module.exports = {
'react-hooks/rules-of-hooks': 'off',
},
},
{
files: ['x-pack/plugins/lens/**/*.{js,mjs,ts,tsx}'],
rules: {
'react-hooks/exhaustive-deps': 'off',
},
},
{
files: ['x-pack/plugins/ml/**/*.{js,mjs,ts,tsx}'],
rules: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<b>Signature:</b>

```typescript
export interface ISyncStateRef<stateStorage extends IStateStorage = IStateStorage>
export interface ISyncStateRef<StateStorage extends IStateStorage = IStateStorage>
```

## Properties
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/user/monitoring/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ include::xpack-monitoring.asciidoc[]
include::beats-details.asciidoc[leveloffset=+1]
include::cluster-alerts.asciidoc[leveloffset=+1]
include::elasticsearch-details.asciidoc[leveloffset=+1]
include::kibana-alerts.asciidoc[leveloffset=+1]
include::kibana-details.asciidoc[leveloffset=+1]
include::logstash-details.asciidoc[leveloffset=+1]
include::monitoring-troubleshooting.asciidoc[leveloffset=+1]
36 changes: 36 additions & 0 deletions docs/user/monitoring/kibana-alerts.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
[role="xpack"]
[[kibana-alerts]]
= {kib} Alerts

The {stack} {monitor-features} provide
<<alerting-getting-started,{kib} alerts>> out-of-the box to notify you of
potential issues in the {stack}. These alerts are preconfigured based on the
best practices recommended by Elastic. However, you can tailor them to meet your
specific needs.

When you open *{stack-monitor-app}*, the preconfigured {kib} alerts are
created automatically. If you collect monitoring data from multiple clusters,
these alerts can search, detect, and notify on various conditions across the
clusters. The alerts are visible alongside your existing {watcher} cluster
alerts. You can view details about the alerts that are active and view health
and performance data for {es}, {ls}, and Beats in real time, as well as
analyze past performance. You can also modify active alerts.

[role="screenshot"]
image::user/monitoring/images/monitoring-kibana-alerts.png["Kibana alerts in the Stack Monitoring app"]

To review and modify all the available alerts, use
<<managing-alerts-and-actions,*{alerts-ui}*>> in *{stack-manage-app}*.

[discrete]
[[kibana-alerts-cpu-threshold]]
== CPU threshold

This alert is triggered when a node runs a consistently high CPU load. By
default, the trigger condition is set at 85% or more averaged over the last 5
minutes. The alert is grouped across all the nodes of the cluster by running
checks on a schedule time of 1 minute with a re-notify internal of 1 day.

NOTE: Some action types are subscription features, while others are free.
For a comparison of the Elastic subscription levels, see the alerting section of
the {subscriptions}[Subscriptions page].
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import { ALERTING_EXAMPLE_APP_ID } from '../../common/constants';

export const CreateAlert = ({
http,
// eslint-disable-next-line @typescript-eslint/naming-convention
triggers_actions_ui,
charts,
uiSettings,
Expand Down
1 change: 1 addition & 0 deletions examples/alerting_example/public/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export interface AlertingExamplePublicStartDeps {
export class AlertingExamplePlugin implements Plugin<Setup, Start, AlertingExamplePublicSetupDeps> {
public setup(
core: CoreSetup<AlertingExamplePublicStartDeps, Start>,
// eslint-disable-next-line @typescript-eslint/naming-convention
{ alerts, triggers_actions_ui, developerExamples }: AlertingExamplePublicSetupDeps
) {
core.application.register({
Expand Down
1 change: 0 additions & 1 deletion kibana.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import * as LegacyKibanaServer from './src/legacy/server/kbn_server';
/**
* Re-export legacy types under a namespace.
*/
// eslint-disable-next-line @typescript-eslint/no-namespace
export namespace Legacy {
export type KibanaConfig = LegacyKibanaServer.KibanaConfig;
export type Request = LegacyKibanaServer.Request;
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,8 @@
"@types/vinyl": "^2.0.4",
"@types/vinyl-fs": "^2.4.11",
"@types/zen-observable": "^0.8.0",
"@typescript-eslint/eslint-plugin": "^2.34.0",
"@typescript-eslint/parser": "^2.34.0",
"@typescript-eslint/eslint-plugin": "^3.7.1",
"@typescript-eslint/parser": "^3.7.1",
"angular-mocks": "^1.7.9",
"archiver": "^3.1.1",
"axe-core": "^3.4.1",
Expand All @@ -425,6 +425,7 @@
"eslint-plugin-babel": "^5.3.0",
"eslint-plugin-ban": "^1.4.0",
"eslint-plugin-cypress": "^2.8.1",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-import": "^2.19.1",
"eslint-plugin-jest": "^23.10.0",
"eslint-plugin-jsx-a11y": "^6.2.3",
Expand Down
9 changes: 5 additions & 4 deletions packages/eslint-config-kibana/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,18 @@
"author": "Spencer Alger <[email protected]>",
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/elastic/eslint-config-kibana/issues"
"url": "https://github.com/elastic/kibana/tree/master/packages/eslint-config-kibana"
},
"homepage": "https://github.com/elastic/eslint-config-kibana#readme",
"homepage": "https://github.com/elastic/kibana/tree/master/packages/eslint-config-kibana",
"peerDependencies": {
"@typescript-eslint/eslint-plugin": "^2.34.0",
"@typescript-eslint/parser": "^2.34.0",
"@typescript-eslint/eslint-plugin": "^3.7.1",
"@typescript-eslint/parser": "^3.7.1",
"babel-eslint": "^10.0.3",
"eslint": "^6.8.0",
"eslint-plugin-babel": "^5.3.0",
"eslint-plugin-ban": "^1.4.0",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-import": "^2.19.1",
"eslint-plugin-jest": "^23.10.0",
"eslint-plugin-mocha": "^6.2.2",
Expand Down
91 changes: 84 additions & 7 deletions packages/eslint-config-kibana/typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ const PKG = require('../../package.json');

const eslintConfigPrettierTypescriptEslintRules = require('eslint-config-prettier/@typescript-eslint').rules;

// The current implementation excluded all the variables matching the regexp.
// We should remove it as soon as multiple underscores are supported by the linter.
// https://github.com/typescript-eslint/typescript-eslint/issues/1712
// Due to the same reason we have to duplicate the "filter" option for "default" and other "selectors".
const allowedNameRegexp = '^(UNSAFE_|_{1,3})|_{1,3}$';
module.exports = {
overrides: [
{
Expand All @@ -19,6 +24,7 @@ module.exports = {
'ban',
'import',
'prefer-object-spread',
'eslint-comments'
],

settings: {
Expand Down Expand Up @@ -87,16 +93,82 @@ module.exports = {
'React.StatelessComponent': {
message: 'Use FunctionComponent instead.',
fixWith: 'React.FunctionComponent'
}
},
// used in the codebase in the wild
'{}': false,
'object': false,
'Function': false,
}
}],
'camelcase': 'off',
'@typescript-eslint/camelcase': ['error', {
'properties': 'never',
'ignoreDestructuring': true,
'allow': ['^[A-Z0-9_]+$', '^UNSAFE_']
}],
'@typescript-eslint/class-name-casing': 'error',
'@typescript-eslint/naming-convention': [
'error',
{
selector: 'default',
format: ['camelCase'],
filter: {
regex: allowedNameRegexp,
match: false
}
},
{
selector: 'variable',
format: [
'camelCase',
'UPPER_CASE', // const SOMETHING = ...
'PascalCase', // React.FunctionComponent =
],
filter: {
regex: allowedNameRegexp,
match: false
}
},
{
selector: 'parameter',
format: [
'camelCase',
'PascalCase',
],
filter: {
regex: allowedNameRegexp,
match: false
}
},
{
selector: 'memberLike',
format: [
'camelCase',
'PascalCase',
'snake_case', // keys in elasticsearch requests / responses
'UPPER_CASE'
],
filter: {
regex: allowedNameRegexp,
match: false
}
},
{
selector: 'function',
format: [
'camelCase',
'PascalCase' // React.FunctionComponent =
],
filter: {
regex: allowedNameRegexp,
match: false
}
},
{
selector: 'typeLike',
format: ['PascalCase', 'UPPER_CASE'],
leadingUnderscore: 'allow',
trailingUnderscore: 'allow',
},
{
selector: 'enum',
format: ['PascalCase', 'UPPER_CASE', 'camelCase'],
},
],
'@typescript-eslint/explicit-member-accessibility': ['error',
{
accessibility: 'off',
Expand Down Expand Up @@ -145,10 +217,12 @@ module.exports = {
'no-extend-native': 'error',
'no-eval': 'error',
'no-new-wrappers': 'error',
'no-script-url': 'error',
'no-shadow': 'error',
'no-throw-literal': 'error',
'no-undef-init': 'error',
'no-unsafe-finally': 'error',
'no-unsanitized/property': 'error',
'no-unused-expressions': 'error',
'no-unused-labels': 'error',
'no-var': 'error',
Expand All @@ -171,6 +245,9 @@ module.exports = {

],
'import/no-default-export': 'error',

'eslint-comments/no-unused-disable': 'error',
'eslint-comments/no-unused-enable': 'error'
},
eslintConfigPrettierTypescriptEslintRules
)
Expand Down
4 changes: 2 additions & 2 deletions packages/kbn-plugin-helpers/src/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ export function babelRegister() {

try {
// add support for moved @babel/register source: https://github.com/elastic/kibana/pull/13973
require(resolve(plugin.kibanaRoot, 'src/setup_node_env/babel_register')); // eslint-disable-line import/no-dynamic-require
require(resolve(plugin.kibanaRoot, 'src/setup_node_env/babel_register'));
} catch (error) {
if (error.code === 'MODULE_NOT_FOUND') {
require(resolve(plugin.kibanaRoot, 'src/optimize/babel/register')); // eslint-disable-line import/no-dynamic-require
require(resolve(plugin.kibanaRoot, 'src/optimize/babel/register'));
} else {
throw error;
}
Expand Down
2 changes: 1 addition & 1 deletion src/cli/cluster/cluster_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,6 @@ export class ClusterManager {

onWatcherError = (err: any) => {
this.log.bad('failed to watch files!\n', err.stack);
process.exit(1); // eslint-disable-line no-process-exit
process.exit(1);
};
}
2 changes: 0 additions & 2 deletions src/core/server/config/config_service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
* under the License.
*/

/* eslint-disable max-classes-per-file */

import { BehaviorSubject, Observable } from 'rxjs';
import { first, take } from 'rxjs/operators';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
* under the License.
*/

import { resolve } from 'path';
import supertest from 'supertest';
import { BehaviorSubject } from 'rxjs';
import { ByteSizeValue } from '@kbn/config-schema';
import pkg from '../../../../../package.json';

import { createHttpServer } from '../test_utils';
import { HttpService } from '../http_service';
Expand All @@ -30,8 +30,7 @@ import { IRouter, RouteRegistrar } from '../router';
import { configServiceMock } from '../../config/config_service.mock';
import { contextServiceMock } from '../../context/context_service.mock';

const pkgPath = resolve(__dirname, '../../../../../package.json');
const actualVersion = require(pkgPath).version;
const actualVersion = pkg.version;
const versionHeader = 'kbn-version';
const xsrfHeader = 'kbn-xsrf';
const nameHeader = 'kbn-name';
Expand Down
1 change: 1 addition & 0 deletions src/core/server/legacy/legacy_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@ export class LegacyService implements CoreService {
// from being started multiple times in different processes.
// We only want one REPL.
if (this.coreContext.env.cliArgs.repl && process.env.kbnWorkerType === 'server') {
// eslint-disable-next-line @typescript-eslint/no-var-requires
require('../../../cli/repl').startRepl(kbnServer);
}

Expand Down
2 changes: 0 additions & 2 deletions src/core/server/saved_objects/migrations/core/call_cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

import { IndexMapping } from '../../mappings';

/* eslint-disable @typescript-eslint/unified-signatures */
export interface CallCluster {
(path: 'bulk', opts: { body: object[] }): Promise<BulkResult>;
(path: 'count', opts: CountOpts): Promise<{ count: number; _shards: ShardsInfo }>;
Expand All @@ -49,7 +48,6 @@ export interface CallCluster {
error?: ErrorResponse;
}>;
}
/* eslint-enable @typescript-eslint/unified-signatures */

///////////////////////////////////////////////////////////////////
// callCluster argument type definitions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ import { registerBulkCreateRoute } from '../bulk_create';
import { savedObjectsClientMock } from '../../../../../core/server/mocks';
import { setupServer } from '../test_utils';

type setupServerReturn = UnwrapPromise<ReturnType<typeof setupServer>>;
type SetupServerReturn = UnwrapPromise<ReturnType<typeof setupServer>>;

describe('POST /api/saved_objects/_bulk_create', () => {
let server: setupServerReturn['server'];
let httpSetup: setupServerReturn['httpSetup'];
let handlerContext: setupServerReturn['handlerContext'];
let server: SetupServerReturn['server'];
let httpSetup: SetupServerReturn['httpSetup'];
let handlerContext: SetupServerReturn['handlerContext'];
let savedObjectsClient: ReturnType<typeof savedObjectsClientMock.create>;

beforeEach(async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ import { registerBulkGetRoute } from '../bulk_get';
import { savedObjectsClientMock } from '../../../../../core/server/mocks';
import { setupServer } from '../test_utils';

type setupServerReturn = UnwrapPromise<ReturnType<typeof setupServer>>;
type SetupServerReturn = UnwrapPromise<ReturnType<typeof setupServer>>;

describe('POST /api/saved_objects/_bulk_get', () => {
let server: setupServerReturn['server'];
let httpSetup: setupServerReturn['httpSetup'];
let handlerContext: setupServerReturn['handlerContext'];
let server: SetupServerReturn['server'];
let httpSetup: SetupServerReturn['httpSetup'];
let handlerContext: SetupServerReturn['handlerContext'];
let savedObjectsClient: ReturnType<typeof savedObjectsClientMock.create>;

beforeEach(async () => {
Expand Down
Loading

0 comments on commit 8e182aa

Please sign in to comment.