Skip to content

Commit

Permalink
Merge branch 'main' into alerting/rule-run-history-matches-status
Browse files Browse the repository at this point in the history
  • Loading branch information
doakalexi authored Oct 10, 2022
2 parents 756a5b8 + 4feb397 commit 591108b
Show file tree
Hide file tree
Showing 1,729 changed files with 47,659 additions and 15,835 deletions.
1 change: 1 addition & 0 deletions .buildkite/pipelines/pull_request/deploy_cloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ steps:
queue: n2-2-spot
depends_on: build
timeout_in_minutes: 30
soft_fail: true
retry:
automatic:
- exit_status: '-1'
Expand Down
6 changes: 6 additions & 0 deletions .buildkite/scripts/common/setup_bazel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ if [[ "$BAZEL_CACHE_MODE" == "gcs" ]]; then
echo "[bazel] enabling caching with GCS buckets"

BAZEL_REGION="${BUILDKITE_AGENT_GCP_REGION:-us-central1}"

if ! [[ "$BAZEL_REGION" =~ ^(us-central1|northamerica-northeast2|europe-west2|southamerica-east1|asia-south2)$ ]]; then
echo "unsupported bazel cache region $BAZEL_REGION"
exit 1
fi

BAZEL_BUCKET="kibana-ci-bazel_$BAZEL_REGION"

echo "[bazel] using GCS bucket: $BAZEL_BUCKET"
Expand Down
1 change: 1 addition & 0 deletions .buildkite/scripts/steps/artifacts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@ if [ -d .beats ]; then
cd .beats
buildkite-agent artifact upload 'metricbeat-*'
buildkite-agent artifact upload 'filebeat-*'
buildkite-agent artifact upload 'beats_manifest.json'
cd -
fi
23 changes: 9 additions & 14 deletions .buildkite/scripts/steps/artifacts/cloud.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,26 @@ set -euo pipefail
source "$(dirname "$0")/../../common/util.sh"
source .buildkite/scripts/steps/artifacts/env.sh

echo "--- Build and publish Cloud image"
echo "--- Push docker image"
mkdir -p target

download_artifact "kibana-$FULL_VERSION-linux-x86_64.tar.gz" ./target --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}"
download_artifact "kibana-cloud-$FULL_VERSION-docker-image.tar.gz" ./target --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}"
docker load < "target/kibana-cloud-$FULL_VERSION-docker-image.tar.gz"

TAG="$FULL_VERSION-$GIT_COMMIT"
KIBANA_BASE_IMAGE="docker.elastic.co/kibana-ci/kibana-cloud:$FULL_VERSION"
KIBANA_TEST_IMAGE="docker.elastic.co/kibana-ci/kibana-cloud:$TAG"

# docker.elastic.co/kibana-ci/kibana-cloud:$FULL_VERSION -> :$FULL_VERSION-$GIT_COMMIT
docker tag "$KIBANA_BASE_IMAGE" "$KIBANA_TEST_IMAGE"

echo "$KIBANA_DOCKER_PASSWORD" | docker login -u "$KIBANA_DOCKER_USERNAME" --password-stdin docker.elastic.co
trap 'docker logout docker.elastic.co' EXIT

if docker manifest inspect $KIBANA_TEST_IMAGE &> /dev/null; then
echo "Distribution already exists, skipping build"
echo "Cloud image already exists, skipping docker push"
else
node scripts/build \
--skip-initialize \
--skip-generic-folders \
--skip-platform-folders \
--skip-archives \
--docker-images \
--docker-tag-qualifier="$GIT_COMMIT" \
--docker-push \
--skip-docker-ubi \
--skip-docker-ubuntu \
--skip-docker-contexts
docker image push "$KIBANA_TEST_IMAGE"
fi

docker logout docker.elastic.co
Expand Down
5 changes: 5 additions & 0 deletions .buildkite/scripts/steps/artifacts/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ if [[ "$BUILDKITE_BRANCH" == "$KIBANA_BASE_BRANCH" ]]; then
export VAULT_ROLE_ID="$(retry 5 15 gcloud secrets versions access latest --secret=kibana-buildkite-vault-role-id)"
export VAULT_SECRET_ID="$(retry 5 15 gcloud secrets versions access latest --secret=kibana-buildkite-vault-secret-id)"
export VAULT_ADDR="https://secrets.elastic.co:8200"

