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
CoenWarmer committed Feb 24, 2024
2 parents 62dd52d + 4c8d8ef commit b4eb4ea
Show file tree
Hide file tree
Showing 2,993 changed files with 24,081 additions and 6,467 deletions.
6 changes: 3 additions & 3 deletions .buildkite/ftr_configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ disabled:
- x-pack/test/functional_enterprise_search/visual_config.ts
- x-pack/test/functional_enterprise_search/cli_config.ts
- x-pack/test_serverless/functional/test_suites/security/cypress/security_config.ts
- x-pack/plugins/apm/ftr_e2e/ftr_config_open.ts
- x-pack/plugins/apm/ftr_e2e/ftr_config_run.ts
- x-pack/plugins/apm/ftr_e2e/ftr_config.ts
- x-pack/plugins/observability_solution/apm/ftr_e2e/ftr_config_open.ts
- x-pack/plugins/observability_solution/apm/ftr_e2e/ftr_config_run.ts
- x-pack/plugins/observability_solution/apm/ftr_e2e/ftr_config.ts
- x-pack/test_serverless/functional/test_suites/observability/cypress/config_headless.ts
- x-pack/test_serverless/functional/test_suites/observability/cypress/config_runner.ts
- x-pack/test/security_solution_cypress/serverless_config.ts
Expand Down
21 changes: 20 additions & 1 deletion .buildkite/pipeline-utils/buildkite/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export interface BuildkiteGroup {
steps: BuildkiteStep[];
}

export type BuildkiteStep = BuildkiteCommandStep | BuildkiteInputStep;
export type BuildkiteStep = BuildkiteCommandStep | BuildkiteInputStep | BuildkiteTriggerStep;

