Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
31c0e58
Add initator field to backfill
nkhristinin Oct 6, 2025
b154793
[CI] Auto-commit changed files from 'node scripts/check_mappings_upda…
kibanamachine Oct 6, 2025
26daa71
[CI] Auto-commit changed files from 'node scripts/eslint_all_files --…
kibanamachine Oct 6, 2025
4c14e11
Fixes types
nkhristinin Oct 6, 2025
8e2c648
Merge branch 'backfill-iniator' of github.com:nkhristinin/kibana into…
nkhristinin Oct 6, 2025
65ed6f5
[CI] Auto-commit changed files from 'node scripts/jest_integration -u…
kibanamachine Oct 6, 2025
213c9fb
update types
nkhristinin Oct 6, 2025
977f06e
Merge branch 'backfill-iniator' of github.com:nkhristinin/kibana into…
nkhristinin Oct 6, 2025
c3e43e7
Fix more types
nkhristinin Oct 7, 2025
4e19aa2
fix more types
nkhristinin Oct 7, 2025
981580e
Merge branch 'main' into backfill-iniator
elasticmachine Oct 7, 2025
fb677d6
Fix tests
nkhristinin Oct 8, 2025
a2853d8
Merge branch 'backfill-iniator' of github.com:nkhristinin/kibana into…
nkhristinin Oct 8, 2025
a74fce3
Add task, api, event log mappings
nkhristinin Oct 17, 2025
b65b5aa
[CI] Auto-commit changed files from 'node scripts/eslint_all_files --…
kibanamachine Oct 17, 2025
25c7ba1
Fix how task get space from request
nkhristinin Oct 22, 2025
bd19d50
Merge branch 'gap-auto-fill-task' of github.com:nkhristinin/kibana in…
nkhristinin Oct 22, 2025
14839b1
Return default value for space
nkhristinin Oct 22, 2025
de66f16
use backfill initator constant
nkhristinin Oct 23, 2025
163655b
Some fixes
nkhristinin Oct 23, 2025
d84bd51
fix some unit tests
nkhristinin Oct 23, 2025
e6e0d53
Merge branch 'main' into gap-auto-fill-task
nkhristinin Oct 27, 2025
5f2be71
[CI] Auto-commit changed files from 'node scripts/check_mappings_upda…
kibanamachine Oct 27, 2025
62332f2
fixes
nkhristinin Oct 27, 2025
0f9f792
Merge branch 'main' into gap-auto-fill-task
nkhristinin Oct 27, 2025
4fc5880
Merge branch 'gap-auto-fill-task' of github.com:nkhristinin/kibana in…
nkhristinin Oct 27, 2025
6e1efdf
[CI] Auto-commit changed files from 'node scripts/eslint_all_files --…
kibanamachine Oct 27, 2025
63a4f54
Fix tests and types
nkhristinin Oct 27, 2025
7f641e4
Change tests and fix how we check overlapps
nkhristinin Oct 28, 2025
bd4c92d
Merge branch 'gap-auto-fill-task' of github.com:nkhristinin/kibana in…
nkhristinin Oct 28, 2025
dc56f7b
Simplify tets
nkhristinin Oct 28, 2025
ea5a982
Fix sorting gaps
nkhristinin Oct 28, 2025
9a49039
Fix types
nkhristinin Oct 29, 2025
27d8fa2
Some PR fixes
nkhristinin Oct 29, 2025
fc45533
Merge branch 'main' into gap-auto-fill-task
elasticmachine Oct 29, 2025
f64d923
Fix some tests
nkhristinin Oct 29, 2025
072ce05
fix amount of SO
nkhristinin Oct 29, 2025
050b4ca
Add some tests, fix types, and default values
nkhristinin Oct 29, 2025
688257c
fix more tets
nkhristinin Oct 29, 2025
cc0892c
some fixes
nkhristinin Oct 30, 2025
b22663d
Changes from node scripts/jest_integration -u src/core/server/integra…
kibanamachine Oct 30, 2025
646c24c
update tests
nkhristinin Oct 30, 2025
478e0c7
Merge branch 'gap-auto-fill-task' of github.com:nkhristinin/kibana in…
nkhristinin Oct 30, 2025
4020cf8
fix tests
nkhristinin Oct 31, 2025
292c0fa
Merge branch 'main' into gap-auto-fill-task
elasticmachine Oct 31, 2025
6da188b
Merge branch 'main' into gap-auto-fill-task
elasticmachine Nov 3, 2025
529a9b3
Add read/write
nkhristinin Nov 4, 2025
186c110
Remove params for feature flag
nkhristinin Nov 4, 2025
78fba04
Update schema
nkhristinin Nov 4, 2025
8332730
Extract date from the loop
nkhristinin Nov 4, 2025
cdc2561
Use lodash for chunk
nkhristinin Nov 4, 2025
d82a383
Remove wasCanceled, use abortController
nkhristinin Nov 4, 2025
e18a29a
Default timeout
nkhristinin Nov 4, 2025
c94c1b8
Update tests
nkhristinin Nov 5, 2025
5ac0c42
Fix more tests
nkhristinin Nov 5, 2025
2ae242b
Merge branch 'main' into gap-auto-fill-task
elasticmachine Nov 5, 2025
b614f28
Add cleanup of stuck gaps
nkhristinin Nov 6, 2025
cb1bb77
Changes from node scripts/eslint_all_files --no-cache --fix
kibanamachine Nov 6, 2025
119a32d
Merge branch 'main' into gap-auto-fill-task
nkhristinin Nov 10, 2025
51afe46
Throw error if duplicate for rule type consumer
nkhristinin Nov 10, 2025
12de6ea
Changes from node scripts/eslint_all_files --no-cache --fix
kibanamachine Nov 10, 2025
51ed5b3
fix types
nkhristinin Nov 10, 2025
2b7afdd
Merge branch 'gap-auto-fill-task' of github.com:nkhristinin/kibana in…
nkhristinin Nov 10, 2025
418ac39
update fields
nkhristinin Nov 10, 2025
25134a1
Changes from node scripts/check_mappings_update --fix
kibanamachine Nov 10, 2025
110d04d
Changes from node scripts/jest_integration -u src/core/server/integra…
kibanamachine Nov 10, 2025
5998915
Update API path
nkhristinin Nov 11, 2025
5e2c09c
Rename amount_of_retries
nkhristinin Nov 11, 2025
7ff212e
Validate gap_fill_range
nkhristinin Nov 11, 2025
8157587
Ensure we are not leaking request
nkhristinin Nov 11, 2025
2bd5d0d
Remoe schedule task id
nkhristinin Nov 11, 2025
da6ab37
Merge branch 'gap-auto-fill-task' of github.com:nkhristinin/kibana in…
nkhristinin Nov 11, 2025
fd116c2
Changes from node scripts/jest_integration -u src/core/server/integra…
kibanamachine Nov 11, 2025
efaab1e
Add rule types as param to get rules with gaps method
nkhristinin Nov 12, 2025
ebf94e1
Merge branch 'main' into gap-auto-fill-task
elasticmachine Nov 12, 2025
7c4d001
Merge branch 'main' into gap-auto-fill-task
elasticmachine Nov 14, 2025
91f0f50
Changes from node scripts/check_saved_objects
kibanamachine Nov 14, 2025
c592629
Merge branch 'main' into gap-auto-fill-task
elasticmachine Nov 17, 2025
63c7a09
pr fixes
nkhristinin Nov 19, 2025
cb33530
Changes from node scripts/jest_integration -u src/core/server/integra…
kibanamachine Nov 19, 2025
a2732bc
fix types
nkhristinin Nov 19, 2025
e817da2
Merge branch 'gap-auto-fill-task' of github.com:nkhristinin/kibana in…
nkhristinin Nov 19, 2025
0b1d7ac
Merge branch 'main' into gap-auto-fill-task
elasticmachine Nov 19, 2025
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
7 changes: 7 additions & 0 deletions packages/kbn-check-saved-objects-cli/current_fields.json
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,13 @@
"policy_id",
"token_plain"
],
"gap_auto_fill_scheduler": [
"createdAt",
"enabled",
"name",
"ruleTypeConsumerPairs",
"updatedAt"
],
"graph-workspace": [
"description",
"kibanaSavedObjectMeta",
Expand Down
20 changes: 20 additions & 0 deletions packages/kbn-check-saved-objects-cli/current_mappings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2083,6 +2083,26 @@
}
}
},
"gap_auto_fill_scheduler": {
"dynamic": false,
"properties": {
"createdAt": {
"type": "date"
},
"enabled": {
"type": "boolean"
},
"name": {
"type": "keyword"
},
"ruleTypeConsumerPairs": {
"type": "keyword"
},
"updatedAt": {
"type": "date"
}
}
},
"graph-workspace": {
"properties": {
"description": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ export { registerCoreObjectTypes } from './registration';

// set minimum number of registered saved objects to ensure no object types are removed after 8.8
// declared in internal implementation explicitly to prevent unintended changes.
export const SAVED_OBJECT_TYPES_COUNT = 137 as const;
export const SAVED_OBJECT_TYPES_COUNT = 138 as const;
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ describe('checking migration metadata changes on all registered SO types', () =>
"fleet-setup-lock": "df3c142ba8907c8ccf004d2240c79d476a70946db092ab4c485d3eb1a3f5bb82",
"fleet-space-settings": "011427e18769b1a0e715656de3316f084ae56e8eea07ade9214e1b3a045864ea",
"fleet-uninstall-tokens": "939272ff96c28fcfb1b8da7967c8992f5deec7707f53c3a6b2555e5c34a27ec2",
"gap_auto_fill_scheduler": "c1da8d81689a1a2f3131de5e589b444699852f6d0d189bf2d5fc3ff0389a7935",
"graph-workspace": "8adf653e4f4077bd4bad75edb3fc07e7978cb7b2aaa8d105a409bcd2f27fccec",
"index-pattern": "97de563e0aea6135a10dcec02e48fba69404e86c404db78855476d947b71f70e",
"infra-custom-dashboards": "48cf1c96d6932ecbdf73576bb3e742a16f02a01bf064074dee5edfcf6066556e",
Expand Down Expand Up @@ -711,6 +712,11 @@ describe('checking migration metadata changes on all registered SO types', () =>
"fleet-uninstall-tokens|schemas: da39a3ee5e6b4b0d3255bfef95601890afd80709",
"fleet-uninstall-tokens|10.1.0: 9fc1798f3911d926611dd8b502b48b20c652bdc2fb7f0ca18ee584af0e6750d3",
"===============================================================================================",
"gap_auto_fill_scheduler|global: 71ebab8e87dcd17601e47579a55e971dcc3edfca",
"gap_auto_fill_scheduler|mappings: dd593bef2dd8cad3e1588259021b02fad70705f3",
"gap_auto_fill_scheduler|schemas: da39a3ee5e6b4b0d3255bfef95601890afd80709",
"gap_auto_fill_scheduler|10.1.0: fb58338a5bb7a300ea11ef91c47204b44ba431f681b83398ae6348fed18ec7c6",
"================================================================================================",
"graph-workspace|global: 9075e5123e3beea7a32a2c152795934ee0239f11",
"graph-workspace|mappings: e17cff9e8b39b979f3067f55bbcf7c998d602648",
"graph-workspace|schemas: da39a3ee5e6b4b0d3255bfef95601890afd80709",
Expand Down Expand Up @@ -1312,6 +1318,7 @@ describe('checking migration metadata changes on all registered SO types', () =>
"fleet-setup-lock": "10.0.0",
"fleet-space-settings": "10.0.0",
"fleet-uninstall-tokens": "10.1.0",
"gap_auto_fill_scheduler": "10.1.0",
"graph-workspace": "10.0.0",
"index-pattern": "10.0.0",
"infra-custom-dashboards": "10.2.0",
Expand Down Expand Up @@ -1459,6 +1466,7 @@ describe('checking migration metadata changes on all registered SO types', () =>
"fleet-setup-lock": "0.0.0",
"fleet-space-settings": "0.0.0",
"fleet-uninstall-tokens": "10.1.0",
"gap_auto_fill_scheduler": "10.1.0",
"graph-workspace": "7.11.0",
"index-pattern": "7.11.0",
"infra-custom-dashboards": "10.2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ const previouslyRegisteredTypes = [
'usage-counters', // deprecated in favor of 'usage-counter'
'visualization',
'workplace_search_telemetry',
'gap_auto_fill_scheduler',
].sort();

describe('SO type registrations', () => {
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ const readOperations: Record<AlertingEntity, string[]> = {
'findBackfill',
'findGaps',
'bulkEditParams',
'getGapAutoFillScheduler',
'getGapAutoFillSchedulerLogs',
],
alert: ['get', 'find', 'getAuthorizedAlertsIndices', 'getAlertSummary'],
};
Expand Down Expand Up @@ -60,6 +62,9 @@ const writeOperations: Record<AlertingEntity, string[]> = {
'bulkDelete',
'unsnooze',
'runSoon',
'createGapAutoFillScheduler',
'updateGapAutoFillScheduler',
'deleteGapAutoFillScheduler',
],
alert: ['update'],
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,8 @@ describe('features', () => {
'findBackfill',
'findGaps',
'bulkEditParams',
'getGapAutoFillScheduler',
'getGapAutoFillSchedulerLogs',
],
...[
'create',
Expand All @@ -591,6 +593,9 @@ describe('features', () => {
'bulkDelete',
'unsnooze',
'runSoon',
'createGapAutoFillScheduler',
'updateGapAutoFillScheduler',
'deleteGapAutoFillScheduler',
],
...['enable', 'disable', 'bulkEnable', 'bulkDisable'],
...['deleteBackfill', 'fillGaps', 'scheduleBackfill'],
Expand Down Expand Up @@ -749,6 +754,8 @@ describe('features', () => {
'findBackfill',
'findGaps',
'bulkEditParams',
'getGapAutoFillScheduler',
'getGapAutoFillSchedulerLogs',
],
...[
'create',
Expand All @@ -764,6 +771,9 @@ describe('features', () => {
'bulkDelete',
'unsnooze',
'runSoon',
'createGapAutoFillScheduler',
'updateGapAutoFillScheduler',
'deleteGapAutoFillScheduler',
],
...['enable', 'disable', 'bulkEnable', 'bulkDisable'],
...['deleteBackfill', 'fillGaps', 'scheduleBackfill'],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* 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; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

export const gapAutoFillSchedulerLimits = {
maxBackfills: {
min: 1,
max: 5000,
defaultValue: 1000,
},
numRetries: {
min: 1,
max: 10,
defaultValue: 3,
},
} as const;
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ export type { GapStatus } from './gap_status';
export { alertDeleteCategoryIds } from './alert_delete';
export type { BackfillInitiator } from './backfill';
export { backfillInitiator } from './backfill';
export { gapAutoFillSchedulerLimits } from './gap_auto_fill_scheduler';
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* 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; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

export {
gapAutoFillSchedulerBodySchema,
gapAutoFillSchedulerResponseSchema,
} from './schemas/latest';
export type {
GapAutoFillSchedulerRequestBody,
GapAutoFillSchedulerResponseBody,
GapAutoFillSchedulerResponse,
UpdateGapAutoFillSchedulerResponse,
} from './types/latest';

export {
gapAutoFillSchedulerBodySchema as gapAutoFillSchedulerBodySchemaV1,
gapAutoFillSchedulerResponseSchema as gapAutoFillSchedulerResponseSchemaV1,
} from './schemas/v1';
export type {
GapAutoFillSchedulerRequestBody as GapAutoFillSchedulerRequestBodyV1,
GapAutoFillSchedulerResponseBody as GapAutoFillSchedulerResponseBodyV1,
GapAutoFillSchedulerResponse as GapAutoFillSchedulerResponseV1,
UpdateGapAutoFillSchedulerResponse as UpdateGapAutoFillSchedulerResponseV1,
} from './types/v1';
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
* 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; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

export * from './v1';
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
* 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; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import { schema } from '@kbn/config-schema';
import dateMath from '@kbn/datemath';
import { gapAutoFillSchedulerLimits } from '../../../../../constants';

const { maxBackfills, numRetries } = gapAutoFillSchedulerLimits;

export const gapAutoFillSchedulerBodySchema = schema.object(
{
id: schema.maybe(schema.string()),
name: schema.string({ defaultValue: '' }),
enabled: schema.boolean({ defaultValue: true }),
max_backfills: schema.number(maxBackfills),
num_retries: schema.number(numRetries),
gap_fill_range: schema.string({ defaultValue: 'now-90d' }),
schedule: schema.object({
interval: schema.string(),
}),
scope: schema.maybe(schema.arrayOf(schema.string())),
rule_types: schema.arrayOf(
schema.object({
type: schema.string(),
consumer: schema.string(),
})
),
},
{
validate({ gap_fill_range: gapFillRange }) {
const parsed = dateMath.parse(gapFillRange);
if (!parsed || !parsed.isValid()) {
return 'gap_fill_range is invalid';
}
},
}
);

export const gapAutoFillSchedulerResponseSchema = schema.object({
id: schema.string(),
name: schema.string(),
enabled: schema.boolean(),
schedule: schema.object({
interval: schema.string(),
}),
gap_fill_range: schema.string(),
max_backfills: schema.number(),
num_retries: schema.number(),
created_by: schema.maybe(schema.string()),
updated_by: schema.maybe(schema.string()),
created_at: schema.string(),
updated_at: schema.string(),
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
* 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; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

export type * from './v1';
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* 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; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import type { TypeOf } from '@kbn/config-schema';
import type { gapAutoFillSchedulerBodySchemaV1, gapAutoFillSchedulerResponseSchemaV1 } from '..';

export type GapAutoFillSchedulerRequestBody = TypeOf<typeof gapAutoFillSchedulerBodySchemaV1>;
export type GapAutoFillSchedulerResponseBody = TypeOf<typeof gapAutoFillSchedulerResponseSchemaV1>;

export interface GapAutoFillSchedulerResponse {
body: GapAutoFillSchedulerResponseBody;
}

export interface UpdateGapAutoFillSchedulerResponse {
body: GapAutoFillSchedulerResponseBody;
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const getRuleIdsWithGapBodySchema = schema.object(
has_unfilled_intervals: schema.maybe(schema.boolean()),
has_in_progress_intervals: schema.maybe(schema.boolean()),
has_filled_intervals: schema.maybe(schema.boolean()),
sort_order: schema.maybe(schema.oneOf([schema.literal('asc'), schema.literal('desc')])),
},
{
validate({ start, end }) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export const gapsResponseSchema = schema.object({
filled_duration_ms: schema.number(),
unfilled_duration_ms: schema.number(),
in_progress_duration_ms: schema.number(),
updated_at: schema.maybe(schema.string()),
});

export const errorResponseSchema = schema.object({
Expand Down
Loading