download_artifact beats_manifest.json /tmp --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}"
export BEATS_MANIFEST_URL=$(jq -r .manifest_url /tmp/beats_manifest.json)

docker run --rm \
--name release-manager \
-e VAULT_ADDR \
Expand All @@ -72,6 +76,7 @@ if [[ "$BUILDKITE_BRANCH" == "$KIBANA_BASE_BRANCH" ]]; then
--workflow "$WORKFLOW" \
--version "$BASE_VERSION" \
--qualifier "$VERSION_QUALIFIER" \
--dependency "beats:$BEATS_MANIFEST_URL" \
--artifact-set main

ARTIFACTS_SUBDOMAIN="artifacts-$WORKFLOW"
Expand Down
6 changes: 5 additions & 1 deletion .buildkite/scripts/steps/functional/apm_cypress.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ set -euo pipefail

source .buildkite/scripts/common/util.sh

APM_CYPRESS_RECORD_KEY="$(retry 5 5 vault read -field=CYPRESS_RECORD_KEY secret/kibana-issues/dev/apm-cypress-dashboard-record-key)"

.buildkite/scripts/bootstrap.sh
.buildkite/scripts/download_build_artifacts.sh

Expand All @@ -15,4 +17,6 @@ cd "$XPACK_DIR"

checks-reporter-with-killswitch "APM Cypress Tests" \
node plugins/apm/scripts/test/e2e.js \
--kibana-install-dir "$KIBANA_BUILD_LOCATION"
--kibana-install-dir "$KIBANA_BUILD_LOCATION" \
--record \
--key "$APM_CYPRESS_RECORD_KEY"
4 changes: 2 additions & 2 deletions .buildkite/scripts/steps/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ echo '--- Lint: eslint'
# after possibly commiting fixed files to the repo
set +e;
if is_pr && ! is_auto_commit_disabled; then
git ls-files | grep -E '\.(js|mjs|ts|tsx)$' | xargs -n 250 -P 6 node scripts/eslint --no-cache --fix
git ls-files | grep -E '\.(js|mjs|ts|tsx)$' | xargs -n 250 -P 4 node scripts/eslint --no-cache --fix
else
git ls-files | grep -E '\.(js|mjs|ts|tsx)$' | xargs -n 250 -P 6 node scripts/eslint --no-cache
git ls-files | grep -E '\.(js|mjs|ts|tsx)$' | xargs -n 250 -P 4 node scripts/eslint --no-cache
fi

