Skip to content

Commit a736362

Browse files
committed
Merge branch 'main' of github.com:elastic/kibana into feat/move-obs-plugins-logs-shared
2 parents 477f1d1 + d3ca0d2 commit a736362

5,109 files changed

Lines changed: 25140 additions & 5143 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.buildkite/ftr_configs.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ disabled:
4747
- x-pack/test/functional_enterprise_search/visual_config.ts
4848
- x-pack/test/functional_enterprise_search/cli_config.ts
4949
- x-pack/test_serverless/functional/test_suites/security/cypress/security_config.ts
50-
- x-pack/plugins/apm/ftr_e2e/ftr_config_open.ts
51-
- x-pack/plugins/apm/ftr_e2e/ftr_config_run.ts
52-
- x-pack/plugins/apm/ftr_e2e/ftr_config.ts
50+
- x-pack/plugins/observability_solution/apm/ftr_e2e/ftr_config_open.ts
51+
- x-pack/plugins/observability_solution/apm/ftr_e2e/ftr_config_run.ts
52+
- x-pack/plugins/observability_solution/apm/ftr_e2e/ftr_config.ts
5353
- x-pack/test_serverless/functional/test_suites/observability/cypress/config_headless.ts
5454
- x-pack/test_serverless/functional/test_suites/observability/cypress/config_runner.ts
5555
- x-pack/test/security_solution_cypress/serverless_config.ts

.buildkite/pipeline-utils/buildkite/client.ts

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export interface BuildkiteGroup {
2929
steps: BuildkiteStep[];
3030
}
3131

32-
export type BuildkiteStep = BuildkiteCommandStep | BuildkiteInputStep;
32+
export type BuildkiteStep = BuildkiteCommandStep | BuildkiteInputStep | BuildkiteTriggerStep;
3333

