Skip to content

Commit

Permalink
Merge branch 'main' into breaking-change-link
Browse files Browse the repository at this point in the history
  • Loading branch information
lcawl authored Jan 28, 2025
2 parents ae48662 + fdd3849 commit 0bd9d2f
Show file tree
Hide file tree
Showing 1,324 changed files with 8,784 additions and 4,416 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ spec:
SLACK_NOTIFICATIONS_CHANNEL: '#kibana-management'
ELASTIC_SLACK_NOTIFICATIONS_ENABLED: 'true'
allow_rebuilds: false
branch_configuration: main
branch_configuration: main 8.x
default_branch: main
repository: elastic/kibana
pipeline_file: .buildkite/pipelines/console_definitions_sync.yml
Expand Down
10 changes: 9 additions & 1 deletion .buildkite/scripts/steps/cloud/purge_deployments.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
#!/usr/bin/env bash

set -euo pipefail
set -uo pipefail
# Note, -e is not set above, so we can capture all errors, and attempt purge individually

echo '--- Purging Cloud deployments'
ts-node .buildkite/scripts/steps/cloud/purge_deployments.ts
EXIT_CODE_CLOUD=$?

echo '--- Purging Project deployments'
ts-node .buildkite/scripts/steps/cloud/purge_projects.ts
EXIT_CODE_PROJECTS=$?

if [ $EXIT_CODE_CLOUD -ne 0 ] || [ $EXIT_CODE_PROJECTS -ne 0 ]; then
echo "❌ Purge failed (EXIT_CODE_CLOUD=$EXIT_CODE_CLOUD | EXIT_CODE_PROJECTS=$EXIT_CODE_PROJECTS)"
exit 1
fi
27 changes: 19 additions & 8 deletions .buildkite/scripts/steps/cloud/purge_deployments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,27 @@ import { execSync } from 'child_process';
import { getKibanaDir } from '#pipeline-utils';

const deploymentsListJson = execSync('ecctl deployment list --output json').toString();
const { deployments } = JSON.parse(deploymentsListJson);
const { deployments } = JSON.parse(deploymentsListJson) as {
deployments: Array<{ name: string; id: string }>;
};

const prDeployments = deployments.filter((deployment: any) =>
deployment.name.startsWith('kibana-pr-')
);
const prDeployments = deployments.filter((deployment) => deployment.name.startsWith('kibana-pr-'));

const deploymentsToPurge = [];
const deploymentsToPurge: typeof deployments = [];

const NOW = new Date().getTime() / 1000;
const DAY_IN_SECONDS = 60 * 60 * 24;
const CLOUD_DELETE_ON_ERROR = process.env.CLOUD_DELETE_ON_ERROR?.match(/^(true|1)$/i);

for (const deployment of prDeployments) {
try {
const prNumber = deployment.name.match(/^kibana-pr-([0-9]+)$/)[1];
const prNumber: string | undefined = deployment.name.match(/^kibana-pr-([0-9]+)$/)?.[1];
if (!prNumber) {
throw new Error(
`Invalid deployment name: ${deployment.name}; expected kibana-pr-{PR_NUMBER}).`
);
}

const prJson = execSync(`gh pr view '${prNumber}' --json state,labels,updatedAt`).toString();
const pullRequest = JSON.parse(prJson);
const prOpen = pullRequest.state === 'OPEN';
Expand Down Expand Up @@ -59,9 +66,13 @@ for (const deployment of prDeployments) {
deploymentsToPurge.push(deployment);
}
} catch (ex) {
console.error(`Error deleting deployment (${deployment.id}; ${deployment.name})`);
console.error(ex.toString());
// deploymentsToPurge.push(deployment); // TODO should we delete on error?
process.exitCode = 1;
if (CLOUD_DELETE_ON_ERROR) {
deploymentsToPurge.push(deployment);
} else {
process.exitCode = 1;
}
}
}