eslint_exit=$?
Expand Down
24 changes: 24 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -1406,6 +1406,30 @@ module.exports = {
],
},
},
/**
* Allows snake_case variables in the server, because that's how we return API properties
*/
{
files: ['x-pack/plugins/enterprise_search/server/**/*.{ts,tsx}'],
rules: {
'@typescript-eslint/naming-convention': [
'error',
{
selector: 'variable',
modifiers: ['destructured'],
format: null,
leadingUnderscore: 'allow',
trailingUnderscore: 'allow',
},
{
selector: 'variable',
format: ['camelCase', 'UPPER_CASE'],
leadingUnderscore: 'allow',
trailingUnderscore: 'allow',
},
],
},
},
{
// Source files only - allow `any` in test/mock files
files: ['x-pack/plugins/enterprise_search/**/*.{ts,tsx}'],
Expand Down
18 changes: 14 additions & 4 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -332,11 +332,15 @@ x-pack/examples/files_example @elastic/kibana-app-services
/x-pack/plugins/event_log/ @elastic/response-ops
/x-pack/plugins/task_manager/ @elastic/response-ops
/x-pack/plugins/stack_connectors/ @elastic/response-ops
/x-pack/plugins/stack_connectors/public/connector_types/stack/ @elastic/response-ops-execution
/x-pack/plugins/stack_connectors/server/connector_types/stack/ @elastic/response-ops-execution
/x-pack/plugins/stack_connectors/public/connector_types/cases/ @elastic/response-ops-cases
/x-pack/plugins/stack_connectors/server/connector_types/cases/ @elastic/response-ops-cases
/x-pack/plugins/stack_connectors/public/connector_types/stack/ @elastic/response-ops @elastic/response-ops-execution
/x-pack/plugins/stack_connectors/server/connector_types/stack/ @elastic/response-ops @elastic/response-ops-execution
/x-pack/plugins/stack_connectors/public/connector_types/cases/ @elastic/response-ops @elastic/response-ops-cases
/x-pack/plugins/stack_connectors/server/connector_types/cases/ @elastic/response-ops @elastic/response-ops-cases
/x-pack/test/alerting_api_integration/ @elastic/response-ops
/x-pack/test/alerting_api_integration/basic/tests/actions/connector_types/stack/ @elastic/response-ops @elastic/response-ops-execution
/x-pack/test/alerting_api_integration/basic/tests/actions/connector_types/cases/ @elastic/response-ops @elastic/response-ops-cases
/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/stack/ @elastic/response-ops @elastic/response-ops-execution
/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/actions/connector_types/cases/ @elastic/response-ops @elastic/response-ops-cases
/x-pack/test/plugin_api_integration/test_suites/task_manager/ @elastic/response-ops
/x-pack/plugins/triggers_actions_ui/ @elastic/response-ops
/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/ @elastic/response-ops
Expand Down Expand Up @@ -504,6 +508,11 @@ x-pack/examples/files_example @elastic/kibana-app-services

/x-pack/plugins/security_solution/server/lib/detection_engine/routes/fleet @elastic/security-detections-response-rules
/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules @elastic/security-detections-response-rules
/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/create_rule_exceptions_route* @elastic/security-solution-platform
/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/find_rule_exceptions_route* @elastic/security-solution-platform
/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/import_rules_route* @elastic/security-solution-platform
/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/preview_rules_route* @elastic/security-detections-response-alerts
/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/utils @elastic/security-solution-platform
/x-pack/plugins/security_solution/server/lib/detection_engine/routes/tags @elastic/security-detections-response-rules
/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring @elastic/security-detections-response-rules
/x-pack/plugins/security_solution/server/lib/detection_engine/rules @elastic/security-detections-response-rules
Expand Down Expand Up @@ -824,6 +833,7 @@ packages/core/status/core-status-server-internal @elastic/kibana-core
packages/core/status/core-status-server-mocks @elastic/kibana-core
packages/core/test-helpers/core-test-helpers-deprecations-getters @elastic/kibana-core
packages/core/test-helpers/core-test-helpers-http-setup-browser @elastic/kibana-core
packages/core/test-helpers/core-test-helpers-so-type-serializer @elastic/kibana-core
packages/core/theme/core-theme-browser @elastic/kibana-core
packages/core/theme/core-theme-browser-internal @elastic/kibana-core
packages/core/theme/core-theme-browser-mocks @elastic/kibana-core
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/backport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ on:
branches: ['main']
types: ['labeled', 'closed']

env:
NODE_ENV: kibana-github-action

jobs:
backport:
name: Backport PR
Expand All @@ -16,7 +19,7 @@ jobs:
)
steps:
- name: Backport Action
uses: sqren/[email protected].2
uses: sqren/[email protected].7
with:
github_token: ${{secrets.KIBANAMACHINE_TOKEN}}