3434
export interface BuildkiteCommandStep {
3535
command: string;
@@ -94,6 +94,25 @@ export interface BuildkiteInputStep {
9494
env?: { [key: string]: string };
9595
}
9696

97+
export interface BuildkiteTriggerStep {
98+
trigger: string;
99+
label?: string;
100+
build?: {
101+
message?: string; // The message for the build. Supports emoji.
102+
commit?: string; // The commit hash for the build.
103+
branch?: string; // The branch for the build.
104+
meta_data?: string; // A map of meta-data for the build.
105+
env?: Record<string, string>; // A map of environment variables for the build.
106+
};
107+
async?: boolean;
108+
branches?: string;
109+
if?: string;
110+
allow_dependency_failure?: boolean;
111+
soft_fail?: boolean;
112+
depends_on?: string | string[];
113+
skip?: string;
114+
}
115+
97116
export interface BuildkiteTriggerBuildParams {
98117
commit: string;
99118
branch: string;

.buildkite/pipelines/pipeline.kibana-serverless-release.yaml

Lines changed: 0 additions & 12 deletions
This file was deleted.

.buildkite/pipelines/serverless_deployment/create_deployment_tag.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,9 @@ steps:
3333
- ts-node .buildkite/scripts/serverless/create_deploy_tag/release_wizard_messaging.ts --state create_deploy_tag
3434
- bash .buildkite/scripts/serverless/create_deploy_tag/create_deploy_tag.sh
3535
- ts-node .buildkite/scripts/serverless/create_deploy_tag/release_wizard_messaging.ts --state tag_created
36+
- ts-node .buildkite/scripts/serverless/create_deploy_tag/generate_gpctl_trigger.ts
37+
- ts-node .buildkite/scripts/serverless/create_deploy_tag/release_wizard_messaging.ts --state trigger_gpctl
3638
env:
3739
DRY_RUN: $DRY_RUN
40+
41+
- wait: ~

.buildkite/scripts/serverless/create_deploy_tag/create_deploy_tag.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ else
3333
echo "Skipping tag push to GitHub due to DRY_RUN=$DRY_RUN"
3434
fi
3535

36-
echo "Created deploy tag: $DEPLOY_TAG - your QA release should start @ https://buildkite.com/elastic/kibana-serverless-release/builds?branch=$DEPLOY_TAG"
36+
echo "Created deploy tag: $DEPLOY_TAG"
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License
4+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
5+
* in compliance with, at your election, the Elastic License 2.0 or the Server
6+
* Side Public License, v 1.
7+
*/
8+
9+
import { buildkite } from './shared';
10+
import { getSelectedCommitHash } from './info_sections/commit_info';
11+
import { BuildkiteTriggerStep } from '#pipeline-utils';
12+
13+
const IS_DRY_RUN = process.env.DRY_RUN?.match(/(1|true)/i);
14+
const REMOTE_SERVICE_CONFIG = `https://raw.githubusercontent.com/elastic/serverless-gitops/main/gen/gpctl/kibana/config.yaml`;
15+
16+
async function main() {
17+
const selectedSha = getSelectedCommitHash();
18+
uploadTriggerStep(selectedSha);
19+
}
20+
21+
function uploadTriggerStep(commitSha: string) {
22+
const triggerStep: BuildkiteTriggerStep = {
23+
label: ':releasethekaken: Trigger GPCTL / Release Kibana',
24+
trigger: 'gpctl-promote',
25+
async: true,
26+
build: {
27+
message: 'Triggered by Kibana serverless release pipeline',
28+
env: {
29+
SERVICE_COMMIT_HASH: commitSha.slice(0, 12),
30+
REMOTE_SERVICE_CONFIG,
31+
},
32+
},
33+
};
34+
35+
if (IS_DRY_RUN) {
36+
console.log('Dry run: skipping upload of GPCTL trigger step. Step definition:', triggerStep);
37+
} else {
38+
buildkite.uploadSteps([triggerStep]);
39+
}
40+
}
41+
42+
main()
43+
.then(() => {
44+
console.log('GPCTL Trigger step uploaded.');
45+
})
46+
.catch((error) => {
47+
console.error(error);
48+
process.exit(1);
49+
});

.buildkite/scripts/serverless/create_deploy_tag/release_wizard_messaging.ts

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ type StateNames =
3434
| 'wait_for_confirmation'
3535
| 'create_deploy_tag'
3636
| 'tag_created'
37+
| 'trigger_gpctl'
3738
| 'end'
38-
| 'error_generic'
39-
| string;
39+
| 'error_generic';
4040

4141
interface StateShape {
4242
name: string;
@@ -117,7 +117,20 @@ const states: Record<StateNames, StateShape> = {
117117
name: 'Release tag created',
118118
description: 'The initial step release is completed, follow up jobs will be triggered soon.',
119119
instruction: `<h3>Deploy tag successfully created!</h3>`,
120-
post: async () => {
120+
instructionStyle: 'success',
121+
display: true,
122+
},
123+
trigger_gpctl: {
124+
name: 'Triggering GPCTL deployment',
125+
description: 'Triggering the GPCTL deployment for the release - sit back and relax.',
126+
instruction: `GPCTL deployment triggered, follow the trigger step for more info.`,
127+
instructionStyle: 'info',
128+
display: true,
129+
},
130+
end: {
131+
name: 'End of the release process',
132+
description: 'The release process has ended.',
133+
pre: async () => {
121134
// The deployTag here is only for communication, if it's missing, it's not a big deal, but it's an error
122135
const deployTag =
123136
buildkite.getMetadata(DEPLOY_TAG_META_KEY) ||
@@ -128,8 +141,7 @@ const states: Record<StateNames, StateShape> = {
128141
buildkite.setAnnotation(
129142
WIZARD_CTX_INSTRUCTION,
130143
'success',
131-
`<h3>Deploy tag successfully created!</h3><br/>
132-
Your deployment will appear <a href='https://buildkite.com/elastic/kibana-serverless-release/builds?branch=${deployTag}'>here on buildkite.</a>`
144+
`<h3>Release successfully initiated!</h3>`
133145
);
134146

135147
if (!selectedCommit) {
@@ -153,12 +165,6 @@ Your deployment will appear <a href='https://buildkite.com/elastic/kibana-server
153165
deployTag,
154166
});
155167
},
156-
instructionStyle: 'success',
157-
display: true,
158-
},
159-
end: {
160-
name: 'End of the release process',
161-
description: 'The release process has ended.',
162168
display: false,
163169
},
164170
error_generic: {
@@ -179,15 +185,15 @@ export async function main(args: string[]) {
179185
if (!args.includes('--state')) {
180186
throw new Error('Missing --state argument');
181187
}
182-
const targetState = args.slice(args.indexOf('--state') + 1)[0];
188+
const targetState = args.slice(args.indexOf('--state') + 1)[0] as StateNames;
183189

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

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

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

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

245251
const wizardSteps = Object.keys(states)
246-
.filter((stateName) => states[stateName].display)
247-
.filter((stateName) => !(IS_AUTOMATED_RUN && states[stateName].skipWhenAutomated))
252+
.filter((stateName) => states[stateName as StateNames].display)
253+
.filter((stateName) => !(IS_AUTOMATED_RUN && states[stateName as StateNames].skipWhenAutomated))
248254
.map((stateName) => {
249-
const stateInfo = states[stateName];
255+
const stateInfo = states[stateName as StateNames];
250256
const stateStatus = stateData[stateName];
251257
const stateEmoji = {
252258
ok: ':white_check_mark:',
@@ -271,7 +277,7 @@ ${wizardSteps.join('\n')}
271277
}
272278

273279
function updateWizardInstruction(targetState: string, stateData: any) {
274-
const { instructionStyle, instruction } = states[targetState];
280+
const { instructionStyle, instruction } = states[targetState as StateNames];
275281

276282
if (IS_AUTOMATED_RUN) {
277283
buildkite.setAnnotation(

.eslintrc.js

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ module.exports = {
591591
'**/*.test.js',
592592
'x-pack/test/apm_api_integration/**/*.ts',
593593
'x-pack/test/functional/apps/**/*.js',
594-
'x-pack/plugins/apm/**/*.js',
594+
'x-pack/plugins/observability_solution/apm/**/*.js',
595595
'test/*/config.ts',
596596
'test/*/config_open.ts',
597597
'test/*/*.config.ts',
@@ -871,8 +871,8 @@ module.exports = {
871871
*/
872872
{
873873
files: [
874-
'x-pack/plugins/apm/**/*.{js,mjs,ts,tsx}',
875-
'x-pack/plugins/observability/**/*.{js,mjs,ts,tsx}',
874+
'x-pack/plugins/observability_solution/apm/**/*.{js,mjs,ts,tsx}',
875+
'x-pack/plugins/observability_solution/observability/**/*.{js,mjs,ts,tsx}',
876876
'x-pack/plugins/observability_solution/exploratory_view/**/*.{js,mjs,ts,tsx}',
877877
'x-pack/plugins/observability_solution/ux/**/*.{js,mjs,ts,tsx}',
878878
],
@@ -894,8 +894,8 @@ module.exports = {
894894
},
895895
{
896896
files: [
897-
'x-pack/plugins/apm/**/*.stories.*',
898-
'x-pack/plugins/observability/**/*.stories.*',
897+
'x-pack/plugins/observability_solution/apm/**/*.stories.*',
898+
'x-pack/plugins/observability_solution/observability/**/*.stories.*',
899899
'x-pack/plugins/observability_solution/exploratory_view/**/*.stories.*',
900900
],
901901
rules: {
@@ -911,16 +911,18 @@ module.exports = {
911911
{
912912
files: [
913913
'x-pack/plugins/aiops/**/*.tsx',
914-
'x-pack/plugins/apm/**/*.tsx',
915-
'x-pack/plugins/observability_solution/exploratory_view/**/*.tsx',
916914
'x-pack/plugins/infra/**/*.tsx',
917-
'x-pack/plugins/observability/**/*.tsx',
918-
'x-pack/plugins/observability_solution/observability_onboarding/**/*.tsx',
915+
'x-pack/plugins/observability_solution/apm/**/*.tsx',
916+
'x-pack/plugins/observability_solution/dataset_quality/**/*.tsx',
917+
'x-pack/plugins/observability_solution/exploratory_view/**/*.tsx',
918+
'x-pack/plugins/observability_solution/infra/**/*.tsx',
919+
'x-pack/plugins/observability_solution/observability/**/*.tsx',
919920
'x-pack/plugins/observability_solution/observability_ai_assistant/**/*.tsx',
920921
'x-pack/plugins/observability_solution/observability_onboarding/**/*.tsx',
921922
'x-pack/plugins/observability_solution/observability_shared/**/*.tsx',
922923
'x-pack/plugins/observability_solution/profiling/**/*.tsx',
923924
'x-pack/plugins/observability_solution/synthetics/**/*.tsx',
925+
'x-pack/plugins/observability_solution/uptime/**/*.tsx',
924926
'x-pack/plugins/observability_solution/ux/**/*.tsx',
925927
'src/plugins/ai_assistant_management/**/*.tsx',
926928
],
@@ -930,10 +932,10 @@ module.exports = {
930932
},
931933
{
932934
files: [
933-
'x-pack/plugins/apm/**/!(*.stories.tsx|*.test.tsx|*.storybook_decorator.tsx|*.mock.tsx)',
935+
'x-pack/plugins/observability_solution/apm/**/!(*.stories.tsx|*.test.tsx|*.storybook_decorator.tsx|*.mock.tsx)',
934936
'x-pack/plugins/observability_solution/exploratory_view/**/!(*.stories.tsx|*.test.tsx|*.storybook_decorator.tsx|*.mock.tsx)',
935-
'x-pack/plugins/infra/**/!(*.stories.tsx|*.test.tsx|*.storybook_decorator.tsx|*.mock.tsx)',
936-
'x-pack/plugins/observability/**/!(*.stories.tsx|*.test.tsx|*.storybook_decorator.tsx|*.mock.tsx)',
937+
'x-pack/plugins/observability_solution/infra/**/!(*.stories.tsx|*.test.tsx|*.storybook_decorator.tsx|*.mock.tsx)',
938+
'x-pack/plugins/observability_solution/observability/**/!(*.stories.tsx|*.test.tsx|*.storybook_decorator.tsx|*.mock.tsx)',
937939
'x-pack/plugins/observability_solution/observability_ai_assistant/**/!(*.stories.tsx|*.test.tsx|*.storybook_decorator.tsx|*.mock.tsx)',
938940
'x-pack/plugins/observability_solution/observability_onboarding/**/!(*.stories.tsx|*.test.tsx|*.storybook_decorator.tsx|*.mock.tsx)',
939941
'x-pack/plugins/observability_solution/observability_shared/**/!(*.stories.tsx|*.test.tsx|*.storybook_decorator.tsx|*.mock.tsx)',
@@ -949,7 +951,7 @@ module.exports = {
949951
},
950952
{
951953
// require explicit return types in route handlers for performance reasons
952-
files: ['x-pack/plugins/apm/server/**/route.ts'],
954+
files: ['x-pack/plugins/observability_solution/apm/server/**/route.ts'],
953955
rules: {
954956
'@typescript-eslint/explicit-function-return-type': [
955957
'error',

0 commit comments

Comments
 (0)