Expand Down
14 changes: 11 additions & 3 deletions .buildkite/scripts/steps/console_definitions_sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ main () {
report_main_step "Cloning repositories"

rm -rf elasticsearch-specification
if ! git clone https://github.com/elastic/elasticsearch-specification --depth 1; then
if ! git clone --branch "$BUILDKITE_BRANCH" https://github.com/elastic/elasticsearch-specification --depth 1; then
echo "Error: Failed to clone the elasticsearch-specification repository."
exit 1
fi
Expand All @@ -40,7 +40,7 @@ main () {
git config --global user.name "$KIBANA_MACHINE_USERNAME"
git config --global user.email '42973632+kibanamachine@users.noreply.github.com'

PR_TITLE='[Console] Update console definitions'
PR_TITLE="[Console] Update console definitions (${branch_name})"
PR_BODY='This PR updates the console definitions to match the latest ones from the @elastic/elasticsearch-specification repo.'

# Check if a PR already exists
Expand All @@ -66,7 +66,15 @@ main () {
git push origin "$BRANCH_NAME"

# Create PR
gh pr create --title "$PR_TITLE" --body "$PR_BODY" --base main --head "${BRANCH_NAME}" --label 'release_note:skip' --label 'Feature:Console' --label 'Team:Kibana Management'
gh pr create \
--title "$PR_TITLE" \
--body "$PR_BODY" \
--base "$BUILDKITE_BRANCH" \
--head "$BRANCH_NAME" \
--label 'backport:skip' \
--label 'release_note:skip' \
--label 'Feature:Console' \
--label 'Team:Kibana Management'
}

main
3 changes: 0 additions & 3 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ snapshots.js
!.buildkite

# plugin overrides
/src/core/lib/kbn_internal_native_observable
/src/platform/plugins/shared/data/common/es_query/kuery/ast/_generated_/**
/x-pack/platform/plugins/private/canvas/canvas_plugin
/x-pack/platform/plugins/private/canvas/shareable_runtime/build
Expand All @@ -33,10 +32,8 @@ snapshots.js
/packages/kbn-eslint-config
/packages/kbn-plugin-generator/template
/packages/kbn-generate/templates
/packages/kbn-pm/dist
/packages/kbn-test/src/functional_test_runner/__tests__/fixtures/
/packages/kbn-test/src/functional_test_runner/lib/config/__tests__/fixtures/
/packages/kbn-ui-framework/dist
/src/platform/packages/shared/kbn-flot-charts/lib
/src/platform/packages/shared/kbn-monaco/src/**/antlr
/src/platform/packages/shared/kbn-esql-ast/src/**/antlr
Expand Down
56 changes: 33 additions & 23 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,10 @@ module.exports = {
'src/**/*.{js,mjs,ts,tsx}',
'x-pack/**/*.{js,mjs,ts,tsx}',
'packages/**/*.{js,mjs,ts,tsx}',
'src/platform/packages/**/*.{js,mjs,ts,tsx}',
'src/core/packages/**/*.{js,mjs,ts,tsx}',
'x-pack/platform/packages/**/*.{js,mjs,ts,tsx}',
'x-pack/solutions/*/packages/**/*.{js,mjs,ts,tsx}',
],
plugins: ['formatjs'],
rules: {
Expand Down Expand Up @@ -924,7 +928,7 @@ module.exports = {
'x-pack/solutions/observability/plugins/exploratory_view/**/*.{js,mjs,ts,tsx}',
'x-pack/solutions/observability/plugins/ux/**/*.{js,mjs,ts,tsx}',
'x-pack/solutions/observability/plugins/slo/**/*.{js,mjs,ts,tsx}',
'x-pack/packages/observability/**/*.{js,mjs,ts,tsx}',
'x-pack/solutions/observability/packages/**/*.{js,mjs,ts,tsx}',
],
rules: {
'no-console': ['warn', { allow: ['error'] }],
Expand All @@ -944,7 +948,7 @@ module.exports = {
'x-pack/solutions/observability/plugins/observability/**/*.stories.*',
'x-pack/solutions/observability/plugins/exploratory_view/**/*.stories.*',
'x-pack/solutions/observability/plugins/slo/**/*.stories.*',
'x-pack/packages/observability/**/*.{js,mjs,ts,tsx}',
'x-pack/solutions/observability/packages/**/*.{js,mjs,ts,tsx}',
],
rules: {
'react/function-component-definition': [
Expand All @@ -958,9 +962,10 @@ module.exports = {
},
{
files: [
'x-pack/plugins/observability_solution/**/*.{ts,tsx}',
'x-pack/plugins/{streams,streams_app}/**/*.{ts,tsx}',
'x-pack/packages/observability/**/*.{ts,tsx}',
'x-pack/platform/plugins/shared/observability_solution/**/*.{ts,tsx}',
'x-pack/solutions/observability/plugins/**/*.{ts,tsx}',
'x-pack/solutions/observability/plugins/{streams,streams_app}/**/*.{ts,tsx}',
'x-pack/solutions/observability/packages/**/*.{ts,tsx}',
],
rules: {
'react-hooks/exhaustive-deps': [
Expand All @@ -975,17 +980,17 @@ module.exports = {
{
files: [
'x-pack/platform/plugins/shared/aiops/**/*.tsx',
'x-pack/plugins/observability_solution/**/*.tsx',
'x-pack/plugins/{streams,streams_app}/**/*.{ts,tsx}',
'src/plugins/ai_assistant_management/**/*.tsx',
'x-pack/packages/observability/**/*.{ts,tsx}',
'x-pack/platform/plugins/shared/observability_solution/**/*.{ts,tsx}',
'x-pack/solutions/observability/plugins/**/*.{ts,tsx}',
'src/platform/plugins/shared/ai_assistant_management/**/*.tsx',
'x-pack/solutions/observability/packages/**/*.{ts,tsx}',
],
rules: {
'@kbn/telemetry/event_generating_elements_should_be_instrumented': 'error',
},
},
{
files: ['x-pack/plugins/search*/**/*.tsx', 'x-pack/packages/search/**/*.tsx'],
files: ['x-pack/solutions/search/**/*.tsx'],
rules: {
'@kbn/telemetry/event_generating_elements_should_be_instrumented': 'warn',
},
Expand All @@ -994,7 +999,7 @@ module.exports = {
files: [
'x-pack/solutions/observability/plugins/**/!(*.stories.tsx|*.test.tsx|*.storybook_decorator.tsx|*.mock.tsx)',
'x-pack/solutions/observability/packages/**/!(*.stories.tsx|*.test.tsx|*.storybook_decorator.tsx|*.mock.tsx)',
'src/plugins/ai_assistant_management/**/!(*.stories.tsx|*.test.tsx|*.storybook_decorator.tsx|*.mock.tsx)',
'src/platform/plugins/shared/ai_assistant_management/**/!(*.stories.tsx|*.test.tsx|*.storybook_decorator.tsx|*.mock.tsx)',
],
rules: {
'@kbn/i18n/strings_should_be_translated_with_i18n': 'warn',
Expand Down Expand Up @@ -1097,8 +1102,8 @@ module.exports = {
'x-pack/platform/plugins/private/data_visualizer/**/*.{js,mjs,ts,tsx}',
'x-pack/platform/plugins/shared/ml/**/*.{js,mjs,ts,tsx}',
'x-pack/platform/plugins/private/transform/**/*.{js,mjs,ts,tsx}',
'x-pack/packages/private/ml/**/*.{js,mjs,ts,tsx}',
'x-pack/packages/shared/ml/**/*.{js,mjs,ts,tsx}',
'x-pack/platform/packages/shared/ml/**/*.{js,mjs,ts,tsx}',
'x-pack/platform/packages/private/ml/**/*.{js,mjs,ts,tsx}',
],
rules: {
'@typescript-eslint/consistent-type-imports': 'error',
Expand Down Expand Up @@ -1568,15 +1573,22 @@ module.exports = {
{
// typescript for front and back end
files: [
'x-pack/plugins/{alerting,stack_alerts,actions,task_manager,event_log}/**/*.{ts,tsx}',
'x-pack/platform/plugins/shared/alerting/**/*.{ts,tsx}',
'x-pack/platform/plugins/shared/stack_alerts/**/*.{ts,tsx}',
'x-pack/platform/plugins/shared/actions/**/*.{ts,tsx}',
'x-pack/platform/plugins/shared/task_manager/**/*.{ts,tsx}',
'x-pack/platform/plugins/shared/event_log/**/*.{ts,tsx}',
],
rules: {
'@typescript-eslint/no-explicit-any': 'error',
},
},
{
// typescript only for back end
files: ['x-pack/plugins/{stack_connectors,triggers_actions_ui}/server/**/*.ts'],
files: [
'x-pack/platform/plugins/shared/stack_connectors/server/**/*.ts',
'x-pack/platform/plugins/shared/triggers_actions_ui/server/**/*.ts',
],
rules: {
'@typescript-eslint/no-explicit-any': 'error',
},
Expand Down Expand Up @@ -1708,7 +1720,7 @@ module.exports = {
// All files
files: [
'x-pack/solutions/search/plugins/serverless_search/**/*.{ts,tsx}',
'packages/kbn-search-*',
'x-pack/solutions/search/packages/kbn-search-*',
],
rules: {
'@kbn/telemetry/event_generating_elements_should_be_instrumented': 'error',
Expand Down Expand Up @@ -1872,7 +1884,8 @@ module.exports = {
'x-pack/test/encrypted_saved_objects_api_integration/**/*.{js,mjs,ts,tsx}',

'x-pack/platform/plugins/shared/security/**/*.{js,mjs,ts,tsx}',
'x-pack/packages/security/**/*.{js,mjs,ts,tsx}',
'x-pack/platform/packages/private/security/**/*.{js,mjs,ts,tsx}',
'x-pack/platform/packages/shared/security/**/*.{js,mjs,ts,tsx}',
'x-pack/test/security_api_integration/**/*.{js,mjs,ts,tsx}',
'x-pack/test/security_functional/**/*.{js,mjs,ts,tsx}',

Expand Down Expand Up @@ -1927,7 +1940,6 @@ module.exports = {
{
files: [
'src/platform/packages/shared/kbn-analytics/**',
// 'packages/kbn-telemetry-tools/**',
'src/platform/plugins/private/kibana_usage_collection/**',
'src/platform/plugins/shared/usage_collection/**',
'src/platform/plugins/shared/telemetry/**',
Expand All @@ -1948,7 +1960,6 @@ module.exports = {
'x-pack/platform/plugins/shared/global_search/**',
'x-pack/platform/plugins/shared/cloud/**',
'src/platform/packages/shared/kbn-config-schema',
'src/plugins/status_page/**',
'src/platform/plugins/shared/saved_objects_management/**',
'src/platform/packages/shared/kbn-analytics/**',
'packages/kbn-telemetry-tools/**',
Expand All @@ -1973,10 +1984,9 @@ module.exports = {
{
files: [
'src/core/{server,public,common}/index.ts',
'src/plugins/*/{server,public,common}/index.ts',
'src/plugins/*/*/{server,public,common}/index.ts',
'x-pack/plugins/*/{server,public,common}/index.ts',
'x-pack/plugins/*/*/{server,public,common}/index.ts',
'src/platform/plugins/**/{server,public,common}/index.ts',
'x-pack/platform/plugins/**/{server,public,common}/index.ts',
'x-pack/solutions/*/plugins/**/{server,public,common}/index.ts',
],
rules: {
'@kbn/eslint/no_export_all': 'error',
Expand Down
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,7 @@ src/platform/packages/shared/kbn-lens-embeddable-utils @elastic/obs-ux-infra_ser
src/platform/packages/shared/kbn-logging @elastic/kibana-core
src/platform/packages/shared/kbn-logging-mocks @elastic/kibana-core
src/platform/packages/shared/kbn-management/cards_navigation @elastic/kibana-management
src/platform/packages/shared/kbn-management/delete_managed_assets_callout @elastic/kibana-management
src/platform/packages/shared/kbn-management/settings/components/field_input @elastic/kibana-management
src/platform/packages/shared/kbn-management/settings/components/field_row @elastic/kibana-management
src/platform/packages/shared/kbn-management/settings/field_definition @elastic/kibana-management
Expand Down
2 changes: 1 addition & 1 deletion 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: 2025-01-27
date: 2025-01-28
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'actions']
---
import actionsObj from './actions.devdocs.json';
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: 2025-01-27
date: 2025-01-28
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'advancedSettings']
---
import advancedSettingsObj from './advanced_settings.devdocs.json';
Expand Down
2 changes: 1 addition & 1 deletion api_docs/ai_assistant_management_selection.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/aiAssistantManagementSelection
title: "aiAssistantManagementSelection"
image: https://source.unsplash.com/400x175/?github
description: API docs for the aiAssistantManagementSelection plugin
date: 2025-01-27
date: 2025-01-28
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'aiAssistantManagementSelection']
---
import aiAssistantManagementSelectionObj from './ai_assistant_management_selection.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: 2025-01-27
date: 2025-01-28
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'aiops']
---
import aiopsObj from './aiops.devdocs.json';
Expand Down
16 changes: 15 additions & 1 deletion api_docs/alerting.devdocs.json
Original file line number Diff line number Diff line change
Expand Up @@ -3002,7 +3002,7 @@
"label": "monitoring",
"description": [],
"signature": [
"Readonly<{} & { run: Readonly<{} & { history: Readonly<{ outcome?: \"warning\" | \"succeeded\" | \"failed\" | undefined; duration?: number | undefined; } & { timestamp: number; success: boolean; }>[]; calculated_metrics: Readonly<{ p50?: number | undefined; p95?: number | undefined; p99?: number | undefined; } & { success_ratio: number; }>; last_run: Readonly<{} & { timestamp: string; metrics: Readonly<{ duration?: number | undefined; total_search_duration_ms?: number | null | undefined; total_indexing_duration_ms?: number | null | undefined; total_alerts_detected?: number | null | undefined; total_alerts_created?: number | null | undefined; gap_duration_s?: number | null | undefined; } & {}>; }>; }>; }> | undefined"
"Readonly<{} & { run: Readonly<{} & { history: Readonly<{ outcome?: \"warning\" | \"succeeded\" | \"failed\" | undefined; duration?: number | undefined; } & { timestamp: number; success: boolean; }>[]; calculated_metrics: Readonly<{ p50?: number | undefined; p95?: number | undefined; p99?: number | undefined; } & { success_ratio: number; }>; last_run: Readonly<{} & { timestamp: string; metrics: Readonly<{ duration?: number | undefined; total_search_duration_ms?: number | null | undefined; total_indexing_duration_ms?: number | null | undefined; total_alerts_detected?: number | null | undefined; total_alerts_created?: number | null | undefined; gap_duration_s?: number | null | undefined; gap_range?: Readonly<{} & { gte: string; lte: string; }> | null | undefined; } & {}>; }>; }>; }> | undefined"
],
"path": "x-pack/platform/plugins/shared/alerting/server/application/rule/types/rule.ts",
"deprecated": false,
Expand Down Expand Up @@ -8995,6 +8995,20 @@
"path": "x-pack/platform/plugins/shared/alerting/common/rule.ts",
"deprecated": false,
"trackAdoption": false
},
{
"parentPluginId": "alerting",
"id": "def-common.RuleMonitoringLastRunMetrics.gap_range",
"type": "CompoundType",
"tags": [],
"label": "gap_range",
"description": [],
"signature": [
"{ lte: string; gte: string; } | null | undefined"
],
"path": "x-pack/platform/plugins/shared/alerting/common/rule.ts",
"deprecated": false,
"trackAdoption": false
}
],
"initialIsOpen": false
Expand Down
4 changes: 2 additions & 2 deletions api_docs/alerting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/alerting
title: "alerting"
image: https://source.unsplash.com/400x175/?github
description: API docs for the alerting plugin
date: 2025-01-27
date: 2025-01-28
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'alerting']
---
import alertingObj from './alerting.devdocs.json';
Expand All @@ -21,7 +21,7 @@ Contact [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-o

| Public API count | Any count | Items lacking comments | Missing exports |
|-------------------|-----------|------------------------|-----------------|
| 874 | 1 | 841 | 50 |
| 875 | 1 | 842 | 50 |

## Client

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

0 comments on commit 0bd9d2f

Please sign in to comment.