-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Gap auto fill task #239573
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
nkhristinin
wants to merge
89
commits into
elastic:main
Choose a base branch
from
nkhristinin:gap-auto-fill-task
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+7,263
−153
Open
Gap auto fill task #239573
Changes from 78 commits
Commits
Show all changes
89 commits
Select commit
Hold shift + click to select a range
31c0e58
Add initator field to backfill
nkhristinin b154793
[CI] Auto-commit changed files from 'node scripts/check_mappings_upda…
kibanamachine 26daa71
[CI] Auto-commit changed files from 'node scripts/eslint_all_files --…
kibanamachine 4c14e11
Fixes types
nkhristinin 8e2c648
Merge branch 'backfill-iniator' of github.com:nkhristinin/kibana into…
nkhristinin 65ed6f5
[CI] Auto-commit changed files from 'node scripts/jest_integration -u…
kibanamachine 213c9fb
update types
nkhristinin 977f06e
Merge branch 'backfill-iniator' of github.com:nkhristinin/kibana into…
nkhristinin c3e43e7
Fix more types
nkhristinin 4e19aa2
fix more types
nkhristinin 981580e
Merge branch 'main' into backfill-iniator
elasticmachine fb677d6
Fix tests
nkhristinin a2853d8
Merge branch 'backfill-iniator' of github.com:nkhristinin/kibana into…
nkhristinin a74fce3
Add task, api, event log mappings
nkhristinin b65b5aa
[CI] Auto-commit changed files from 'node scripts/eslint_all_files --…
kibanamachine 25c7ba1
Fix how task get space from request
nkhristinin bd19d50
Merge branch 'gap-auto-fill-task' of github.com:nkhristinin/kibana in…
nkhristinin 14839b1
Return default value for space
nkhristinin de66f16
use backfill initator constant
nkhristinin 163655b
Some fixes
nkhristinin d84bd51
fix some unit tests
nkhristinin e6e0d53
Merge branch 'main' into gap-auto-fill-task
nkhristinin 5f2be71
[CI] Auto-commit changed files from 'node scripts/check_mappings_upda…
kibanamachine 62332f2
fixes
nkhristinin 0f9f792
Merge branch 'main' into gap-auto-fill-task
nkhristinin 4fc5880
Merge branch 'gap-auto-fill-task' of github.com:nkhristinin/kibana in…
nkhristinin 6e1efdf
[CI] Auto-commit changed files from 'node scripts/eslint_all_files --…
kibanamachine 63a4f54
Fix tests and types
nkhristinin 7f641e4
Change tests and fix how we check overlapps
nkhristinin bd4c92d
Merge branch 'gap-auto-fill-task' of github.com:nkhristinin/kibana in…
nkhristinin dc56f7b
Simplify tets
nkhristinin ea5a982
Fix sorting gaps
nkhristinin 9a49039
Fix types
nkhristinin 27d8fa2
Some PR fixes
nkhristinin fc45533
Merge branch 'main' into gap-auto-fill-task
elasticmachine f64d923
Fix some tests
nkhristinin 072ce05
fix amount of SO
nkhristinin 050b4ca
Add some tests, fix types, and default values
nkhristinin 688257c
fix more tets
nkhristinin cc0892c
some fixes
nkhristinin b22663d
Changes from node scripts/jest_integration -u src/core/server/integra…
kibanamachine 646c24c
update tests
nkhristinin 478e0c7
Merge branch 'gap-auto-fill-task' of github.com:nkhristinin/kibana in…
nkhristinin 4020cf8
fix tests
nkhristinin 292c0fa
Merge branch 'main' into gap-auto-fill-task
elasticmachine 6da188b
Merge branch 'main' into gap-auto-fill-task
elasticmachine 529a9b3
Add read/write
nkhristinin 186c110
Remove params for feature flag
nkhristinin 78fba04
Update schema
nkhristinin 8332730
Extract date from the loop
nkhristinin cdc2561
Use lodash for chunk
nkhristinin d82a383
Remove wasCanceled, use abortController
nkhristinin e18a29a
Default timeout
nkhristinin c94c1b8
Update tests
nkhristinin 5ac0c42
Fix more tests
nkhristinin 2ae242b
Merge branch 'main' into gap-auto-fill-task
elasticmachine b614f28
Add cleanup of stuck gaps
nkhristinin cb1bb77
Changes from node scripts/eslint_all_files --no-cache --fix
kibanamachine 119a32d
Merge branch 'main' into gap-auto-fill-task
nkhristinin 51afe46
Throw error if duplicate for rule type consumer
nkhristinin 12de6ea
Changes from node scripts/eslint_all_files --no-cache --fix
kibanamachine 51ed5b3
fix types
nkhristinin 2b7afdd
Merge branch 'gap-auto-fill-task' of github.com:nkhristinin/kibana in…
nkhristinin 418ac39
update fields
nkhristinin 25134a1
Changes from node scripts/check_mappings_update --fix
kibanamachine 110d04d
Changes from node scripts/jest_integration -u src/core/server/integra…
kibanamachine 5998915
Update API path
nkhristinin 5e2c09c
Rename amount_of_retries
nkhristinin 7ff212e
Validate gap_fill_range
nkhristinin 8157587
Ensure we are not leaking request
nkhristinin 2bd5d0d
Remoe schedule task id
nkhristinin da6ab37
Merge branch 'gap-auto-fill-task' of github.com:nkhristinin/kibana in…
nkhristinin fd116c2
Changes from node scripts/jest_integration -u src/core/server/integra…
kibanamachine efaab1e
Add rule types as param to get rules with gaps method
nkhristinin ebf94e1
Merge branch 'main' into gap-auto-fill-task
elasticmachine 7c4d001
Merge branch 'main' into gap-auto-fill-task
elasticmachine 91f0f50
Changes from node scripts/check_saved_objects
kibanamachine c592629
Merge branch 'main' into gap-auto-fill-task
elasticmachine 63c7a09
pr fixes
nkhristinin cb33530
Changes from node scripts/jest_integration -u src/core/server/integra…
kibanamachine a2732bc
fix types
nkhristinin e817da2
Merge branch 'gap-auto-fill-task' of github.com:nkhristinin/kibana in…
nkhristinin 0b1d7ac
Merge branch 'main' into gap-auto-fill-task
elasticmachine c64c8b3
Add min size for rule types array
nkhristinin 005d146
update tests
nkhristinin cc26f35
Changes from node scripts/jest_integration -u src/core/server/integra…
kibanamachine de754bf
fix test
nkhristinin 99ef613
Merge branch 'gap-auto-fill-task' of github.com:nkhristinin/kibana in…
nkhristinin 61763d3
Merge branch 'main' into gap-auto-fill-task
elasticmachine File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
...ate/security/authorization_core/src/privileges/feature_privilege_builder/alerting.test.ts
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...platform/plugins/shared/alerting/common/routes/gaps/apis/gap_auto_fill_scheduler/index.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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'; |
8 changes: 8 additions & 0 deletions
8
...plugins/shared/alerting/common/routes/gaps/apis/gap_auto_fill_scheduler/schemas/latest.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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'; |
53 changes: 53 additions & 0 deletions
53
...orm/plugins/shared/alerting/common/routes/gaps/apis/gap_auto_fill_scheduler/schemas/v1.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| /* | ||
| * 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'; | ||
|
|
||
| export const gapAutoFillSchedulerBodySchema = schema.object( | ||
| { | ||
| id: schema.maybe(schema.string()), | ||
| name: schema.string({ defaultValue: '' }), | ||
| enabled: schema.boolean({ defaultValue: true }), | ||
| max_backfills: schema.number({ defaultValue: 1000, min: 1, max: 5000 }), | ||
| num_retries: schema.number({ defaultValue: 3, min: 1 }), | ||
| gap_fill_range: schema.string({ defaultValue: 'now-90d' }), | ||
| schedule: schema.object({ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. does it make sense to have a minimal accepted interval? I was able to schedule it with 1s interval |
||
| 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(), | ||
| }); | ||
8 changes: 8 additions & 0 deletions
8
...m/plugins/shared/alerting/common/routes/gaps/apis/gap_auto_fill_scheduler/types/latest.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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'; |
20 changes: 20 additions & 0 deletions
20
...tform/plugins/shared/alerting/common/routes/gaps/apis/gap_auto_fill_scheduler/types/v1.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.