Skip to content

Commit

Permalink
Merge branch 'main' into create-case-apis
Browse files Browse the repository at this point in the history
  • Loading branch information
lcawl authored Mar 17, 2022
2 parents 23d608b + f4c4fd6 commit e62926a
Show file tree
Hide file tree
Showing 638 changed files with 14,138 additions and 4,885 deletions.
10 changes: 9 additions & 1 deletion .buildkite/scripts/steps/cloud/build_and_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ node scripts/build \
--skip-docker-ubuntu \
--skip-docker-contexts

ELASTICSEARCH_MANIFEST_URL="https://storage.googleapis.com/kibana-ci-es-snapshots-daily/$(jq -r '.version' package.json)/manifest-latest-verified.json"
ELASTICSEARCH_SHA=$(curl -s $ELASTICSEARCH_MANIFEST_URL | jq -r '.sha')
ELASTICSEARCH_CLOUD_IMAGE="docker.elastic.co/kibana-ci/elasticsearch-cloud:$VERSION-$ELASTICSEARCH_SHA"

CLOUD_IMAGE=$(docker images --format "{{.Repository}}:{{.Tag}}" docker.elastic.co/kibana-ci/kibana-cloud)
CLOUD_DEPLOYMENT_NAME="kibana-pr-$BUILDKITE_PULL_REQUEST"

Expand All @@ -40,6 +44,7 @@ JSON_FILE=$(mktemp --suffix ".json")
if [ -z "${CLOUD_DEPLOYMENT_ID}" ]; then
jq '
.resources.kibana[0].plan.kibana.docker_image = "'$CLOUD_IMAGE'" |
.resources.elasticsearch[0].plan.elasticsearch.docker_image = "'$ELASTICSEARCH_CLOUD_IMAGE'" |
.name = "'$CLOUD_DEPLOYMENT_NAME'" |
.resources.kibana[0].plan.kibana.version = "'$VERSION'" |
.resources.elasticsearch[0].plan.elasticsearch.version = "'$VERSION'" |
Expand Down Expand Up @@ -70,6 +75,7 @@ if [ -z "${CLOUD_DEPLOYMENT_ID}" ]; then
else
ecctl deployment show "$CLOUD_DEPLOYMENT_ID" --generate-update-payload | jq '
.resources.kibana[0].plan.kibana.docker_image = "'$CLOUD_IMAGE'" |
.resources.elasticsearch[0].plan.elasticsearch.docker_image = "'$ELASTICSEARCH_CLOUD_IMAGE'" |
(.. | select(.version? != null).version) = "'$VERSION'"
' > /tmp/deploy.json
ecctl deployment update "$CLOUD_DEPLOYMENT_ID" --track --output json --file /tmp/deploy.json &> "$JSON_FILE"
Expand All @@ -87,7 +93,9 @@ cat << EOF | buildkite-agent annotate --style "info" --context cloud
Credentials: \`vault read secret/kibana-issues/dev/cloud-deploy/$CLOUD_DEPLOYMENT_NAME\`
Image: $CLOUD_IMAGE
Kibana image: \`$CLOUD_IMAGE\`
Elasticsearch image: \`$ELASTICSEARCH_CLOUD_IMAGE\`
EOF

buildkite-agent meta-data set pr_comment:deploy_cloud:head "* [Cloud Deployment](${CLOUD_DEPLOYMENT_KIBANA_URL})"
1 change: 1 addition & 0 deletions .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"server": "src/legacy/server",
"share": "src/plugins/share",
"sharedUX": "src/plugins/shared_ux",
"sharedUXComponents": "packages/kbn-shared-ux-components/src",
"statusPage": "src/legacy/core_plugins/status_page",
"telemetry": ["src/plugins/telemetry", "src/plugins/telemetry_management_section"],
"timelion": ["src/plugins/vis_types/timelion"],
Expand Down
3 changes: 0 additions & 3 deletions docs/maps/import-geospatial-data.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ To import geospatical data into the Elastic Stack, the data must be indexed as {
Geospatial data comes in many formats.
Choose an import tool based on the format of your geospatial data.

TIP: When you upload files in {kib}, there is a file size
limit, which is configurable in <<fileupload-maxfilesize,Advanced Settings>>.

[discrete]
[[import-geospatial-privileges]]
=== Security privileges
Expand Down
2 changes: 1 addition & 1 deletion docs/settings/fleet-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Optional properties are:
`namespace`:: String identifying this policy's namespace.
`monitoring_enabled`:: List of keywords that specify the monitoring data to collect.
Valid values include `['logs']`, `['metrics']`, and `['logs', 'metrics']`.
`is_managed`:: If `true`, this policy is editable by the user and can only
`is_managed`:: If `true`, this policy is not editable by the user and can only
be changed by updating the {kib} config.
`is_default`:: If `true`, this policy is the default agent policy.
`is_default_fleet_server`:: If `true`, this policy is the default {fleet-server} agent policy.
Expand Down
3 changes: 3 additions & 0 deletions docs/user/dashboard/vega-reference.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,9 @@ a configuration option for changing the tooltip position and padding:
*Vega* can load data from any URL. To enable, set `vis_type_vega.enableExternalUrls: true` in `kibana.yml`,
then restart {kib}.

The files that the external URLs load must allow https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS[CORS].
The remote URL must include `Access-Control-Allow-Origin`, which allows requests from the {kib} URL.

You can make the current time range part of the external as a millisecond timestamp by using the placeholders `%timefilter_min%` and `%timefilter_max%`, e.g. `http://example.com?min=%timefilter_min%`.

