Skip to content

Commit

Permalink
Merge branch 'main' of github.com:elastic/kibana into issue-119501-in…
Browse files Browse the repository at this point in the history
…crease-composite-size-metric-threshold
  • Loading branch information
simianhacker committed Jan 6, 2022
2 parents 5d6f9fc + 34d7ca6 commit 8d94f9d
Show file tree
Hide file tree
Showing 684 changed files with 31,502 additions and 589,019 deletions.
9 changes: 6 additions & 3 deletions .backportrc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"upstream": "elastic/kibana",
"repoOwner": "elastic",
"repoName": "kibana",
"targetBranchChoices": [
{ "name": "main", "checked": true },
"main",
"8.0",
"7.17",
"7.16",
Expand Down Expand Up @@ -32,7 +33,9 @@
"6.0",
"5.6"
],
"targetPRLabels": ["backport"],
"targetPRLabels": [
"backport"
],
"branchLabelMapping": {
"^v8.1.0$": "main",
"^v(\\d+).(\\d+).\\d+$": "$1.$2"
Expand Down
4 changes: 3 additions & 1 deletion .buildkite/pipelines/flaky_tests/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ function getTestSuitesFromMetadata() {
}

const value =
overrideCount || execSync(`buildkite-agent meta-data get '${key}'`).toString().trim();
overrideCount && overrideCount !== '0'
? overrideCount
: execSync(`buildkite-agent meta-data get '${key}'`).toString().trim();

const count = value === '' ? defaultCount : parseInt(value);
testSuites.push({
Expand Down
9 changes: 8 additions & 1 deletion .buildkite/scripts/common/setup_node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,14 @@ YARN_VERSION=$(node -e "console.log(String(require('./package.json').engines.yar
export YARN_VERSION

if [[ ! $(which yarn) || $(yarn --version) != "$YARN_VERSION" ]]; then
npm install -g "yarn@^${YARN_VERSION}"
rm -rf "$(npm root -g)/yarn" # in case the directory is in a bad state
if [[ ! $(npm install -g "yarn@^${YARN_VERSION}") ]]; then
# If this command is terminated early, e.g. because the build was cancelled in buildkite,
# a yarn directory is left behind in a bad state that can cause all subsequent installs to fail
rm -rf "$(npm root -g)/yarn"
echo "Trying again to install yarn..."
npm install -g "yarn@^${YARN_VERSION}"
fi
fi

yarn config set yarn-offline-mirror "$YARN_OFFLINE_CACHE"
Expand Down
18 changes: 16 additions & 2 deletions .buildkite/scripts/lifecycle/pre_command.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,22 @@ export BUILDKITE_TOKEN

echo '--- Install buildkite dependencies'
cd '.buildkite'
retry 5 15 yarn install --production --pure-lockfile
cd -

# If this yarn install is terminated early, e.g. if the build is cancelled in buildkite,
# A node module could end up in a bad state that can cause all future builds to fail
# So, let's cache clean and try again to make sure that's not what caused the error
install_deps() {
yarn install --production --pure-lockfile
EXIT=$?
if [[ "$EXIT" != "0" ]]; then
yarn cache clean
fi
return $EXIT
}

retry 5 15 install_deps

cd ..

node .buildkite/scripts/lifecycle/print_agent_links.js || true

Expand Down
45 changes: 23 additions & 22 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@
/src/plugins/input_control_vis/ @elastic/kibana-presentation
/src/plugins/vis_type_markdown/ @elastic/kibana-presentation
/src/plugins/presentation_util/ @elastic/kibana-presentation
/src/plugins/controls/ @elastic/kibana-presentation
/test/functional/apps/dashboard/ @elastic/kibana-presentation
/test/functional/apps/dashboard_elements/ @elastic/kibana-presentation
/x-pack/plugins/canvas/ @elastic/kibana-presentation
Expand Down Expand Up @@ -365,28 +366,28 @@
/x-pack/plugins/enterprise_search/server/collectors/workplace_search/ @elastic/workplace-search-frontend
/x-pack/plugins/enterprise_search/server/saved_objects/workplace_search/ @elastic/workplace-search-frontend

# Stack Management
/src/plugins/dev_tools/ @elastic/kibana-stack-management
/src/plugins/console/ @elastic/kibana-stack-management
/src/plugins/es_ui_shared/ @elastic/kibana-stack-management
/src/plugins/management/ @elastic/kibana-stack-management
/x-pack/plugins/cross_cluster_replication/ @elastic/kibana-stack-management
/x-pack/plugins/index_lifecycle_management/ @elastic/kibana-stack-management
/x-pack/plugins/grokdebugger/ @elastic/kibana-stack-management
/x-pack/plugins/index_management/ @elastic/kibana-stack-management
/x-pack/plugins/license_api_guard/ @elastic/kibana-stack-management
/x-pack/plugins/license_management/ @elastic/kibana-stack-management
/x-pack/plugins/painless_lab/ @elastic/kibana-stack-management
/x-pack/plugins/remote_clusters/ @elastic/kibana-stack-management
/x-pack/plugins/rollup/ @elastic/kibana-stack-management
/x-pack/plugins/searchprofiler/ @elastic/kibana-stack-management
/x-pack/plugins/snapshot_restore/ @elastic/kibana-stack-management
/x-pack/plugins/upgrade_assistant/ @elastic/kibana-stack-management
/x-pack/plugins/watcher/ @elastic/kibana-stack-management
/x-pack/plugins/ingest_pipelines/ @elastic/kibana-stack-management
/packages/kbn-ace/ @elastic/kibana-stack-management
/packages/kbn-monaco/ @elastic/kibana-stack-management
#CC# /x-pack/plugins/cross_cluster_replication/ @elastic/kibana-stack-management
# Management Experience - Deployment Management
/src/plugins/dev_tools/ @elastic/platform-deployment-management
/src/plugins/console/ @elastic/platform-deployment-management
/src/plugins/es_ui_shared/ @elastic/platform-deployment-management
/src/plugins/management/ @elastic/platform-deployment-management
/x-pack/plugins/cross_cluster_replication/ @elastic/platform-deployment-management
/x-pack/plugins/index_lifecycle_management/ @elastic/platform-deployment-management
/x-pack/plugins/grokdebugger/ @elastic/platform-deployment-management
/x-pack/plugins/index_management/ @elastic/platform-deployment-management
/x-pack/plugins/license_api_guard/ @elastic/platform-deployment-management
/x-pack/plugins/license_management/ @elastic/platform-deployment-management
/x-pack/plugins/painless_lab/ @elastic/platform-deployment-management
/x-pack/plugins/remote_clusters/ @elastic/platform-deployment-management
/x-pack/plugins/rollup/ @elastic/platform-deployment-management
/x-pack/plugins/searchprofiler/ @elastic/platform-deployment-management
/x-pack/plugins/snapshot_restore/ @elastic/platform-deployment-management
/x-pack/plugins/upgrade_assistant/ @elastic/platform-deployment-management
/x-pack/plugins/watcher/ @elastic/platform-deployment-management
/x-pack/plugins/ingest_pipelines/ @elastic/platform-deployment-management
/packages/kbn-ace/ @elastic/platform-deployment-management
/packages/kbn-monaco/ @elastic/platform-deployment-management
#CC# /x-pack/plugins/cross_cluster_replication/ @elastic/platform-deployment-management

# Security Solution
/x-pack/test/endpoint_api_integration_no_ingest/ @elastic/security-solution
Expand Down
1 change: 1 addition & 0 deletions .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"discover": "src/plugins/discover",
"bfetch": "src/plugins/bfetch",
"dashboard": "src/plugins/dashboard",
"controls": "src/plugins/controls",
"data": "src/plugins/data",
"dataViews": "src/plugins/data_views",
"embeddableApi": "src/plugins/embeddable",
Expand Down
6 changes: 3 additions & 3 deletions docs/developer/best-practices/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,16 @@ services you should consider:

* {kib-repo}tree/{branch}/src/plugins/data/README.md[Data
services]
** {kib-repo}tree/{branch}/src/plugins/data/public/search/README.md[Search
** {kib-repo}tree/{branch}/src/plugins/data/README.mdx#search[Search
strategies]
*** Use the `esSearchStrategy` to make raw queries to ES that will
support async searching and partial results, as well as injecting the
right advanced settings like whether to include frozen indices or not.
* {kib-repo}tree/{branch}/src/plugins/embeddable/README.md[Embeddables]
* {kib-repo}tree/{branch}/src/plugins/embeddable/README.asciidoc[Embeddables]
** Rendering maps, visualizations, dashboards in your application
** Register new widgets that will can be added to a dashboard or Canvas
workpad, or rendered in another plugin.
* {kib-repo}tree/{branch}/src/plugins/ui_actions/README.md[UiActions]
* {kib-repo}tree/{branch}/src/plugins/ui_actions/README.asciidoc[UiActions]
** Let other plugins inject functionality into your application
** Inject custom functionality into other plugins
* Stateless helper utilities
Expand Down
4 changes: 4 additions & 0 deletions docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ as uiSettings within the code.
|Console provides the user with tools for storing and executing requests against Elasticsearch.
|{kib-repo}blob/{branch}/src/plugins/controls/README.mdx[controls]
|The Controls plugin contains Embeddables which can be used to add user-friendly interactivity to apps.
|{kib-repo}blob/{branch}/src/plugins/custom_integrations/README.md[customIntegrations]
|Register add-data cards
Expand Down
2 changes: 2 additions & 0 deletions docs/development/core/server/kibana-plugin-core-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
| [SavedObjectsUpdateObjectsSpacesResponseObject](./kibana-plugin-core-server.savedobjectsupdateobjectsspacesresponseobject.md) | Details about a specific object's update result. |
| [SavedObjectsUpdateOptions](./kibana-plugin-core-server.savedobjectsupdateoptions.md) | |
| [SavedObjectsUpdateResponse](./kibana-plugin-core-server.savedobjectsupdateresponse.md) | |
| [SavedObjectsValidationMap](./kibana-plugin-core-server.savedobjectsvalidationmap.md) | A map of [validation specs](./kibana-plugin-core-server.savedobjectsvalidationspec.md) to be used for a given type. The map's keys must be valid semver versions.<!-- -->Any time you change the schema of a [SavedObjectsType](./kibana-plugin-core-server.savedobjectstype.md)<!-- -->, you should add a new entry to this map for the Kibana version the change was introduced in. |
| [SearchResponse](./kibana-plugin-core-server.searchresponse.md) | |
| [ServiceStatus](./kibana-plugin-core-server.servicestatus.md) | The current status of a service at a point in time. |
| [SessionCookieValidationResult](./kibana-plugin-core-server.sessioncookievalidationresult.md) | Return type from a function to validate cookie contents. |
Expand Down Expand Up @@ -320,6 +321,7 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
| [SavedObjectsImportHook](./kibana-plugin-core-server.savedobjectsimporthook.md) | A hook associated with a specific saved object type, that will be invoked during the import process. The hook will have access to the objects of the registered type.<!-- -->Currently, the only supported feature for import hooks is to return warnings to be displayed in the UI when the import succeeds. The only interactions the hook can have with the import process is via the hook's response. Mutating the objects inside the hook's code will have no effect. |
| [SavedObjectsImportWarning](./kibana-plugin-core-server.savedobjectsimportwarning.md) | Composite type of all the possible types of import warnings.<!-- -->See [SavedObjectsImportSimpleWarning](./kibana-plugin-core-server.savedobjectsimportsimplewarning.md) and [SavedObjectsImportActionRequiredWarning](./kibana-plugin-core-server.savedobjectsimportactionrequiredwarning.md) for more details. |
| [SavedObjectsNamespaceType](./kibana-plugin-core-server.savedobjectsnamespacetype.md) | The namespace type dictates how a saved object can be interacted in relation to namespaces. Each type is mutually exclusive: \* single (default): This type of saved object is namespace-isolated, e.g., it exists in only one namespace. \* multiple: This type of saved object is shareable, e.g., it can exist in one or more namespaces. \* multiple-isolated: This type of saved object is namespace-isolated, e.g., it exists in only one namespace, but object IDs must be unique across all namespaces. This is intended to be an intermediate step when objects with a "single" namespace type are being converted to a "multiple" namespace type. In other words, objects with a "multiple-isolated" namespace type will be \*share-capable\*, but will not actually be shareable until the namespace type is changed to "multiple". \* agnostic: This type of saved object is global. |
| [SavedObjectsValidationSpec](./kibana-plugin-core-server.savedobjectsvalidationspec.md) | Allows for validating properties using @<!-- -->kbn/config-schema validations. |
| [SavedObjectTypeExcludeFromUpgradeFilterHook](./kibana-plugin-core-server.savedobjecttypeexcludefromupgradefilterhook.md) | If defined, allows a type to run a search query and return a query filter that may match any documents which may be excluded from the next migration upgrade process. Useful for cleaning up large numbers of old documents which are no longer needed and may slow the migration process.<!-- -->If this hook fails, the migration will proceed without these documents having been filtered out, so this should not be used as a guarantee that these documents have been deleted.<!-- -->Experimental and subject to change |
| [SavedObjectUnsanitizedDoc](./kibana-plugin-core-server.savedobjectunsanitizeddoc.md) | Describes Saved Object documents from Kibana &lt; 7.0.0 which don't have a <code>references</code> root property defined. This type should only be used in migrations. |
| [ScopeableRequest](./kibana-plugin-core-server.scopeablerequest.md) | A user credentials container. It accommodates the necessary auth credentials to impersonate the current user.<!-- -->See [KibanaRequest](./kibana-plugin-core-server.kibanarequest.md)<!-- -->. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ export class Plugin() {
| --- | --- | --- |
| [addClientWrapper](./kibana-plugin-core-server.savedobjectsservicesetup.addclientwrapper.md) | (priority: number, id: string, factory: SavedObjectsClientWrapperFactory) =&gt; void | Add a [client wrapper factory](./kibana-plugin-core-server.savedobjectsclientwrapperfactory.md) with the given priority. |
| [getKibanaIndex](./kibana-plugin-core-server.savedobjectsservicesetup.getkibanaindex.md) | () =&gt; string | Returns the default index used for saved objects. |
| [registerType](./kibana-plugin-core-server.savedobjectsservicesetup.registertype.md) | &lt;Attributes = any&gt;(type: SavedObjectsType&lt;Attributes&gt;) =&gt; void | Register a [savedObjects type](./kibana-plugin-core-server.savedobjectstype.md) definition.<!-- -->See the [mappings format](./kibana-plugin-core-server.savedobjectstypemappingdefinition.md) and [migration format](./kibana-plugin-core-server.savedobjectmigrationmap.md) for more details about these. |
| [registerType](./kibana-plugin-core-server.savedobjectsservicesetup.registertype.md) | &lt;Attributes extends SavedObjectAttributes = any&gt;(type: SavedObjectsType&lt;Attributes&gt;) =&gt; void | Register a [savedObjects type](./kibana-plugin-core-server.savedobjectstype.md) definition.<!-- -->See the [mappings format](./kibana-plugin-core-server.savedobjectstypemappingdefinition.md) and [migration format](./kibana-plugin-core-server.savedobjectmigrationmap.md) for more details about these. |
| [setClientFactoryProvider](./kibana-plugin-core-server.savedobjectsservicesetup.setclientfactoryprovider.md) | (clientFactoryProvider: SavedObjectsClientFactoryProvider) =&gt; void | Set the default [factory provider](./kibana-plugin-core-server.savedobjectsclientfactoryprovider.md) for creating Saved Objects clients. Only one provider can be set, subsequent calls to this method will fail. |

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ See the [mappings format](./kibana-plugin-core-server.savedobjectstypemappingdef
<b>Signature:</b>

```typescript
registerType: <Attributes = any>(type: SavedObjectsType<Attributes>) => void;
registerType: <Attributes extends SavedObjectAttributes = any>(type: SavedObjectsType<Attributes>) => void;
```

## Example
Expand All @@ -21,6 +21,7 @@ registerType: <Attributes = any>(type: SavedObjectsType<Attributes>) => void;
// src/plugins/my_plugin/server/saved_objects/my_type.ts
import { SavedObjectsType } from 'src/core/server';
import * as migrations from './migrations';
import * as schemas from './schemas';

export const myType: SavedObjectsType = {
name: 'MyType',
Expand All @@ -40,6 +41,10 @@ export const myType: SavedObjectsType = {
'2.0.0': migrations.migrateToV2,
'2.1.0': migrations.migrateToV2_1
},
schemas: {
'2.0.0': schemas.v2,
'2.1.0': schemas.v2_1,
},
};

// src/plugins/my_plugin/server/plugin.ts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,13 @@

## SavedObjectsType interface


<b>Signature:</b>

```typescript
export interface SavedObjectsType<Attributes = any>
```

## Remarks

This is only internal for now, and will only be public when we expose the registerType API

## Properties

| Property | Type | Description |
Expand Down Expand Up @@ -57,4 +54,5 @@ Note: migration function(s) can be optionally specified for any of these version
| [migrations?](./kibana-plugin-core-server.savedobjectstype.migrations.md) | SavedObjectMigrationMap \| (() =&gt; SavedObjectMigrationMap) | <i>(Optional)</i> An optional map of [migrations](./kibana-plugin-core-server.savedobjectmigrationfn.md) or a function returning a map of [migrations](./kibana-plugin-core-server.savedobjectmigrationfn.md) to be used to migrate the type. |
| [name](./kibana-plugin-core-server.savedobjectstype.name.md) | string | The name of the type, which is also used as the internal id. |
| [namespaceType](./kibana-plugin-core-server.savedobjectstype.namespacetype.md) | SavedObjectsNamespaceType | The [namespace type](./kibana-plugin-core-server.savedobjectsnamespacetype.md) for the type. |
| [schemas?](./kibana-plugin-core-server.savedobjectstype.schemas.md) | SavedObjectsValidationMap \| (() =&gt; SavedObjectsValidationMap) | <i>(Optional)</i> An optional schema that can be used to validate the attributes of the type.<!-- -->When provided, calls to [create](./kibana-plugin-core-server.savedobjectsclient.create.md) will be validated against this schema.<!-- -->See [SavedObjectsValidationMap](./kibana-plugin-core-server.savedobjectsvalidationmap.md) for more details. |

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-server](./kibana-plugin-core-server.md) &gt; [SavedObjectsType](./kibana-plugin-core-server.savedobjectstype.md) &gt; [schemas](./kibana-plugin-core-server.savedobjectstype.schemas.md)

## SavedObjectsType.schemas property

An optional schema that can be used to validate the attributes of the type.

When provided, calls to [create](./kibana-plugin-core-server.savedobjectsclient.create.md) will be validated against this schema.

See [SavedObjectsValidationMap](./kibana-plugin-core-server.savedobjectsvalidationmap.md) for more details.

<b>Signature:</b>

```typescript
schemas?: SavedObjectsValidationMap | (() => SavedObjectsValidationMap);
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<!-- 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; [SavedObjectsValidationMap](./kibana-plugin-core-server.savedobjectsvalidationmap.md)

## SavedObjectsValidationMap interface

A map of [validation specs](./kibana-plugin-core-server.savedobjectsvalidationspec.md) to be used for a given type. The map's keys must be valid semver versions.

Any time you change the schema of a [SavedObjectsType](./kibana-plugin-core-server.savedobjectstype.md)<!-- -->, you should add a new entry to this map for the Kibana version the change was introduced in.

<b>Signature:</b>

```typescript
export interface SavedObjectsValidationMap
```

## Example


```typescript
const validationMap: SavedObjectsValidationMap = {
'1.0.0': schema.object({
foo: schema.string(),
}),
'2.0.0': schema.object({
foo: schema.string({
minLength: 2,
validate(value) {
if (!/^[a-z]+$/.test(value)) {
return 'must be lowercase letters only';
}
}
}),
}),
}
```

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-server](./kibana-plugin-core-server.md) &gt; [SavedObjectsValidationSpec](./kibana-plugin-core-server.savedobjectsvalidationspec.md)

## SavedObjectsValidationSpec type

Allows for validating properties using @<!-- -->kbn/config-schema validations.

<b>Signature:</b>

```typescript
export declare type SavedObjectsValidationSpec = ObjectType;
```
Loading

0 comments on commit 8d94f9d

Please sign in to comment.