Skip to content

Commit

Permalink
Merge branch 'main' into detection-rules/8.4-395ae2c1
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaliidm authored Aug 15, 2022
2 parents 1ece078 + c0363b0 commit 7245788
Show file tree
Hide file tree
Showing 88 changed files with 3,516 additions and 843 deletions.
79 changes: 0 additions & 79 deletions .buildkite/agents.json

This file was deleted.

20 changes: 16 additions & 4 deletions .buildkite/scripts/common/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,22 @@ export KIBANA_BASE_BRANCH="$KIBANA_PKG_BRANCH"
KIBANA_PKG_VERSION="$(jq -r .version "$KIBANA_DIR/package.json")"
export KIBANA_PKG_VERSION

export GECKODRIVER_CDNURL="https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache"
export CHROMEDRIVER_CDNURL="https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache"
export RE2_DOWNLOAD_MIRROR="https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache"
export CYPRESS_DOWNLOAD_MIRROR="https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/cypress"
BUILDKITE_AGENT_GCP_REGION=""
if [[ "$(curl -is metadata.google.internal || true)" ]]; then
# projects/1003139005402/zones/us-central1-a -> us-central1-a -> us-central1
BUILDKITE_AGENT_GCP_REGION=$(curl -sH Metadata-Flavor:Google http://metadata.google.internal/computeMetadata/v1/instance/zone | rev | cut -d'/' -f1 | cut -c3- | rev)
fi
export BUILDKITE_AGENT_GCP_REGION

CI_PROXY_CACHE_SUFFIX=""
if [[ "$BUILDKITE_AGENT_GCP_REGION" ]]; then
CI_PROXY_CACHE_SUFFIX="/region/$BUILDKITE_AGENT_GCP_REGION"
fi

export GECKODRIVER_CDNURL="https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache$CI_PROXY_CACHE_SUFFIX"
export CHROMEDRIVER_CDNURL="https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache$CI_PROXY_CACHE_SUFFIX"
export RE2_DOWNLOAD_MIRROR="https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache$CI_PROXY_CACHE_SUFFIX"
export CYPRESS_DOWNLOAD_MIRROR="https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache$CI_PROXY_CACHE_SUFFIX/cypress"

export NODE_OPTIONS="--max-old-space-size=4096"

Expand Down
7 changes: 1 addition & 6 deletions .buildkite/scripts/common/setup_bazel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,7 @@ BAZEL_CACHE_MODE=${BAZEL_CACHE_MODE:-gcs}
if [[ "$BAZEL_CACHE_MODE" == "gcs" ]]; then
echo "[bazel] enabling caching with GCS buckets"

BAZEL_REGION="us-central1"
if [[ "$(curl -is metadata.google.internal || true)" ]]; then
# projects/1003139005402/zones/us-central1-a -> us-central1-a -> us-central1
BAZEL_REGION=$(curl -sH Metadata-Flavor:Google http://metadata.google.internal/computeMetadata/v1/instance/zone | rev | cut -d'/' -f1 | cut -c3- | rev)
fi

BAZEL_REGION="${BUILDKITE_AGENT_GCP_REGION:-us-central1}"
BAZEL_BUCKET="kibana-ci-bazel_$BAZEL_REGION"

echo "[bazel] using GCS bucket: $BAZEL_BUCKET"
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,10 @@ export const strings = {
export const errors = {
moreThanNBucketsAreNotSupportedError: (maxLength: number) =>
i18n.translate('expressionPartitionVis.reusable.function.errors.moreThenNumberBuckets', {
defaultMessage: 'More than {maxLength} buckets are not supported',
defaultMessage: 'More than {maxLength} buckets are not supported.',
values: { maxLength },
}),

splitRowAndSplitColumnAreSpecifiedError: () =>
i18n.translate('expressionPartitionVis.reusable.function.errors.splitRowAndColumnSpecified', {
defaultMessage:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ export const heatmap: ElementFactory = () => ({
type: 'chart',
help: 'Heatmap visualization',
icon: 'heatmap',
expression: `filters
expression: `kibana
| selectFilter
| demodata
| head 10
| heatmap xAccessor={visdimension "age"} yAccessor={visdimension "project"} valueAccessor={visdimension "cost"}
Expand Down
7 changes: 5 additions & 2 deletions x-pack/plugins/canvas/canvas_plugin_src/elements/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import { heatmap } from './heatmap';

import { SetupInitializer } from '../plugin';
import { ElementFactory } from '../../types';
import { pieVis } from './pie_vis';

const elementSpecs = [
areaChart,
Expand Down Expand Up @@ -68,6 +69,8 @@ const elementSpecs = [
heatmap,
];

const notExposedElementsSpecs = [metricVis, legacyMetricVis, pieVis];

const initializeElementFactories = [metricElementInitializer];

export const initializeElements: SetupInitializer<ElementFactory[]> = (core, plugins) => {
Expand All @@ -78,8 +81,8 @@ export const initializeElements: SetupInitializer<ElementFactory[]> = (core, plu
return applyElementStrings(specs);
};

// For testing purpose. Will be removed after exposing `metricVis` element.
// For testing purpose. Will be removed after exposing `metricVis`, pieVis elements.
export const initializeElementsSpec: SetupInitializer<ElementFactory[]> = (core, plugins) => {
const specs = initializeElements(core, plugins);
return [...applyElementStrings([metricVis, legacyMetricVis]), ...specs];
return [...applyElementStrings(notExposedElementsSpecs), ...specs];
};
21 changes: 21 additions & 0 deletions x-pack/plugins/canvas/canvas_plugin_src/elements/pie_vis/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; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import { ElementFactory } from '../../../types';

export const pieVis: ElementFactory = () => ({
name: 'pieVis',
displayName: '(New) Pie Vis',
type: 'chart',
help: 'Pie visualization',
icon: 'visPie',
expression: `kibana
| selectFilter
| demodata
| head 10
| pieVis metric={visdimension "age"} buckets={visdimension "project"} buckets={visdimension "cost"} legendDisplay="default"
| render`,
});
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import { toggle } from './toggle';
import { visdimension } from './vis_dimension';
import { colorPicker } from './color_picker';
import { editor } from './editor';
import { partitionLabels } from './partition_labels';

import { SetupInitializer } from '../../plugin';

Expand All @@ -55,6 +56,7 @@ export const args = [
visdimension,
colorPicker,
editor,
partitionLabels,
];

export const initializers = [dateFormatInitializer, numberFormatInitializer];
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* 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; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { ExpressionAstExpression } from '@kbn/expressions-plugin/common';

export const defaultExpression = (): ExpressionAstExpression => ({
type: 'expression',
chain: [
{
type: 'function',
function: 'partitionLabels',
arguments: {
show: [true],
position: ['default'],
values: [true],
percentDecimals: [2],
valuesFormat: ['percent'],
},
},
],
});
Loading

0 comments on commit 7245788

Please sign in to comment.