Skip to content

Commit

Permalink
Merge branch 'main' of github.com:elastic/kibana
Browse files Browse the repository at this point in the history
  • Loading branch information
jennypavlova committed Jan 8, 2025
2 parents c2b62a0 + 6d49348 commit 299b233
Show file tree
Hide file tree
Showing 7,270 changed files with 23,920 additions and 11,804 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
1 change: 1 addition & 0 deletions .buildkite/ftr_platform_stateful_configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ enabled:
- x-pack/test/banners_functional/config.ts
- x-pack/test/cases_api_integration/security_and_spaces/config_basic.ts
- x-pack/test/cases_api_integration/security_and_spaces/config_trial.ts
- x-pack/test/cases_api_integration/security_and_spaces/config_trial_common.ts
- x-pack/test/cases_api_integration/security_and_spaces/config_no_public_base_url.ts
- x-pack/test/cases_api_integration/spaces_only/config.ts
- x-pack/test/disable_ems/config.ts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ spec:
SLACK_NOTIFICATIONS_CHANNEL: '#kibana-operations-alerts'
ELASTIC_SLACK_NOTIFICATIONS_ENABLED: 'true'
allow_rebuilds: true
branch_configuration: main 8.x 8.17 8.16 8.15 7.17
branch_configuration: main 8.x 8.17 8.16 7.17
default_branch: main
repository: elastic/kibana
pipeline_file: .buildkite/pipelines/es_snapshots/build.yml
Expand Down Expand Up @@ -95,7 +95,7 @@ spec:
SLACK_NOTIFICATIONS_CHANNEL: '#kibana-operations-alerts'
ELASTIC_SLACK_NOTIFICATIONS_ENABLED: 'true'
allow_rebuilds: true
branch_configuration: main 8.x 8.17 8.16 8.15 7.17
branch_configuration: main 8.x 8.17 8.16 7.17
default_branch: main
repository: elastic/kibana
pipeline_file: .buildkite/pipelines/es_snapshots/promote.yml
Expand Down Expand Up @@ -144,7 +144,7 @@ spec:
ELASTIC_SLACK_NOTIFICATIONS_ENABLED: 'true'
REPORT_FAILED_TESTS_TO_GITHUB: 'true'
allow_rebuilds: true
branch_configuration: main 8.x 8.17 8.16 8.15 7.17
branch_configuration: main 8.x 8.17 8.16 7.17
default_branch: main
repository: elastic/kibana
pipeline_file: .buildkite/pipelines/es_snapshots/verify.yml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ spec:
SLACK_NOTIFICATIONS_CHANNEL: '#kibana-unsupported-ftrs-alerts'
ELASTIC_SLACK_NOTIFICATIONS_ENABLED: 'true'
allow_rebuilds: true
branch_configuration: main 8.x 8.17 8.16 8.15 7.17
branch_configuration: main 8.x 8.17 8.16 7.17
default_branch: main
repository: elastic/kibana
pipeline_file: .buildkite/pipelines/on_merge_unsupported_ftrs.yml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ spec:
REPORT_FAILED_TESTS_TO_GITHUB: 'true'
ELASTIC_SLACK_NOTIFICATIONS_ENABLED: 'true'
allow_rebuilds: true
branch_configuration: main 8.x 8.17 8.16 8.15 7.17
branch_configuration: main 8.x 8.17 8.16 7.17
default_branch: main
repository: elastic/kibana
pipeline_file: .buildkite/pipelines/on_merge.yml
Expand Down
13 changes: 13 additions & 0 deletions .buildkite/pipeline-utils/buildkite/emitPipeline.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", and the "Server Side
* Public License v 1"; you may not use this file except in compliance with, at
* your election, the "Elastic License 2.0", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/

export function emitPipeline(pipelineSteps: string[]) {
const pipelineStr = [...new Set(pipelineSteps)].join('\n');
console.log(pipelineStr);
}
1 change: 1 addition & 0 deletions .buildkite/pipeline-utils/buildkite/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@

