Skip to content

Commit

Permalink
Merge branch 'main' into ml-132675-not-found-page
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored May 31, 2022
2 parents 58d223c + ec7f3d7 commit 11be42e
Show file tree
Hide file tree
Showing 373 changed files with 14,402 additions and 2,968 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
steps:
- command: .buildkite/scripts/steps/functional/uptime.sh
label: 'Uptime @elastic/synthetics Tests'
- command: .buildkite/scripts/steps/functional/synthetics_plugin.sh
label: 'Synthetics @elastic/synthetics Tests'
agents:
queue: ci-group-6
depends_on: build
Expand Down
2 changes: 2 additions & 0 deletions .buildkite/pull_requests.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"skip_ci_labels": ["skip-ci", "jenkins-ci"],
"skip_target_branches": ["6.8", "7.11", "7.12"],
"skip_ci_on_only_changed": [
"^dev_docs/",
"^docs/",
"^rfcs/",
"^.ci/.+\\.yml$",
Expand All @@ -26,6 +27,7 @@
"^.ci/Jenkinsfile_[^/]+$",
"^\\.github/",
"\\.md$",
"\\.mdx$",
"^\\.backportrc\\.json$",
"^nav-kibana-dev\\.docnav\\.json$",
"^src/dev/prs/kibana_qa_pr_list\\.json$",
Expand Down
4 changes: 2 additions & 2 deletions .buildkite/scripts/pipelines/pull_request/pipeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ const uploadPipeline = (pipelineContent) => {
pipeline.push(getPipeline('.buildkite/pipelines/pull_request/osquery_cypress.yml'));
}

if (await doAnyChangesMatch([/^x-pack\/plugins\/uptime/])) {
pipeline.push(getPipeline('.buildkite/pipelines/pull_request/uptime.yml'));
if (await doAnyChangesMatch([/^x-pack\/plugins\/synthetics/])) {
pipeline.push(getPipeline('.buildkite/pipelines/pull_request/synthetics_plugin.yml'));
}

if (process.env.GITHUB_PR_LABELS.includes('ci:deploy-cloud')) {
Expand Down
4 changes: 2 additions & 2 deletions .buildkite/scripts/steps/functional/synthetics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ source .buildkite/scripts/common/util.sh

export JOB=kibana-uptime-playwright

echo "--- Uptime @elastic/synthetics Tests"
echo "--- synthetics @elastic/synthetics Tests"

cd "$XPACK_DIR"

checks-reporter-with-killswitch "Uptime @elastic/synthetics Tests" \
checks-reporter-with-killswitch "synthetics @elastic/synthetics Tests" \
node plugins/synthetics/scripts/e2e.js --kibana-install-dir "$KIBANA_BUILD_LOCATION" --grep "MonitorManagement-monitor*"
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ source .buildkite/scripts/common/util.sh
.buildkite/scripts/bootstrap.sh
.buildkite/scripts/download_build_artifacts.sh

export JOB=kibana-uptime-playwright
export JOB=kibana-synthetics-plugin

echo "--- Uptime @elastic/synthetics Tests"
echo "--- Synthetics plugin @elastic/synthetics Tests"

cd "$XPACK_DIR"

checks-reporter-with-killswitch "uptime plugin @elastic/synthetics Tests" \
checks-reporter-with-killswitch "Synthetics plugin @elastic/synthetics Tests" \
node plugins/synthetics/scripts/e2e.js --kibana-install-dir "$KIBANA_BUILD_LOCATION" ${GREP:+--grep \"${GREP}\"}
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ non-dev version and accepts any of the
https://www.elastic.co/guide/en/kibana/current/settings.html[standard
settings].

[discrete]
=== Using an Alternate YML File

To run Kibana with an alternate yml file, use the `--config` option to specify the path to the desired yml file. For example: `yarn start --config=config/my_config.yml`

[discrete]
=== Potential Optimization Pitfalls

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ Custom content to occur below the list of links
<b>Signature:</b>

```typescript
content?: (element: HTMLDivElement) => () => void;
content?: (element: HTMLDivElement, menuActions: ChromeHelpMenuActions) => () => void;
```
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ export interface ChromeHelpExtension
| Property | Type | Description |
| --- | --- | --- |
| [appName](./kibana-plugin-core-public.chromehelpextension.appname.md) | string | Provide your plugin's name to create a header for separation |
| [content?](./kibana-plugin-core-public.chromehelpextension.content.md) | (element: HTMLDivElement) =&gt; () =&gt; void | <i>(Optional)</i> Custom content to occur below the list of links |
| [content?](./kibana-plugin-core-public.chromehelpextension.content.md) | (element: HTMLDivElement, menuActions: ChromeHelpMenuActions) =&gt; () =&gt; void | <i>(Optional)</i> Custom content to occur below the list of links |
| [links?](./kibana-plugin-core-public.chromehelpextension.links.md) | ChromeHelpExtensionMenuLink\[\] | <i>(Optional)</i> Creates unified links for sending users to documentation, GitHub, Discuss, or a custom link/button |

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; [ChromeHelpMenuActions](./kibana-plugin-core-public.chromehelpmenuactions.md) &gt; [hideHelpMenu](./kibana-plugin-core-public.chromehelpmenuactions.hidehelpmenu.md)

## ChromeHelpMenuActions.hideHelpMenu property

The action provides the capability to hide the help menu from within the help extension content components.

<b>Signature:</b>

```typescript
hideHelpMenu: () => void;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!-- 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; [ChromeHelpMenuActions](./kibana-plugin-core-public.chromehelpmenuactions.md)

## ChromeHelpMenuActions interface

<b>Signature:</b>

```typescript
export interface ChromeHelpMenuActions
```

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [hideHelpMenu](./kibana-plugin-core-public.chromehelpmenuactions.hidehelpmenu.md) | () =&gt; void | |
1 change: 1 addition & 0 deletions docs/development/core/public/kibana-plugin-core-public.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
| [ChromeHelpExtensionMenuDiscussLink](./kibana-plugin-core-public.chromehelpextensionmenudiscusslink.md) | |
| [ChromeHelpExtensionMenuDocumentationLink](./kibana-plugin-core-public.chromehelpextensionmenudocumentationlink.md) | |
| [ChromeHelpExtensionMenuGitHubLink](./kibana-plugin-core-public.chromehelpextensionmenugithublink.md) | |
| [ChromeHelpMenuActions](./kibana-plugin-core-public.chromehelpmenuactions.md) | List of actions in order to manipulate with the help menu from the help extensions content components. |
| [ChromeNavControl](./kibana-plugin-core-public.chromenavcontrol.md) | |
| [ChromeNavControls](./kibana-plugin-core-public.chromenavcontrols.md) | [APIs](./kibana-plugin-core-public.chromenavcontrols.md) for registering new controls to be displayed in the navigation bar. |
| [ChromeNavLink](./kibana-plugin-core-public.chromenavlink.md) | |
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@
"@kbn/apm-utils": "link:bazel-bin/packages/kbn-apm-utils",
"@kbn/coloring": "link:bazel-bin/packages/kbn-coloring",
"@kbn/config": "link:bazel-bin/packages/kbn-config",
"@kbn/config-mocks": "link:bazel-bin/packages/kbn-config-mocks",
"@kbn/config-schema": "link:bazel-bin/packages/kbn-config-schema",
"@kbn/crypto": "link:bazel-bin/packages/kbn-crypto",
"@kbn/datemath": "link:bazel-bin/packages/kbn-datemath",
Expand Down Expand Up @@ -633,6 +634,7 @@
"@types/kbn__cli-dev-mode": "link:bazel-bin/packages/kbn-cli-dev-mode/npm_module_types",
"@types/kbn__coloring": "link:bazel-bin/packages/kbn-coloring/npm_module_types",
"@types/kbn__config": "link:bazel-bin/packages/kbn-config/npm_module_types",
"@types/kbn__config-mocks": "link:bazel-bin/packages/kbn-config-mocks/npm_module_types",
"@types/kbn__config-schema": "link:bazel-bin/packages/kbn-config-schema/npm_module_types",
"@types/kbn__crypto": "link:bazel-bin/packages/kbn-crypto/npm_module_types",
"@types/kbn__datemath": "link:bazel-bin/packages/kbn-datemath/npm_module_types",
Expand Down
2 changes: 2 additions & 0 deletions packages/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ filegroup(
"//packages/kbn-ci-stats-reporter:build",
"//packages/kbn-cli-dev-mode:build",
"//packages/kbn-coloring:build",
"//packages/kbn-config-mocks:build",
"//packages/kbn-config-schema:build",
"//packages/kbn-config:build",
"//packages/kbn-crypto:build",
Expand Down Expand Up @@ -146,6 +147,7 @@ filegroup(
"//packages/kbn-ci-stats-reporter:build_types",
"//packages/kbn-cli-dev-mode:build_types",
"//packages/kbn-coloring:build_types",
"//packages/kbn-config-mocks:build_types",
"//packages/kbn-config-schema:build_types",
"//packages/kbn-config:build_types",
"//packages/kbn-crypto:build_types",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ it('produces the right watch and ignore list', () => {
<absolute path>/x-pack/plugins/lists/server/scripts,
<absolute path>/x-pack/plugins/security_solution/scripts,
<absolute path>/x-pack/plugins/security_solution/server/lib/detection_engine/scripts,
<absolute path>/x-pack/plugins/uptime/e2e,
<absolute path>/x-pack/plugins/synthetics/e2e,
]
`);
});
2 changes: 1 addition & 1 deletion packages/kbn-cli-dev-mode/src/get_server_watch_paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export function getServerWatchPaths({ pluginPaths, pluginScanDirs }: Options) {
fromRoot('x-pack/plugins/lists/server/scripts'),
fromRoot('x-pack/plugins/security_solution/scripts'),
fromRoot('x-pack/plugins/security_solution/server/lib/detection_engine/scripts'),
fromRoot('x-pack/plugins/uptime/e2e'),
fromRoot('x-pack/plugins/synthetics/e2e'),
];