export interface BuildkiteCommandStep {
command: string;
Expand Down Expand Up @@ -94,6 +94,25 @@ export interface BuildkiteInputStep {
env?: { [key: string]: string };
}

export interface BuildkiteTriggerStep {
trigger: string;
label?: string;
build?: {
message?: string; // The message for the build. Supports emoji.
commit?: string; // The commit hash for the build.
branch?: string; // The branch for the build.
meta_data?: string; // A map of meta-data for the build.
env?: Record<string, string>; // A map of environment variables for the build.
};
async?: boolean;
branches?: string;
if?: string;
allow_dependency_failure?: boolean;
soft_fail?: boolean;
depends_on?: string | string[];
skip?: string;
}

export interface BuildkiteTriggerBuildParams {
commit: string;
branch: string;
Expand Down
12 changes: 0 additions & 12 deletions .buildkite/pipelines/pipeline.kibana-serverless-release.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,9 @@ steps:
- ts-node .buildkite/scripts/serverless/create_deploy_tag/release_wizard_messaging.ts --state create_deploy_tag
- bash .buildkite/scripts/serverless/create_deploy_tag/create_deploy_tag.sh
- ts-node .buildkite/scripts/serverless/create_deploy_tag/release_wizard_messaging.ts --state tag_created
- ts-node .buildkite/scripts/serverless/create_deploy_tag/generate_gpctl_trigger.ts
- ts-node .buildkite/scripts/serverless/create_deploy_tag/release_wizard_messaging.ts --state trigger_gpctl
env:
DRY_RUN: $DRY_RUN

- wait: ~
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ else
echo "Skipping tag push to GitHub due to DRY_RUN=$DRY_RUN"
fi

echo "Created deploy tag: $DEPLOY_TAG - your QA release should start @ https://buildkite.com/elastic/kibana-serverless-release/builds?branch=$DEPLOY_TAG"
echo "Created deploy tag: $DEPLOY_TAG"
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* 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 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 or the Server
* Side Public License, v 1.
*/

import { buildkite } from './shared';
import { getSelectedCommitHash } from './info_sections/commit_info';
import { BuildkiteTriggerStep } from '#pipeline-utils';

const IS_DRY_RUN = process.env.DRY_RUN?.match(/(1|true)/i);
const REMOTE_SERVICE_CONFIG = `https://raw.githubusercontent.com/elastic/serverless-gitops/main/gen/gpctl/kibana/config.yaml`;

async function main() {
const selectedSha = getSelectedCommitHash();
uploadTriggerStep(selectedSha);
}

function uploadTriggerStep(commitSha: string) {
const triggerStep: BuildkiteTriggerStep = {
label: ':releasethekaken: Trigger GPCTL / Release Kibana',
trigger: 'gpctl-promote',
async: true,
build: {
message: 'Triggered by Kibana serverless release pipeline',
env: {
SERVICE_COMMIT_HASH: commitSha.slice(0, 12),
REMOTE_SERVICE_CONFIG,
},
},
};

if (IS_DRY_RUN) {
console.log('Dry run: skipping upload of GPCTL trigger step. Step definition:', triggerStep);
} else {
buildkite.uploadSteps([triggerStep]);
}
}

main()
.then(() => {
console.log('GPCTL Trigger step uploaded.');
})
.catch((error) => {
console.error(error);
process.exit(1);
});
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ type StateNames =
| 'wait_for_confirmation'
| 'create_deploy_tag'
| 'tag_created'
| 'trigger_gpctl'
| 'end'
| 'error_generic'
| string;
| 'error_generic';

interface StateShape {
name: string;
Expand Down Expand Up @@ -117,7 +117,20 @@ const states: Record<StateNames, StateShape> = {
name: 'Release tag created',
description: 'The initial step release is completed, follow up jobs will be triggered soon.',
instruction: `<h3>Deploy tag successfully created!</h3>`,
post: async () => {
instructionStyle: 'success',
display: true,
},
trigger_gpctl: {
name: 'Triggering GPCTL deployment',
description: 'Triggering the GPCTL deployment for the release - sit back and relax.',
instruction: `GPCTL deployment triggered, follow the trigger step for more info.`,
instructionStyle: 'info',
display: true,
},
end: {
name: 'End of the release process',
description: 'The release process has ended.',
pre: async () => {
// The deployTag here is only for communication, if it's missing, it's not a big deal, but it's an error
const deployTag =
buildkite.getMetadata(DEPLOY_TAG_META_KEY) ||
Expand All @@ -128,8 +141,7 @@ const states: Record<StateNames, StateShape> = {
buildkite.setAnnotation(
WIZARD_CTX_INSTRUCTION,
'success',
`<h3>Deploy tag successfully created!</h3><br/>
Your deployment will appear <a href='https://buildkite.com/elastic/kibana-serverless-release/builds?branch=${deployTag}'>here on buildkite.</a>`
`<h3>Release successfully initiated!</h3>`
);

if (!selectedCommit) {
Expand All @@ -153,12 +165,6 @@ Your deployment will appear <a href='https://buildkite.com/elastic/kibana-server
deployTag,
});
},
instructionStyle: 'success',
display: true,
},
end: {
name: 'End of the release process',
description: 'The release process has ended.',
display: false,
},
error_generic: {
Expand All @@ -179,15 +185,15 @@ export async function main(args: string[]) {
if (!args.includes('--state')) {
throw new Error('Missing --state argument');
}
const targetState = args.slice(args.indexOf('--state') + 1)[0];
const targetState = args.slice(args.indexOf('--state') + 1)[0] as StateNames;

let data: any;
if (args.includes('--data')) {
data = args.slice(args.indexOf('--data') + 1)[0];
}

const resultingTargetState = await transition(targetState, data);
if (resultingTargetState === 'tag_created') {
if (resultingTargetState === 'trigger_gpctl') {
return await transition('end');
} else {
return resultingTargetState;
Expand All @@ -196,7 +202,7 @@ export async function main(args: string[]) {

export async function transition(targetStateName: StateNames, data?: any) {
// use the buildkite agent to find what state we are in:
const currentStateName = buildkite.getMetadata('release_state') || 'start';
const currentStateName = (buildkite.getMetadata('release_state') || 'start') as StateNames;
const stateData = JSON.parse(buildkite.getMetadata('state_data') || '{}');

if (!currentStateName) {
Expand Down Expand Up @@ -243,10 +249,10 @@ function updateWizardState(stateData: Record<string, 'ok' | 'nok' | 'pending' |
: `<h3>:kibana: Kibana Serverless deployment wizard :mage:</h3>`;

const wizardSteps = Object.keys(states)
.filter((stateName) => states[stateName].display)
.filter((stateName) => !(IS_AUTOMATED_RUN && states[stateName].skipWhenAutomated))
.filter((stateName) => states[stateName as StateNames].display)
.filter((stateName) => !(IS_AUTOMATED_RUN && states[stateName as StateNames].skipWhenAutomated))
.map((stateName) => {
const stateInfo = states[stateName];
const stateInfo = states[stateName as StateNames];
const stateStatus = stateData[stateName];
const stateEmoji = {
ok: ':white_check_mark:',
Expand All @@ -271,7 +277,7 @@ ${wizardSteps.join('\n')}
}

function updateWizardInstruction(targetState: string, stateData: any) {
const { instructionStyle, instruction } = states[targetState];
const { instructionStyle, instruction } = states[targetState as StateNames];

if (IS_AUTOMATED_RUN) {
buildkite.setAnnotation(
Expand Down
28 changes: 15 additions & 13 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ module.exports = {
'**/*.test.js',
'x-pack/test/apm_api_integration/**/*.ts',
'x-pack/test/functional/apps/**/*.js',
'x-pack/plugins/apm/**/*.js',
'x-pack/plugins/observability_solution/apm/**/*.js',
'test/*/config.ts',
'test/*/config_open.ts',
'test/*/*.config.ts',
Expand Down Expand Up @@ -871,8 +871,8 @@ module.exports = {
*/
{
files: [
'x-pack/plugins/apm/**/*.{js,mjs,ts,tsx}',
'x-pack/plugins/observability/**/*.{js,mjs,ts,tsx}',
'x-pack/plugins/observability_solution/apm/**/*.{js,mjs,ts,tsx}',
'x-pack/plugins/observability_solution/observability/**/*.{js,mjs,ts,tsx}',
'x-pack/plugins/observability_solution/exploratory_view/**/*.{js,mjs,ts,tsx}',
'x-pack/plugins/observability_solution/ux/**/*.{js,mjs,ts,tsx}',
],
Expand All @@ -894,8 +894,8 @@ module.exports = {
},
{
files: [
'x-pack/plugins/apm/**/*.stories.*',
'x-pack/plugins/observability/**/*.stories.*',
'x-pack/plugins/observability_solution/apm/**/*.stories.*',
'x-pack/plugins/observability_solution/observability/**/*.stories.*',
'x-pack/plugins/observability_solution/exploratory_view/**/*.stories.*',
],
rules: {
Expand All @@ -911,16 +911,17 @@ module.exports = {
{
files: [
'x-pack/plugins/aiops/**/*.tsx',
'x-pack/plugins/apm/**/*.tsx',
'x-pack/plugins/observability_solution/exploratory_view/**/*.tsx',
'x-pack/plugins/infra/**/*.tsx',
'x-pack/plugins/observability/**/*.tsx',
'x-pack/plugins/observability_solution/observability_onboarding/**/*.tsx',
'x-pack/plugins/observability_solution/apm/**/*.tsx',
'x-pack/plugins/observability_solution/dataset_quality/**/*.tsx',
'x-pack/plugins/observability_solution/exploratory_view/**/*.tsx',
'x-pack/plugins/observability_solution/observability/**/*.tsx',
'x-pack/plugins/observability_solution/observability_ai_assistant/**/*.tsx',
'x-pack/plugins/observability_solution/observability_onboarding/**/*.tsx',
'x-pack/plugins/observability_solution/observability_shared/**/*.tsx',
'x-pack/plugins/observability_solution/profiling/**/*.tsx',
'x-pack/plugins/observability_solution/synthetics/**/*.tsx',
'x-pack/plugins/observability_solution/uptime/**/*.tsx',
'x-pack/plugins/observability_solution/ux/**/*.tsx',
'src/plugins/ai_assistant_management/**/*.tsx',
],
Expand All @@ -930,10 +931,11 @@ module.exports = {
},
{
files: [
'x-pack/plugins/apm/**/!(*.stories.tsx|*.test.tsx|*.storybook_decorator.tsx|*.mock.tsx)',
'x-pack/plugins/observability_solution/exploratory_view/**/!(*.stories.tsx|*.test.tsx|*.storybook_decorator.tsx|*.mock.tsx)',
'x-pack/plugins/infra/**/!(*.stories.tsx|*.test.tsx|*.storybook_decorator.tsx|*.mock.tsx)',
'x-pack/plugins/observability/**/!(*.stories.tsx|*.test.tsx|*.storybook_decorator.tsx|*.mock.tsx)',
'x-pack/plugins/observability_solution/exploratory_view/**/!(*.stories.tsx|*.test.tsx|*.storybook_decorator.tsx|*.mock.tsx)',
'x-pack/plugins/observability_solution/observability/**/!(*.stories.tsx|*.test.tsx|*.storybook_decorator.tsx|*.mock.tsx)',
'x-pack/plugins/observability_solution/apm/**/!(*.stories.tsx|*.test.tsx|*.storybook_decorator.tsx|*.mock.tsx)',
'x-pack/plugins/observability_solution/exploratory_view/**/!(*.stories.tsx|*.test.tsx|*.storybook_decorator.tsx|*.mock.tsx)',
'x-pack/plugins/observability_solution/observability_ai_assistant/**/!(*.stories.tsx|*.test.tsx|*.storybook_decorator.tsx|*.mock.tsx)',
'x-pack/plugins/observability_solution/observability_onboarding/**/!(*.stories.tsx|*.test.tsx|*.storybook_decorator.tsx|*.mock.tsx)',
'x-pack/plugins/observability_solution/observability_shared/**/!(*.stories.tsx|*.test.tsx|*.storybook_decorator.tsx|*.mock.tsx)',
Expand All @@ -949,7 +951,7 @@ module.exports = {
},
{
// require explicit return types in route handlers for performance reasons
files: ['x-pack/plugins/apm/server/**/route.ts'],
files: ['x-pack/plugins/observability_solution/apm/server/**/route.ts'],
rules: {
'@typescript-eslint/explicit-function-return-type': [
'error',
Expand Down
12 changes: 6 additions & 6 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ packages/analytics/shippers/elastic_v3/common @elastic/kibana-core
packages/analytics/shippers/elastic_v3/server @elastic/kibana-core
packages/analytics/shippers/fullstory @elastic/kibana-core
packages/kbn-apm-config-loader @elastic/kibana-core @vigneshshanmugam
x-pack/plugins/apm_data_access @elastic/obs-knowledge-team @elastic/obs-ux-infra_services-team
x-pack/plugins/apm @elastic/obs-ux-infra_services-team
x-pack/plugins/observability_solution/apm_data_access @elastic/obs-knowledge-team @elastic/obs-ux-infra_services-team
x-pack/plugins/observability_solution/apm @elastic/obs-ux-infra_services-team
packages/kbn-apm-synthtrace @elastic/obs-ux-infra_services-team @elastic/obs-ux-logs-team
packages/kbn-apm-synthtrace-client @elastic/obs-ux-infra_services-team @elastic/obs-ux-logs-team
packages/kbn-apm-utils @elastic/obs-ux-infra_services-team
Expand Down Expand Up @@ -576,7 +576,7 @@ x-pack/test/cases_api_integration/common/plugins/observability @elastic/response
x-pack/packages/observability/get_padded_alert_time_range_util @elastic/obs-ux-management-team
x-pack/plugins/observability_solution/observability_logs_explorer @elastic/obs-ux-logs-team
x-pack/plugins/observability_solution/observability_onboarding @elastic/obs-ux-logs-team
x-pack/plugins/observability @elastic/obs-ux-management-team
x-pack/plugins/observability_solution/observability @elastic/obs-ux-management-team
x-pack/plugins/observability_solution/observability_shared @elastic/observability-ui
x-pack/test/security_api_integration/plugins/oidc_provider @elastic/kibana-security
test/common/plugins/otel_metrics @elastic/obs-ux-infra_services-team
Expand Down Expand Up @@ -1076,7 +1076,7 @@ x-pack/plugins/infra/server/lib/alerting @elastic/obs-ux-management-team
/packages/kbn-utility-types/src/dot.ts @dgieselaar
/packages/kbn-utility-types/src/dot_test.ts @dgieselaar
#CC# /src/plugins/apm_oss/ @elastic/apm-ui
#CC# /x-pack/plugins/observability/ @elastic/apm-ui
#CC# /x-pack/plugins/observability_solution/observability/ @elastic/apm-ui

# Uptime
/x-pack/test/functional_with_es_ssl/apps/discover_ml_uptime/uptime/ @elastic/obs-ux-infra_services-team
Expand All @@ -1097,7 +1097,7 @@ x-pack/plugins/infra/server/lib/alerting @elastic/obs-ux-management-team
/x-pack/test/functional/apps/infra/tour.ts @elastic/platform-onboarding

# Observability settings
/x-pack/plugins/observability/server/ui_settings.ts @elastic/obs-docs
/x-pack/plugins/observability_solution/observability/server/ui_settings.ts @elastic/obs-docs

### END Observability Plugins

Expand Down Expand Up @@ -1542,7 +1542,7 @@ x-pack/plugins/security_solution/server/lib/security_integrations @elastic/secur
**/*.scss @elastic/kibana-design

# Observability design
/x-pack/plugins/apm/**/*.scss @elastic/observability-design
/x-pack/plugins/observability_solution/apm/**/*.scss @elastic/observability-design
/x-pack/plugins/infra/**/*.scss @elastic/observability-design
/x-pack/plugins/fleet/**/*.scss @elastic/observability-design
/x-pack/plugins/monitoring/**/*.scss @elastic/observability-design
Expand Down
4 changes: 2 additions & 2 deletions .github/paths-labeller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
- 'src/plugins/expressions/**/*.*'
- 'src/plugins/bfetch/**/*.*'
- 'Team:obs-ux-infra_services':
- 'x-pack/plugins/apm/**/*.*'
- 'x-pack/plugins/observability_solution/apm/**/*.*'
- 'x-pack/test/apm_api_integration/**/*.*'
- 'packages/kbn-apm-synthtrace/**/*.*'
- 'packages/kbn-apm-synthtrace-client/**/*.*'
Expand All @@ -21,4 +21,4 @@
- 'x-pack/plugins/fleet/**/*.*'
- 'x-pack/test/fleet_api_integration/**/*.*'
- 'Team:obs-ux-management':
- 'x-pack/plugins/observability/**/*.*'
- 'x-pack/plugins/observability_solution/observability/**/*.*'
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ npm-debug.log*
## @cypress/snapshot from apm plugin
/snapshots.js
/apm-diagnostics*.json
/x-pack/plugins/apm/ftr_e2e/cypress/e2e/service_map/snapshots/*.actual.png
/x-pack/plugins/apm/ftr_e2e/cypress/e2e/service_map/snapshots/*.diff.png
/x-pack/plugins/observability_solution/apm/ftr_e2e/cypress/e2e/service_map/snapshots/*.actual.png
/x-pack/plugins/observability_solution/apm/ftr_e2e/cypress/e2e/service_map/snapshots/*.diff.png

# transpiled cypress config
x-pack/plugins/fleet/cypress.config.d.ts
Expand Down Expand Up @@ -141,4 +141,3 @@ x-pack/test/security_api_integration/plugins/audit_log/audit.log
# ignore FTR temp directory
.ftr
role_users.json

Loading

0 comments on commit b4eb4ea

Please sign in to comment.