export * from './client';
export * from './types';
export * from './emitPipeline';
4 changes: 4 additions & 0 deletions .buildkite/pipelines/on_merge_unsupported_ftrs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ steps:
machineType: n2-standard-4
preemptible: true
depends_on: build
env:
PING_SLACK_TEAM: "@obs-ux-infra_services-team"
timeout_in_minutes: 120
retry:
automatic:
Expand All @@ -54,6 +56,8 @@ steps:
machineType: n2-standard-4
preemptible: true
depends_on: build
env:
PING_SLACK_TEAM: "@obs-ux-infra_services-team"
timeout_in_minutes: 120
retry:
automatic:
Expand Down
8 changes: 8 additions & 0 deletions .buildkite/scripts/lifecycle/post_command.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,12 @@ if [[ "$IS_TEST_EXECUTION_STEP" == "true" ]]; then
buildkite-agent artifact upload 'target/test_failures/**/*'
ts-node .buildkite/scripts/lifecycle/annotate_test_failures.ts
fi

fi

if [[ $BUILDKITE_COMMAND_EXIT_STATUS -ne 0 ]]; then
# If the slack team environment variable is set, ping the team in slack
if [ -n "${PING_SLACK_TEAM:-}" ]; then
buildkite-agent meta-data set 'slack:ping_team:body' "${PING_SLACK_TEAM}, can you please take a look at the test failures?"
fi
fi
34 changes: 23 additions & 11 deletions .buildkite/scripts/pipelines/pull_request/pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,22 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/

/* eslint "no-restricted-syntax": [
"error",
{
"selector": "CallExpression[callee.object.name='console'][callee.property.name!=/^(warn|error)$/]",
"message": "Debug logging to stdout in this file will attempt to upload the log message as yaml to buildkite, which might result in pipeline syntax error. Use emitPipeline() to upload steps, or log to stderr."
}
] */

import fs from 'fs';
import prConfigs from '../../../pull_requests.json';
import { areChangesSkippable, doAnyChangesMatch, getAgentImageConfig } from '#pipeline-utils';
import {
areChangesSkippable,
doAnyChangesMatch,
getAgentImageConfig,
emitPipeline,
} from '#pipeline-utils';