return {
Expand Down
98 changes: 98 additions & 0 deletions packages/kbn-config-mocks/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
load("@npm//@bazel/typescript:index.bzl", "ts_config")
load("@build_bazel_rules_nodejs//:index.bzl", "js_library")
load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project")

PKG_DIRNAME = "kbn-config-mocks"
PKG_REQUIRE_NAME = "@kbn/config-mocks"

SOURCE_FILES = glob(
[
"src/**/*.ts",
],
exclude = [
"**/*.test.*",
],
)

SRCS = SOURCE_FILES

filegroup(
name = "srcs",
srcs = SRCS,
)

NPM_MODULE_EXTRA_FILES = [
"package.json",
]

RUNTIME_DEPS = [
"//packages/kbn-config",
]

TYPES_DEPS = [
"@npm//rxjs",
"@npm//@types/node",
"@npm//@types/jest",
"//packages/kbn-config:npm_module_types",
]

jsts_transpiler(
name = "target_node",
srcs = SRCS,
build_pkg_name = package_name(),
)

ts_config(
name = "tsconfig",
src = "tsconfig.json",
deps = [
"//:tsconfig.base.json",
"//:tsconfig.bazel.json",
],
)

ts_project(
name = "tsc_types",
args = ['--pretty'],
srcs = SRCS,
deps = TYPES_DEPS,
declaration = True,
emit_declaration_only = True,
out_dir = "target_types",
root_dir = "src",
tsconfig = ":tsconfig",
)

js_library(
name = PKG_DIRNAME,
srcs = NPM_MODULE_EXTRA_FILES,
deps = RUNTIME_DEPS + [":target_node"],
package_name = PKG_REQUIRE_NAME,
visibility = ["//visibility:public"],
)

pkg_npm(
name = "npm_module",
deps = [":" + PKG_DIRNAME],
)

filegroup(
name = "build",
srcs = [":npm_module"],
visibility = ["//visibility:public"],
)

pkg_npm_types(
name = "npm_module_types",
srcs = SRCS,
deps = [":tsc_types"],
package_name = PKG_REQUIRE_NAME,
tsconfig = ":tsconfig",
visibility = ["//visibility:public"],
)

filegroup(
name = "build_types",
srcs = [":npm_module_types"],
visibility = ["//visibility:public"],
)
3 changes: 3 additions & 0 deletions packages/kbn-config-mocks/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# @kbn/config-mocks

This package contains the mocks related to the `@kbn/config` package
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@
* Side Public License, v 1.
*/

export default function ({ loadTestFile }) {
describe('index_patterns/_fields_for_time_pattern', () => {
loadTestFile(require.resolve('./errors'));
loadTestFile(require.resolve('./pattern'));
loadTestFile(require.resolve('./query_params'));
});
}
module.exports = {
preset: '@kbn/test/jest_node',
rootDir: '../..',
roots: ['<rootDir>/packages/kbn-config-mocks'],
};
7 changes: 7 additions & 0 deletions packages/kbn-config-mocks/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "@kbn/config-mocks",
"private": true,
"version": "1.0.0",
"main": "./target_node/index.js",
"license": "SSPL-1.0 OR Elastic License 2.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
* Side Public License, v 1.
*/

import { Config } from './config';
import type { Config } from '@kbn/config';

type ConfigMock = jest.Mocked<Config>;
export type ConfigMock = jest.Mocked<Config>;

const createConfigMock = (): ConfigMock => ({
has: jest.fn(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
*/

import { BehaviorSubject } from 'rxjs';
import { ObjectToConfigAdapter } from './object_to_config_adapter';
import { ObjectToConfigAdapter, IConfigService } from '@kbn/config';

import { IConfigService } from './config_service';
export type IConfigServiceMock = jest.Mocked<IConfigService>;

const createConfigServiceMock = ({
atPath = {},
getConfig$ = {},
}: { atPath?: Record<string, any>; getConfig$?: Record<string, any> } = {}) => {
const mocked: jest.Mocked<IConfigService> = {
const mocked: IConfigServiceMock = {
atPath: jest.fn(),
atPathSync: jest.fn(),
getConfig$: jest.fn(),
Expand All @@ -37,6 +37,7 @@ const createConfigServiceMock = ({
mocked.getUnusedPaths.mockResolvedValue([]);
mocked.isEnabledAtPath.mockResolvedValue(true);
mocked.getHandledDeprecatedConfigs.mockReturnValue([]);

return mocked;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
*/

import type { DocLinks } from '@kbn/doc-links';
import type { ConfigDeprecationContext } from './types';
import type { ConfigDeprecationContext } from '@kbn/config';

export type ConfigDeprecationContextMock = ConfigDeprecationContext;

const createMockedContext = (): ConfigDeprecationContext => {
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
* Side Public License, v 1.
*/

// Test helpers to simplify mocking environment options.

import { EnvOptions } from '../env';
import type { EnvOptions } from '@kbn/config';

type DeepPartial<T> = {
[P in keyof T]?: T[P] extends Array<infer R> ? Array<DeepPartial<R>> : DeepPartial<T[P]>;
Expand Down
21 changes: 21 additions & 0 deletions packages/kbn-config-mocks/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

export { rawConfigServiceMock } from './raw_config_service.mock';
export type { RawConfigServiceMock } from './raw_config_service.mock';

export { configMock } from './config.mock';
export type { ConfigMock } from './config.mock';

export { configServiceMock } from './config_service.mock';
export type { IConfigServiceMock } from './config_service.mock';

export { configDeprecationsMock } from './deprecations.mock';
export type { ConfigDeprecationContextMock } from './deprecations.mock';

export { getEnvOptions } from './env.mock';
Loading

0 comments on commit 11be42e

Please sign in to comment.