Expand Down
115 changes: 50 additions & 65 deletions api_docs/actions.devdocs.json
Original file line number Diff line number Diff line change
Expand Up @@ -741,13 +741,9 @@
"label": "request",
"description": [],
"signature": [
"<R>({ url, data, method, responseSchema, headers, ...config }: { url: string; responseSchema: ",
"Type",
"<R>; method?: ",
"Method",
" | undefined; } & ",
"AxiosRequestConfig",
"<any>) => Promise<",
"<R>({ url, data, method, responseSchema, headers, ...config }: ",
"SubActionRequestParams",
"<R>) => Promise<",
"AxiosResponse",
"<R, any>>"
],
Expand All @@ -763,13 +759,8 @@
"label": "{\n url,\n data,\n method = 'get',\n responseSchema,\n headers,\n ...config\n }",
"description": [],
"signature": [
"{ url: string; responseSchema: ",
"Type",
"<R>; method?: ",
"Method",
" | undefined; } & ",
"AxiosRequestConfig",
"<any>"
"SubActionRequestParams",
"<R>"
],
"path": "x-pack/plugins/actions/server/sub_action_framework/sub_action_connector.ts",
"deprecated": false,
Expand Down Expand Up @@ -858,6 +849,41 @@
],
"returnComment": [],
"initialIsOpen": false
},
{
"parentPluginId": "actions",
"id": "def-server.urlAllowListValidator",
"type": "Function",
"tags": [],
"label": "urlAllowListValidator",
"description": [],
"signature": [
"<T>(urlKey: string) => (obj: T, validatorServices: ",
"ValidatorServices",
") => void"
],
"path": "x-pack/plugins/actions/server/sub_action_framework/helpers/validators.ts",
"deprecated": false,
"trackAdoption": false,
"children": [
{
"parentPluginId": "actions",
"id": "def-server.urlAllowListValidator.$1",
"type": "string",
"tags": [],
"label": "urlKey",
"description": [],
"signature": [
"string"
],
"path": "x-pack/plugins/actions/server/sub_action_framework/helpers/validators.ts",
"deprecated": false,
"trackAdoption": false,
"isRequired": true
}
],
"returnComment": [],
"initialIsOpen": false
}
],
"interfaces": [
Expand Down Expand Up @@ -1191,7 +1217,13 @@
"label": "validate",
"description": [],
"signature": [
"{ params?: ValidatorType<Params> | undefined; config?: ValidatorType<Config> | undefined; secrets?: ValidatorType<Secrets> | undefined; connector?: ((config: Config, secrets: Secrets) => string | null) | undefined; } | undefined"
"{ params?: ",
"ValidatorType",
"<Params> | undefined; config?: ",
"ValidatorType",
"<Config> | undefined; secrets?: ",
"ValidatorType",
"<Secrets> | undefined; connector?: ((config: Config, secrets: Secrets) => string | null) | undefined; } | undefined"
],
"path": "x-pack/plugins/actions/server/types.ts",
"deprecated": false,
Expand All @@ -1205,59 +1237,12 @@
"label": "renderParameterTemplates",
"description": [],
"signature": [
"((params: Params, variables: Record<string, unknown>, actionId?: string | undefined) => Params) | undefined"
"RenderParameterTemplates",
"<Params> | undefined"
],
"path": "x-pack/plugins/actions/server/types.ts",
"deprecated": false,
"trackAdoption": false,
"children": [
{
"parentPluginId": "actions",
"id": "def-server.ActionType.renderParameterTemplates.$1",
"type": "Uncategorized",
"tags": [],
"label": "params",
"description": [],
"signature": [
"Params"
],
"path": "x-pack/plugins/actions/server/types.ts",
"deprecated": false,
"trackAdoption": false,
"isRequired": true
},
{
"parentPluginId": "actions",
"id": "def-server.ActionType.renderParameterTemplates.$2",
"type": "Object",
"tags": [],
"label": "variables",
"description": [],
"signature": [
"Record<string, unknown>"
],
"path": "x-pack/plugins/actions/server/types.ts",
"deprecated": false,
"trackAdoption": false,
"isRequired": true
},
{
"parentPluginId": "actions",
"id": "def-server.ActionType.renderParameterTemplates.$3",
"type": "string",
"tags": [],
"label": "actionId",
"description": [],
"signature": [
"string | undefined"
],
"path": "x-pack/plugins/actions/server/types.ts",
"deprecated": false,
"trackAdoption": false,
"isRequired": false
}
],
"returnComment": []
"trackAdoption": false
},
{
"parentPluginId": "actions",
Expand Down
4 changes: 2 additions & 2 deletions api_docs/actions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/actions
title: "actions"
image: https://source.unsplash.com/400x175/?github
description: API docs for the actions plugin
date: 2022-10-04
date: 2022-10-10
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'actions']
---
import actionsObj from './actions.devdocs.json';
Expand All @@ -21,7 +21,7 @@ Contact [Response Ops](https://github.com/orgs/elastic/teams/response-ops) for q

| Public API count | Any count | Items lacking comments | Missing exports |
|-------------------|-----------|------------------------|-----------------|
| 214 | 0 | 209 | 19 |
| 213 | 0 | 208 | 23 |

## Client

Expand Down
2 changes: 1 addition & 1 deletion api_docs/advanced_settings.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/advancedSettings
title: "advancedSettings"
image: https://source.unsplash.com/400x175/?github
description: API docs for the advancedSettings plugin
date: 2022-10-04
date: 2022-10-10
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'advancedSettings']
---
import advancedSettingsObj from './advanced_settings.devdocs.json';
Expand Down
2 changes: 1 addition & 1 deletion api_docs/aiops.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/aiops
title: "aiops"
image: https://source.unsplash.com/400x175/?github
description: API docs for the aiops plugin
date: 2022-10-04
date: 2022-10-10
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'aiops']
---
import aiopsObj from './aiops.devdocs.json';
Expand Down
Loading

0 comments on commit 591108b

Please sign in to comment.