const prConfig = prConfigs.jobs.find((job) => job.pipelineSlug === 'kibana-pull-request');
const emptyStep = `steps: []`;
Expand All @@ -35,7 +48,7 @@ const getPipeline = (filename: string, removeSteps = true) => {
const skippable = await areChangesSkippable(SKIPPABLE_PR_MATCHERS, REQUIRED_PATHS);

if (skippable) {
console.log(emptyStep);
emitPipeline([emptyStep]);
return;
}

Expand All @@ -44,8 +57,8 @@ const getPipeline = (filename: string, removeSteps = true) => {
const onlyRunQuickChecks = await areChangesSkippable([/^renovate\.json$/], REQUIRED_PATHS);
if (onlyRunQuickChecks) {
pipeline.push(getPipeline('.buildkite/pipelines/pull_request/renovate.yml', false));

console.log([...new Set(pipeline)].join('\n'));
console.warn('Isolated changes to renovate.json. Skipping main PR pipeline.');
emitPipeline(pipeline);
return;
}

Expand All @@ -57,7 +70,7 @@ const getPipeline = (filename: string, removeSteps = true) => {

if (
(await doAnyChangesMatch([
/^src\/plugins\/data/,
/^src\/platform\/plugins\/shared\/data/,
/^x-pack\/platform\/plugins\/shared\/actions/,
/^x-pack\/platform\/plugins\/shared\/alerting/,
/^x-pack\/platform\/plugins\/shared\/event_log/,
Expand Down Expand Up @@ -298,7 +311,7 @@ const getPipeline = (filename: string, removeSteps = true) => {
/^package.json/,
/^src\/platform\/packages\/shared\/kbn-discover-utils/,
/^packages\/kbn-doc-links/,
/^packages\/kbn-dom-drag-drop/,
/^src\/platform\/packages\/shared\/kbn-dom-drag-drop/,
/^src\/platform\/packages\/shared\/kbn-es-query/,
/^src\/platform\/packages\/shared\/kbn-i18n/,
/^src\/platform\/packages\/shared\/kbn-i18n-react/,
Expand All @@ -319,9 +332,9 @@ const getPipeline = (filename: string, removeSteps = true) => {
/^packages\/react/,
/^packages\/shared-ux/,
/^src\/core/,
/^src\/plugins\/charts/,
/^src\/platform\/plugins\/shared\/charts/,
/^src\/platform\/plugins\/shared\/controls/,
/^src\/plugins\/data/,
/^src\/platform\/plugins\/shared\/data/,
/^src\/platform\/plugins\/shared\/data_views/,
/^src\/platform\/plugins\/shared\/discover/,
/^src\/platform\/plugins\/shared\/field_formats/,
Expand All @@ -331,7 +344,7 @@ const getPipeline = (filename: string, removeSteps = true) => {
/^src\/platform\/plugins\/shared\/saved_search/,
/^src\/platform\/plugins\/shared\/ui_actions/,
/^src\/platform\/plugins\/shared\/unified_histogram/,
/^src\/plugins\/unified_search/,
/^src\/platform\/plugins\/shared\/unified_search/,
/^x-pack\/platform\/packages\/shared\/kbn-elastic-assistant/,
/^x-pack\/platform\/packages\/shared\/kbn-elastic-assistant-common/,
/^x-pack\/solutions\/security\/packages/,
Expand Down Expand Up @@ -401,8 +414,7 @@ const getPipeline = (filename: string, removeSteps = true) => {

pipeline.push(getPipeline('.buildkite/pipelines/pull_request/post_build.yml'));

// remove duplicated steps
console.log([...new Set(pipeline)].join('\n'));
emitPipeline(pipeline);
} catch (ex) {
console.error('Error while generating the pipeline steps: ' + ex.message, ex);
process.exit(1);
Expand Down
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ snapshots.js

# plugin overrides
/src/core/lib/kbn_internal_native_observable
/src/plugins/data/common/es_query/kuery/ast/_generated_/**
/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
/x-pack/platform/plugins/private/canvas/storybook/build
Expand Down
16 changes: 11 additions & 5 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ const VENN_DIAGRAM_HEADER = `
* This file is forked from the venn.js project (https://github.com/benfred/venn.js/),
* and may include modifications made by Elasticsearch B.V.
* Elasticsearch B.V. licenses this file to you under the MIT License.
* See \`x-pack/plugins/graph/public/components/venn_diagram/vennjs/LICENSE\` for more information.
* See \`x-pack/platform/plugins/private/graph/public/components/venn_diagram/vennjs/LICENSE\` for more information.
*/
`;

Expand Down Expand Up @@ -183,7 +183,7 @@ const DEV_PATTERNS = [
...DEV_PACKAGE_DIRS.map((pkg) => `${pkg}/**/*`),
...DEV_DIRECTORIES.map((dir) => `{packages,src,x-pack}/**/${dir}/**/*`),
...DEV_FILE_PATTERNS.map((file) => `{packages,src,x-pack}/**/${file}`),
'packages/kbn-interpreter/tasks/**/*',
'src/platform/packages/shared/kbn-interpreter/tasks/**/*',
'src/dev/**/*',
'x-pack/{dev-tools,tasks,test,test_serverless,build_chromium}/**/*',
'x-pack/performance/**/*',
Expand Down Expand Up @@ -271,6 +271,10 @@ const RESTRICTED_IMPORTS = [
message:
'Please, use rxjs instead: rxjs/operators is just a subset, unnecessarily duplicating the package import.',
},
{
name: '@testing-library/react-hooks',
message: 'Please use @testing-library/react instead',
},
];

module.exports = {
Expand Down Expand Up @@ -595,7 +599,9 @@ module.exports = {
* venn.js fork requires special license headers
*/
{
files: ['x-pack/plugins/graph/public/components/venn_diagram/vennjs/**/*.{js,mjs,ts,tsx}'],
files: [
'x-pack/platform/plugins/private/graph/public/components/venn_diagram/vennjs/**/*.{js,mjs,ts,tsx}',
],
rules: {
'@kbn/eslint/require-license-header': [
'error',
Expand Down Expand Up @@ -1581,7 +1587,7 @@ module.exports = {
* Lens overrides
*/
{
files: ['x-pack/plugins/lens/**/*.{ts,tsx}'],
files: ['x-pack/platform/plugins/shared/lens/**/*.{ts,tsx}'],
rules: {
'@typescript-eslint/no-explicit-any': 'error',
},
Expand Down Expand Up @@ -1797,7 +1803,7 @@ module.exports = {
* TSVB overrides
*/
{
files: ['src/plugins/vis_types/timeseries/**/*.{js,mjs,ts,tsx}'],
files: ['src/platform/plugins/shared/vis_types/timeseries/**/*.{js,mjs,ts,tsx}'],
rules: {
'import/no-default-export': 'error',
},
Expand Down
Loading

0 comments on commit 299b233

Please sign in to comment.