Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
b477847
Implement fallback to test mode in saved objects CLI checks
hammad-nasir-elastic Jan 30, 2026
d720721
Changes from node scripts/eslint_all_files --no-cache --fix
kibanamachine Jan 30, 2026
714f48c
Merge branch 'main' into so-cli-update-run-test-data
hammad-nasir-elastic Jan 30, 2026
6d4fe75
Merge branch 'main' into so-cli-update-run-test-data
hammad-nasir-elastic Feb 2, 2026
b5783dd
Always run Saved Objects checks as a smoke test for migration logic i…
hammad-nasir-elastic Feb 2, 2026
20bd2d2
Merge branch 'main' into so-cli-update-run-test-data
hammad-nasir-elastic Feb 2, 2026
99ce18e
Changes from yarn openapi:bundle
kibanamachine Feb 2, 2026
d3f3c7b
Merge branch 'main' into so-cli-update-run-test-data
hammad-nasir-elastic Feb 2, 2026
e15d1d8
Merge branch 'main' into so-cli-update-run-test-data
hammad-nasir-elastic Feb 3, 2026
7211978
Merge branch 'main' into so-cli-update-run-test-data
hammad-nasir-elastic Feb 4, 2026
49c9fa4
Merge branch 'main' into so-cli-update-run-test-data
hammad-nasir-elastic Feb 4, 2026
ec85d2e
Refactor saved objects CLI validation tasks
hammad-nasir-elastic Feb 6, 2026
447636d
Merge branch 'main' into so-cli-update-run-test-data
hammad-nasir-elastic Feb 6, 2026
2b61ca3
Changes from node scripts/eslint_all_files --no-cache --fix
kibanamachine Feb 6, 2026
e02217b
Merge branch 'main' into so-cli-update-run-test-data
hammad-nasir-elastic Feb 9, 2026
6ec39d3
slight updates
hammad-nasir-elastic Feb 9, 2026
441441a
Merge branch 'main' into so-cli-update-run-test-data
hammad-nasir-elastic Feb 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions .buildkite/scripts/pipelines/pull_request/pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -516,16 +516,9 @@ const SKIPPABLE_PR_MATCHERS = prConfig.skip_ci_on_only_changed!.map((r) => new R
pipeline.push(getPipeline('.buildkite/pipelines/pull_request/prompt_changes.yml'));
}

// Run Saved Objects checks conditionally
if (
await doAnyChangesMatch([
/^packages\/kbn-check-saved-objects-cli\/current_fields.json/,
/^packages\/kbn-check-saved-objects-cli\/current_mappings.json/,
/^src\/core\/server\/integration_tests\/ci_checks\/saved_objects\/check_registered_types.test.ts/,
])
) {
pipeline.push(getPipeline('.buildkite/pipelines/pull_request/check_saved_objects.yml'));
}
// Always run Saved Objects checks.
// If there aren't any SO types modified, the check will run with test data as a smoke test for migration logic
pipeline.push(getPipeline('.buildkite/pipelines/pull_request/check_saved_objects.yml'));

if (
(await doAnyChangesMatch([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,7 @@ import { Listr, PRESET_TIMER } from 'listr2';
import { run } from '@kbn/dev-cli-runner';
import { setupKibana, startElasticsearch, stopElasticsearch, stopKibana } from '../util';
import type { TaskContext } from './types';
import {
automatedRollbackTests,
checkRemovedTypes,
getSnapshots,
validateNewTypes,
validateUpdatedTypes,
} from './tasks';
import { getTestSnapshots, TEST_TYPES } from './test';
import { automatedRollbackTests, getSnapshots, validateSOChanges, validateTestFlow } from './tasks';

export function runCheckSavedObjectsCli() {
let globalTask: Listr<TaskContext, 'default', 'simple'>;
Expand Down Expand Up @@ -90,41 +83,38 @@ export function runCheckSavedObjectsCli() {
},
/**
* ==================================================================
* The following tasks only run in "--test mode".
* Validate SO changes.
*
* Instead of starting Kibana and getting the actual typeRegistry
* we use a test registry with a bunch of fake SO types.
* Checks for removed types, new types, and updated types.
* ==================================================================
*/
{
title: 'Obtain type registry (test mode)',
task: async (ctx) => (ctx.registeredTypes = TEST_TYPES),
enabled: !server && test,
title: 'Validate SO changes',
task: validateSOChanges,
enabled: !server && !test,
skip: test,
},
{
title: 'Get type registry snapshots (test mode)',
task: getTestSnapshots,
enabled: !server && test,
title: 'Fallback to test mode (no updated types detected)',
task: (ctx) => {
ctx.test = true;
},
enabled: !server && !test,
skip: (ctx) => ctx.updatedTypes.length > 0,
},
/**
* ==================================================================
* The following tasks run systematically
* Validate test flow (runs in test mode or after fallback).
*
* Sets up a test type registry and test snapshots, then runs
* the same validation pipeline with test data.
* ==================================================================
*/
{
title: 'Check removed SO types',
task: checkRemovedTypes,
enabled: !server,
},
{
title: 'Validate new SO types',
task: validateNewTypes,
enabled: !server,
},
{
title: 'Validate existing SO types',
task: validateUpdatedTypes,
title: 'Validate test flow',
task: validateTestFlow,
enabled: !server,
skip: (ctx) => !ctx.test,
},
{
title: 'Automated rollback tests',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
*/

export { getSnapshots } from './get_snapshots';
export { validateNewTypes } from './validate_new_types';
export { validateUpdatedTypes } from './validate_updated_types';
export { automatedRollbackTests } from './automated_rollback_tests';
export { checkRemovedTypes } from './check_removed_types';
export { validateSOChanges } from './validate_so_changes';
export { validateTestFlow } from './validate_test_flow';
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* 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".
*/

import type { ListrTask } from 'listr2';
import type { Task, TaskContext } from '../types';
import { checkRemovedTypes } from './check_removed_types';
import { validateNewTypes } from './validate_new_types';
import { validateUpdatedTypes } from './validate_updated_types';

export const validateSOChanges: Task = (ctx, task) => {
const subtasks: ListrTask<TaskContext>[] = [
{
title: 'Check removed SO types',
task: checkRemovedTypes,
},
{
title: 'Validate new SO types',
task: validateNewTypes,
},
{
title: 'Validate existing SO types',
task: validateUpdatedTypes,
},
];

return task.newListr<TaskContext>(subtasks);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* 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".
*/

import type { ListrTask } from 'listr2';
import type { Task, TaskContext } from '../types';
import { TEST_TYPES, getTestSnapshots } from '../test';
import { validateSOChanges } from './validate_so_changes';

export const validateTestFlow: Task = (ctx, task) => {
const subtasks: ListrTask<TaskContext>[] = [
{
title: 'Obtain type registry (test mode)',
task: async () => {
ctx.registeredTypes = TEST_TYPES;
},
},
{
title: 'Get type registry snapshots (test mode)',
task: getTestSnapshots,
},
{
title: 'Validate SO changes',
task: validateSOChanges,
},
];

return task.newListr<TaskContext>(subtasks);
};
Loading