Skip to content

Commit

Permalink
Merge branch 'main' into eui-54.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
thompsongl authored Apr 11, 2022
2 parents 3ddd8bd + 9b7cde9 commit 84457df
Show file tree
Hide file tree
Showing 393 changed files with 4,831 additions and 3,254 deletions.
2 changes: 1 addition & 1 deletion .buildkite/scripts/steps/code_coverage/ingest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ echo "--- Upload coverage static site"
.buildkite/scripts/steps/code_coverage/reporting/uploadStaticSite.sh

echo "--- Ingest results to Kibana stats cluster"
.buildkite/scripts/steps/code_coverage/reporting/ingestData.sh 'elastic+kibana+code-coverage' ${BUILDKITE_BUILD_ID} ${BUILDKITE_BUILD_URL} ${previousSha} 'src/dev/code_coverage/ingest_coverage/team_assignment/team_assignments.txt'
.buildkite/scripts/steps/code_coverage/reporting/ingestData.sh 'elastic+kibana+code-coverage' ${BUILDKITE_BUILD_NUMBER} ${BUILDKITE_BUILD_URL} ${previousSha} 'src/dev/code_coverage/ingest_coverage/team_assignment/team_assignments.txt'
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -304,8 +304,8 @@ module.exports = {
*/
{
files: [
'packages/elastic-datemath/**/*.{js,mjs,ts,tsx}',
'packages/elastic-eslint-config-kibana/**/*.{js,mjs,ts,tsx}',
'packages/kbn-datemath/**/*.{js,mjs,ts,tsx}',
],
rules: {
'@kbn/eslint/require-license-header': [
Expand Down
3 changes: 2 additions & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
/examples/field_formats_example/ @elastic/kibana-app-services
/examples/partial_results_example/ @elastic/kibana-app-services
/examples/search_examples/ @elastic/kibana-app-services
/packages/elastic-datemath/ @elastic/kibana-app-services
/packages/kbn-datemath/ @elastic/kibana-app-services
/packages/kbn-interpreter/ @elastic/kibana-app-services
/packages/kbn-react-field/ @elastic/kibana-app-services
/packages/kbn-es-query/ @elastic/kibana-app-services
Expand Down Expand Up @@ -324,6 +324,7 @@
/src/plugins/interactive_setup/ @elastic/kibana-security
/test/interactive_setup_api_integration/ @elastic/kibana-security
/test/interactive_setup_functional/ @elastic/kibana-security
/test/plugin_functional/test_suites/core_plugins/rendering.ts @elastic/kibana-security
/x-pack/plugins/spaces/ @elastic/kibana-security
/x-pack/plugins/encrypted_saved_objects/ @elastic/kibana-security
/x-pack/plugins/security/ @elastic/kibana-security
Expand Down
16 changes: 8 additions & 8 deletions WORKSPACE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,16 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
# Fetch Node.js rules
http_archive(
name = "build_bazel_rules_nodejs",
sha256 = "8a7c981217239085f78acc9898a1f7ba99af887c1996ceb3b4504655383a2c3c",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/4.0.0/rules_nodejs-4.0.0.tar.gz"],
sha256 = "523da2d6b50bc00eaf14b00ed28b1a366b3ab456e14131e9812558b26599125c",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/5.3.1/rules_nodejs-5.3.1.tar.gz"],
)

# Now that we have the rules let's import from them to complete the work
load("@build_bazel_rules_nodejs//:index.bzl", "check_rules_nodejs_version", "node_repositories", "yarn_install")
# Build Node.js rules dependencies
load("@build_bazel_rules_nodejs//:repositories.bzl", "build_bazel_rules_nodejs_dependencies")
build_bazel_rules_nodejs_dependencies()

# Assure we have at least a given rules_nodejs version
check_rules_nodejs_version(minimum_version_string = "4.0.0")
# Now that we have the rules let's import from them to complete the work
load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories", "yarn_install")

# Setup the Node.js toolchain for the architectures we want to support
#
Expand All @@ -38,14 +39,13 @@ node_repositories(
node_urls = [
"https://nodejs.org/dist/v{version}/{filename}",
],
yarn_repositories = {
yarn_releases = {
"1.21.1": ("yarn-v1.21.1.tar.gz", "yarn-v1.21.1", "d1d9f4a0f16f5ed484e814afeb98f39b82d4728c6c8beaafb5abc99c02db6674"),
},
yarn_version = "1.21.1",
yarn_urls = [
"https://github.com/yarnpkg/yarn/releases/download/v{version}/{filename}",
],
package_json = ["//:package.json"],
)

# Run yarn_install rule to take care of dependencies
Expand Down
2 changes: 1 addition & 1 deletion docs/developer/getting-started/monorepo-packages.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ yarn kbn watch
[discrete]
=== List of Already Migrated Packages to Bazel

- @elastic/datemath
- @elastic/eslint-config-kibana
- @elastic/safer-lodash-set
- @kbn/ace
Expand All @@ -64,6 +63,7 @@ yarn kbn watch
- @kbn/config
- @kbn/config-schema
- @kbn/crypto
- @kbn/datemath
- @kbn/dev-utils
- @kbn/docs-utils
- @kbn/es
Expand Down
12 changes: 0 additions & 12 deletions docs/management/advanced-options.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -478,25 +478,13 @@ The default index when using the `.es()` query.
[[timelion-estimefield]]`timelion:es.timefield`::
The default field containing a timestamp when using the `.es()` query.

[[timelion-graphite-url]]`timelion:graphite.url`::
experimental:[]
Used with graphite queries, this is the URL of your graphite host
in the form https://www.hostedgraphite.com/UID/ACCESS_KEY/graphite. This URL can
be selected from an allow-list configured in the `kibana.yml` under
`timelion.graphiteUrls`.

[[timelion-maxbuckets]]`timelion:max_buckets`::
The maximum number of buckets a single data source can return. This value is
used for calculating automatic intervals in visualizations.

[[timelion-mininterval]]`timelion:min_interval`::
The smallest interval to calculate when using "auto".

[[timelion-quandlkey]]`timelion:quandl.key`::
experimental:[]
Used with quandl queries, this is your API key from
https://www.quandl.com/[www.quandl.com].

[[timelion-targetbuckets]]`timelion:target_buckets`::
Used for calculating automatic intervals in visualizations, this is the number
of buckets to try to represent.
Expand Down
14 changes: 7 additions & 7 deletions docs/setup/settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -689,29 +689,29 @@ sources and images. When false, Vega can only get data from {es}. *Default: `fal
| Enables you to view the underlying documents in a data series from a dashboard panel. *Default: `false`*

| `xpack.ilm.ui.enabled`
Set this value to false to disable the Index Lifecycle Policies UI.
| Set this value to false to disable the Index Lifecycle Policies UI.
*Default: `true`*

| `xpack.index_management.ui.enabled`
Set this value to false to disable the Index Management UI.
| Set this value to false to disable the Index Management UI.
*Default: `true`*

| `xpack.license_management.ui.enabled`
Set this value to false to disable the License Management UI.
| Set this value to false to disable the License Management UI.
*Default: `true`*

| `xpack.remote_clusters.ui.enabled`
Set this value to false to disable the Remote Clusters UI.
| Set this value to false to disable the Remote Clusters UI.
*Default: `true`*

| `xpack.rollup.ui.enabled:`
Set this value to false to disable the Rollup Jobs UI. *Default: true*
| Set this value to false to disable the Rollup Jobs UI. *Default: true*

| `xpack.snapshot_restore.ui.enabled:`
Set this value to false to disable the Snapshot and Restore UI. *Default: true*
| Set this value to false to disable the Snapshot and Restore UI. *Default: true*

| `xpack.upgrade_assistant.ui.enabled:`
Set this value to false to disable the Upgrade Assistant UI. *Default: true*
| Set this value to false to disable the Upgrade Assistant UI. *Default: true*

| `i18n.locale` {ess-icon}
| Set this value to change the {kib} interface language.
Expand Down
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
"@elastic/apm-rum-react": "^1.3.4",
"@elastic/apm-synthtrace": "link:bazel-bin/packages/elastic-apm-synthtrace",
"@elastic/charts": "45.1.1",
"@elastic/datemath": "link:bazel-bin/packages/elastic-datemath",
"@elastic/datemath": "5.0.3",
"@elastic/elasticsearch": "npm:@elastic/elasticsearch-canary@8.2.0-canary.2",
"@elastic/ems-client": "8.2.0",
"@elastic/eui": "54.0.0",
Expand Down Expand Up @@ -140,6 +140,7 @@
"@kbn/config": "link:bazel-bin/packages/kbn-config",
"@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",
"@kbn/doc-links": "link:bazel-bin/packages/kbn-doc-links",
"@kbn/es-query": "link:bazel-bin/packages/kbn-es-query",
"@kbn/eslint-plugin-imports": "link:bazel-bin/packages/kbn-eslint-plugin-imports",
Expand Down Expand Up @@ -310,7 +311,7 @@
"mime-types": "^2.1.27",
"mini-css-extract-plugin": "1.1.0",
"minimatch": "^3.1.2",
"moment": "^2.24.0",
"moment": "^2.29.2",
"moment-duration-format": "^2.3.2",
"moment-timezone": "^0.5.27",
"monaco-editor": "^0.22.3",
Expand Down Expand Up @@ -455,7 +456,7 @@
"@babel/traverse": "^7.17.3",
"@babel/types": "^7.17.0",
"@bazel/ibazel": "^0.16.2",
"@bazel/typescript": "4.0.0",
"@bazel/typescript": "5.3.1",
"@cypress/code-coverage": "^3.9.12",
"@cypress/snapshot": "^2.1.7",
"@cypress/webpack-preprocessor": "^5.6.0",
Expand Down Expand Up @@ -545,7 +546,6 @@
"@types/delete-empty": "^2.0.0",
"@types/ejs": "^3.0.6",
"@types/elastic__apm-synthtrace": "link:bazel-bin/packages/elastic-apm-synthtrace/npm_module_types",
"@types/elastic__datemath": "link:bazel-bin/packages/elastic-datemath/npm_module_types",
"@types/enzyme": "^3.10.8",
"@types/eslint": "^7.28.0",
"@types/express": "^4.17.13",
Expand Down Expand Up @@ -595,6 +595,7 @@
"@types/kbn__config": "link:bazel-bin/packages/kbn-config/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",
"@types/kbn__dev-utils": "link:bazel-bin/packages/kbn-dev-utils/npm_module_types",
"@types/kbn__doc-links": "link:bazel-bin/packages/kbn-doc-links/npm_module_types",
"@types/kbn__docs-utils": "link:bazel-bin/packages/kbn-docs-utils/npm_module_types",
Expand Down
4 changes: 2 additions & 2 deletions packages/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ filegroup(
srcs = [
"//packages/elastic-analytics:build",
"//packages/elastic-apm-synthtrace:build",
"//packages/elastic-datemath:build",
"//packages/elastic-eslint-config-kibana:build",
"//packages/elastic-safer-lodash-set:build",
"//packages/kbn-ace:build",
Expand All @@ -30,6 +29,7 @@ filegroup(
"//packages/kbn-config-schema:build",
"//packages/kbn-config:build",
"//packages/kbn-crypto:build",
"//packages/kbn-datemath:build",
"//packages/kbn-dev-utils:build",
"//packages/kbn-doc-links:build",
"//packages/kbn-docs-utils:build",
Expand Down Expand Up @@ -102,7 +102,6 @@ filegroup(
srcs = [
"//packages/elastic-analytics:build_types",
"//packages/elastic-apm-synthtrace:build_types",
"//packages/elastic-datemath:build_types",
"//packages/elastic-safer-lodash-set:build_types",
"//packages/kbn-ace:build_types",
"//packages/kbn-alerts:build_types",
Expand All @@ -116,6 +115,7 @@ filegroup(
"//packages/kbn-config-schema:build_types",
"//packages/kbn-config:build_types",
"//packages/kbn-crypto:build_types",
"//packages/kbn-datemath:build_types",
"//packages/kbn-dev-utils:build_types",
"//packages/kbn-doc-links:build_types",
"//packages/kbn-docs-utils:build_types",
Expand Down
4 changes: 2 additions & 2 deletions packages/elastic-apm-synthtrace/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ NPM_MODULE_EXTRA_FILES = [
]

RUNTIME_DEPS = [
"//packages/elastic-datemath",
"//packages/kbn-datemath",
"@npm//@elastic/elasticsearch",
"@npm//lodash",
"@npm//moment",
Expand All @@ -36,7 +36,7 @@ RUNTIME_DEPS = [
]

TYPES_DEPS = [
"//packages/elastic-datemath:npm_module_types",
"//packages/kbn-datemath:npm_module_types",
"@npm//@elastic/elasticsearch",
"@npm//@types/jest",
"@npm//@types/lodash",
Expand Down
2 changes: 1 addition & 1 deletion packages/elastic-apm-synthtrace/src/scripts/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
import datemath from '@elastic/datemath';
import datemath from '@kbn/datemath';
import yargs from 'yargs/yargs';
import { Argv } from 'yargs';
import { intervalToMs } from './utils/interval_to_ms';
Expand Down
3 changes: 2 additions & 1 deletion packages/kbn-config-schema/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import {
NullableProps,
RecordOfOptions,
RecordOfType,
SchemaStructureEntry,
StringOptions,
StringType,
Type,
Expand All @@ -49,7 +50,7 @@ import {
StreamType,
} from './types';

export type { AnyType, ConditionalType, TypeOf, Props, NullableProps };
export type { AnyType, ConditionalType, TypeOf, Props, SchemaStructureEntry, NullableProps };
export { ObjectType, Type };
export { ByteSizeValue } from './byte_size_value';
export { SchemaTypeError, ValidationError } from './errors';
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-config-schema/src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/

export type { TypeOptions } from './type';
export type { SchemaStructureEntry } from './type';
export { Type } from './type';
export { AnyType } from './any_type';
export type { ArrayOptions } from './array_type';
Expand Down
73 changes: 73 additions & 0 deletions packages/kbn-config-schema/src/types/object_type.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -490,3 +490,76 @@ describe('#extends', () => {
expect(extended.validate(undefined)).toEqual({ initial: 'bar', added: 42 });
});
});

test('returns schema structure', () => {
// This test covers different schema types that may or may not be nested
const objSchema = schema.object({
any: schema.any(),
array: schema.arrayOf(schema.string()),
boolean: schema.boolean(),
buffer: schema.buffer(),
byteSize: schema.byteSize(),
conditional: schema.conditional(
schema.contextRef('context_value_1'),
schema.contextRef('context_value_2'),
schema.string(),
schema.string()
),
duration: schema.duration(),
ip: schema.ip(),
literal: schema.literal('foo'),
map: schema.mapOf(schema.string(), schema.string()),
maybe: schema.maybe(schema.string()),
never: schema.never(),
nullable: schema.nullable(schema.string()),
number: schema.number(),
record: schema.recordOf(schema.string(), schema.string()),
stream: schema.stream(),
string: schema.string(),
union: schema.oneOf([schema.string()]),
uri: schema.uri(),
});
const type = objSchema.extends({
nested: objSchema,
});
expect(type.getSchemaStructure()).toEqual([
{ path: ['any'], type: 'any' },
{ path: ['array'], type: 'array' },
{ path: ['boolean'], type: 'boolean' },
{ path: ['buffer'], type: 'binary' },
{ path: ['byteSize'], type: 'bytes' },
{ path: ['conditional'], type: 'any' },
{ path: ['duration'], type: 'duration' },
{ path: ['ip'], type: 'string' },
{ path: ['literal'], type: 'any' },
{ path: ['map'], type: 'map' },
{ path: ['maybe'], type: 'string' },
{ path: ['never'], type: 'any' },
{ path: ['nullable'], type: 'alternatives' },
{ path: ['number'], type: 'number' },
{ path: ['record'], type: 'record' },
{ path: ['stream'], type: 'stream' },
{ path: ['string'], type: 'string' },
{ path: ['union'], type: 'alternatives' },
{ path: ['uri'], type: 'string' },
{ path: ['nested', 'any'], type: 'any' },
{ path: ['nested', 'array'], type: 'array' },
{ path: ['nested', 'boolean'], type: 'boolean' },
{ path: ['nested', 'buffer'], type: 'binary' },
{ path: ['nested', 'byteSize'], type: 'bytes' },
{ path: ['nested', 'conditional'], type: 'any' },
{ path: ['nested', 'duration'], type: 'duration' },
{ path: ['nested', 'ip'], type: 'string' },
{ path: ['nested', 'literal'], type: 'any' },
{ path: ['nested', 'map'], type: 'map' },
{ path: ['nested', 'maybe'], type: 'string' },
{ path: ['nested', 'never'], type: 'any' },
{ path: ['nested', 'nullable'], type: 'alternatives' },
{ path: ['nested', 'number'], type: 'number' },
{ path: ['nested', 'record'], type: 'record' },
{ path: ['nested', 'stream'], type: 'stream' },
{ path: ['nested', 'string'], type: 'string' },
{ path: ['nested', 'union'], type: 'alternatives' },
{ path: ['nested', 'uri'], type: 'string' },
]);
});
1 change: 1 addition & 0 deletions packages/kbn-config-schema/src/types/string_type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export class StringType extends Type<string> {
);
}

schema.type = 'string';
super(schema, options);
}

Expand Down
Loading

0 comments on commit 84457df

Please sign in to comment.