[float]
Expand Down
10 changes: 9 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
"@elastic/datemath": "link:bazel-bin/packages/elastic-datemath",
"@elastic/elasticsearch": "npm:@elastic/[email protected]",
"@elastic/ems-client": "8.1.0",
"@elastic/eui": "48.1.1",
"@elastic/eui": "51.1.0",
"@elastic/filesaver": "1.1.2",
"@elastic/node-crypto": "1.2.1",
"@elastic/numeral": "^2.5.1",
Expand Down Expand Up @@ -167,6 +167,10 @@
"@kbn/securitysolution-utils": "link:bazel-bin/packages/kbn-securitysolution-utils",
"@kbn/server-http-tools": "link:bazel-bin/packages/kbn-server-http-tools",
"@kbn/server-route-repository": "link:bazel-bin/packages/kbn-server-route-repository",
"@kbn/shared-ux-components": "link:bazel-bin/packages/kbn-shared-ux-components",
"@kbn/shared-ux-services": "link:bazel-bin/packages/kbn-shared-ux-services",
"@kbn/shared-ux-storybook": "link:bazel-bin/packages/kbn-shared-ux-storybook",
"@kbn/shared-ux-utility": "link:bazel-bin/packages/kbn-shared-ux-utility",
"@kbn/std": "link:bazel-bin/packages/kbn-std",
"@kbn/timelion-grammar": "link:bazel-bin/packages/kbn-timelion-grammar",
"@kbn/tinymath": "link:bazel-bin/packages/kbn-tinymath",
Expand Down Expand Up @@ -196,6 +200,10 @@
"@turf/helpers": "6.0.1",
"@turf/length": "^6.0.2",
"@types/jsonwebtoken": "^8.5.6",
"@types/kbn__shared-ux-components": "link:bazel-bin/packages/kbn-shared-ux-components/npm_module_types",
"@types/kbn__shared-ux-services": "link:bazel-bin/packages/kbn-shared-ux-services/npm_module_types",
"@types/kbn__shared-ux-storybook": "link:bazel-bin/packages/kbn-shared-ux-storybook/npm_module_types",
"@types/kbn__shared-ux-utility": "link:bazel-bin/packages/kbn-shared-ux-utility/npm_module_types",
"@types/moment-duration-format": "^2.2.3",
"JSONStream": "1.3.5",
"abort-controller": "^3.0.0",
Expand Down
8 changes: 8 additions & 0 deletions packages/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ filegroup(
"//packages/kbn-securitysolution-utils:build",
"//packages/kbn-server-http-tools:build",
"//packages/kbn-server-route-repository:build",
"//packages/kbn-shared-ux-components:build",
"//packages/kbn-shared-ux-services:build",
"//packages/kbn-shared-ux-storybook:build",
"//packages/kbn-shared-ux-utility:build",
"//packages/kbn-spec-to-console:build",
"//packages/kbn-std:build",
"//packages/kbn-storybook:build",
Expand Down Expand Up @@ -139,6 +143,10 @@ filegroup(
"//packages/kbn-securitysolution-utils:build_types",
"//packages/kbn-server-http-tools:build_types",
"//packages/kbn-server-route-repository:build_types",
"//packages/kbn-shared-ux-components:build_types",
"//packages/kbn-shared-ux-services:build_types",
"//packages/kbn-shared-ux-storybook:build_types",
"//packages/kbn-shared-ux-utility:build_types",
"//packages/kbn-std:build_types",
"//packages/kbn-storybook:build_types",
"//packages/kbn-telemetry-tools:build_types",
Expand Down
107 changes: 102 additions & 5 deletions packages/kbn-es-query/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,109 @@
* Side Public License, v 1.
*/

export * from './es_query';
export * from './filters';
export * from './kuery';
export type {
BoolQuery,
DataViewBase,
DataViewFieldBase,
EsQueryConfig,
IFieldSubType,
IFieldSubTypeMulti,
IFieldSubTypeNested,
} from './es_query';

export type {
CustomFilter,
ExistsFilter,
FieldFilter,
Filter,
FilterCompareOptions,
FilterMeta,
LatLon,
MatchAllFilter,
PhraseFilter,
PhrasesFilter,
Query,
QueryStringFilter,
RangeFilter,
RangeFilterMeta,
RangeFilterParams,
ScriptedPhraseFilter,
ScriptedRangeFilter,
} from './filters';

export type {
DslQuery,
FunctionTypeBuildNode,
KueryNode,
KueryParseOptions,
KueryQueryOptions,
NodeTypes,
} from './kuery';

export {
buildEsQuery,
buildQueryFromFilters,
decorateQuery,
luceneStringToDsl,
migrateFilter,
} from './es_query';

export {
COMPARE_ALL_OPTIONS,
FILTERS,
FilterStateStore,
buildCustomFilter,
buildEmptyFilter,
buildExistsFilter,
buildFilter,
buildPhraseFilter,
buildPhrasesFilter,
buildQueryFilter,
buildRangeFilter,
cleanFilter,
compareFilters,
dedupFilters,
disableFilter,
enableFilter,
getConvertedValueForField,
getFilterField,
getFilterParams,
getPhraseFilterField,
getPhraseFilterValue,
getPhraseScript,
getRangeScript,
isExistsFilter,
isFilter,
isFilterDisabled,
isFilterPinned,
isFilters,
isMatchAllFilter,
isPhraseFilter,
isPhrasesFilter,
isQueryStringFilter,
isRangeFilter,
isScriptedPhraseFilter,
isScriptedRangeFilter,
onlyDisabledFiltersChanged,
pinFilter,
toggleFilterDisabled,
toggleFilterNegated,
toggleFilterPinned,
uniqFilters,
unpinFilter,
} from './filters';

export {
KQLSyntaxError,
fromKueryExpression,
nodeBuilder,
nodeTypes,
toElasticsearchQuery,
} from './kuery';

export {
isDataViewFieldSubtypeMulti,
isDataViewFieldSubtypeNested,
getDataViewFieldSubtypeMulti,
getDataViewFieldSubtypeNested,
isDataViewFieldSubtypeMulti,
isDataViewFieldSubtypeNested,
} from './utils';
150 changes: 150 additions & 0 deletions packages/kbn-shared-ux-components/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
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-shared-ux-components"
PKG_REQUIRE_NAME = "@kbn/shared-ux-components"

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

SRCS = SOURCE_FILES

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

NPM_MODULE_EXTRA_FILES = [
"package.json",
]

# In this array place runtime dependencies, including other packages and NPM packages
# which must be available for this code to run.
#
# To reference other packages use:
# "//repo/relative/path/to/package"
# eg. "//packages/kbn-utils"
#
# To reference a NPM package use:
# "@npm//name-of-package"
# eg. "@npm//lodash"
RUNTIME_DEPS = [
"//packages/kbn-i18n",
"//packages/kbn-i18n-react",
"//packages/kbn-shared-ux-services",
"//packages/kbn-shared-ux-storybook",
"//packages/kbn-shared-ux-utility",
"@npm//@elastic/eui",
"@npm//@emotion/react",
"@npm//@emotion/css",
"@npm//classnames",
"@npm//react-use",
"@npm//react",
]

# In this array place dependencies necessary to build the types, which will include the
# :npm_module_types target of other packages and packages from NPM, including @types/*
# packages.
#
# To reference the types for another package use:
# "//repo/relative/path/to/package:npm_module_types"
# eg. "//packages/kbn-utils:npm_module_types"
#
# References to NPM packages work the same as RUNTIME_DEPS
TYPES_DEPS = [
"//packages/kbn-i18n:npm_module_types",
"//packages/kbn-i18n-react:npm_module_types",
"//packages/kbn-shared-ux-services:npm_module_types",
"//packages/kbn-shared-ux-storybook:npm_module_types",
"//packages/kbn-shared-ux-utility:npm_module_types",
"@npm//@types/node",
"@npm//@types/jest",
"@npm//@types/react",
"@npm//@types/classnames",
"@npm//@emotion/react",
"@npm//@emotion/css",
"@npm//@elastic/eui",
"@npm//react-use",
]

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

jsts_transpiler(
name = "target_web",
srcs = SRCS,
build_pkg_name = package_name(),
web = True,
additional_args = [
"--copy-files",
"--quiet"
],
)

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", ":target_web"],
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"],
)
Loading

0 comments on commit e62926a

Please sign in to comment.