Skip to content
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

[Response Ops][Alerting] Backfill actions schema changes for intermediate release #203184

Merged
merged 4 commits into from
Dec 11, 2024

Conversation

ymao1
Copy link
Contributor

@ymao1 ymao1 commented Dec 5, 2024

Summary

This PR contains just the schema changes required to support backfill actions. This is meant for an intermediate release and then the full PR: #200784 will follow after that.

@ymao1 ymao1 force-pushed the backfill-actions-schema-updates branch from 5b214dc to c59ae5f Compare December 6, 2024 13:35
@ymao1 ymao1 changed the title Schema changes for intermediate release [Response Ops][Alerting] Backfill actions schema changes for intermediate release Dec 6, 2024
@ymao1 ymao1 self-assigned this Dec 6, 2024
@ymao1 ymao1 added Feature:Alerting release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v9.0.0 backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) v8.18.0 labels Dec 6, 2024
@ymao1 ymao1 marked this pull request as ready for review December 6, 2024 15:09
@ymao1 ymao1 requested review from a team as code owners December 6, 2024 15:09
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)

@ymao1
Copy link
Contributor Author

ymao1 commented Dec 9, 2024

@elasticmachine merge upstream

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

cc @ymao1

@@ -15,6 +15,7 @@ export const scheduleBodySchema = schema.arrayOf(
rule_id: schema.string(),
start: schema.string(),
end: schema.maybe(schema.string()),
run_actions: schema.maybe(schema.boolean({ defaultValue: true })),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be optional? Already has a default value.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are existing UI places that call this API so I think it has to be optional. I can remove the defaultValue if that makes more sense.

Copy link
Contributor

@ersin-erdal ersin-erdal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ymao1 ymao1 merged commit b9bac16 into elastic:main Dec 11, 2024
8 checks passed
@ymao1 ymao1 deleted the backfill-actions-schema-updates branch December 11, 2024 18:47
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/12282900705

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Dec 11, 2024
…iate release (elastic#203184)

## Summary

This PR contains just the schema changes required to support backfill
actions. This is meant for an intermediate release and then the full PR:
elastic#200784 will follow after that.

---------

Co-authored-by: Elastic Machine <[email protected]>
(cherry picked from commit b9bac16)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Dec 12, 2024
…iate release (elastic#203184)

## Summary

This PR contains just the schema changes required to support backfill
actions. This is meant for an intermediate release and then the full PR:
elastic#200784 will follow after that.

---------

Co-authored-by: Elastic Machine <[email protected]>
kibanamachine added a commit that referenced this pull request Dec 12, 2024
…termediate release (#203184) (#203885)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Response Ops][Alerting] Backfill actions schema changes for
intermediate release
(#203184)](#203184)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Ying
Mao","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-12-11T18:47:01Z","message":"[Response
Ops][Alerting] Backfill actions schema changes for intermediate release
(#203184)\n\n## Summary\r\n\r\nThis PR contains just the schema changes
required to support backfill\r\nactions. This is meant for an
intermediate release and then the full
PR:\r\nhttps://github.com//pull/200784 will follow after
that.\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine
<[email protected]>","sha":"b9bac1628bc489efec2da0f8f6fecf66962a6a51","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Alerting","release_note:skip","Team:ResponseOps","v9.0.0","backport:prev-minor","v8.18.0"],"title":"[Response
Ops][Alerting] Backfill actions schema changes for intermediate
release","number":203184,"url":"https://github.com/elastic/kibana/pull/203184","mergeCommit":{"message":"[Response
Ops][Alerting] Backfill actions schema changes for intermediate release
(#203184)\n\n## Summary\r\n\r\nThis PR contains just the schema changes
required to support backfill\r\nactions. This is meant for an
intermediate release and then the full
PR:\r\nhttps://github.com//pull/200784 will follow after
that.\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine
<[email protected]>","sha":"b9bac1628bc489efec2da0f8f6fecf66962a6a51"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/203184","number":203184,"mergeCommit":{"message":"[Response
Ops][Alerting] Backfill actions schema changes for intermediate release
(#203184)\n\n## Summary\r\n\r\nThis PR contains just the schema changes
required to support backfill\r\nactions. This is meant for an
intermediate release and then the full
PR:\r\nhttps://github.com//pull/200784 will follow after
that.\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine
<[email protected]>","sha":"b9bac1628bc489efec2da0f8f6fecf66962a6a51"}},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Ying Mao <[email protected]>
Co-authored-by: Elastic Machine <[email protected]>
ymao1 added a commit to ymao1/kibana that referenced this pull request Dec 13, 2024
ymao1 added a commit that referenced this pull request Dec 13, 2024
…intermediate release (#203184)" (#204218)

This reverts commit b9bac16.

## Summary

Reverting to investigate `Failed to poll for work: Invalid interval
"PT1M". Intervals must be of the form {number}m. Example: 5m.` logs
which may be caused by the updated task schema
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Dec 13, 2024
…intermediate release (elastic#203184)" (elastic#204218)

This reverts commit b9bac16.

## Summary

Reverting to investigate `Failed to poll for work: Invalid interval
"PT1M". Intervals must be of the form {number}m. Example: 5m.` logs
which may be caused by the updated task schema

(cherry picked from commit 42693ca)
kibanamachine added a commit that referenced this pull request Dec 13, 2024
…hanges for intermediate release (#203184)&quot; (#204218) (#204266)

# Backport

This will backport the following commits from `main` to `8.x`:
- [Revert &quot;[Response Ops][Alerting] Backfill actions schema changes
for intermediate release (#203184)&quot;
(#204218)](#204218)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Ying
Mao","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-12-13T17:30:12Z","message":"Revert
\"[Response Ops][Alerting] Backfill actions schema changes for
intermediate release (#203184)\" (#204218)\n\nThis reverts commit
b9bac16.\r\n\r\n##
Summary\r\n\r\nReverting to investigate `Failed to poll for work:
Invalid interval\r\n\"PT1M\". Intervals must be of the form {number}m.
Example: 5m.` logs\r\nwhich may be caused by the updated task
schema","sha":"42693caf5f274b9cc3c30d3305961430b31d8ae3","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Alerting","release_note:skip","Team:ResponseOps","v9.0.0","backport:prev-minor","v8.18.0"],"title":"Revert
\"[Response Ops][Alerting] Backfill actions schema changes for
intermediate release
(#203184)\"","number":204218,"url":"https://github.com/elastic/kibana/pull/204218","mergeCommit":{"message":"Revert
\"[Response Ops][Alerting] Backfill actions schema changes for
intermediate release (#203184)\" (#204218)\n\nThis reverts commit
b9bac16.\r\n\r\n##
Summary\r\n\r\nReverting to investigate `Failed to poll for work:
Invalid interval\r\n\"PT1M\". Intervals must be of the form {number}m.
Example: 5m.` logs\r\nwhich may be caused by the updated task
schema","sha":"42693caf5f274b9cc3c30d3305961430b31d8ae3"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/204218","number":204218,"mergeCommit":{"message":"Revert
\"[Response Ops][Alerting] Backfill actions schema changes for
intermediate release (#203184)\" (#204218)\n\nThis reverts commit
b9bac16.\r\n\r\n##
Summary\r\n\r\nReverting to investigate `Failed to poll for work:
Invalid interval\r\n\"PT1M\". Intervals must be of the form {number}m.
Example: 5m.` logs\r\nwhich may be caused by the updated task
schema","sha":"42693caf5f274b9cc3c30d3305961430b31d8ae3"}},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Ying Mao <[email protected]>
ymao1 added a commit to ymao1/kibana that referenced this pull request Dec 17, 2024
ymao1 added a commit that referenced this pull request Jan 7, 2025
… intermediate release (#204657)

## Summary

Redoing [this PR](#203184) which
had to be [reverted](#204218).
This should not be merged until [this update to the task manager v1
schema](#204413) is released.

## To verify
1. Set `xpack.task_manager.unsafe.exclude_task_types:
['ad_hoc_run-backfill', 'actions:*']` in your Kibana config.
2. Run Kibana on main and create some detection rules that run
frequently, with actions.
3. Schedule a manual run for your detection rules.
- Because of the config, the `action_task_params` SO and the
`ad_hoc_run_task_params` SO will get written but not read yet.
4. Remove the `exclude_task_types` config and "upgrade" to this PR
branch and verify that rules continue to run and that the actions are
triggered and the manual rule runs go through
5. Re-add the `exclude_task_types` config and let the rule run again to
schedule action. Schedule another manual rule run.
6. Remove the `exclude_task_types` config and "downgrade" back to main
and verify that rules continue to run, the action gets triggered and
manual rule runs go through.

Co-authored-by: Elastic Machine <[email protected]>
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jan 7, 2025
… intermediate release (elastic#204657)

## Summary

Redoing [this PR](elastic#203184) which
had to be [reverted](elastic#204218).
This should not be merged until [this update to the task manager v1
schema](elastic#204413) is released.

## To verify
1. Set `xpack.task_manager.unsafe.exclude_task_types:
['ad_hoc_run-backfill', 'actions:*']` in your Kibana config.
2. Run Kibana on main and create some detection rules that run
frequently, with actions.
3. Schedule a manual run for your detection rules.
- Because of the config, the `action_task_params` SO and the
`ad_hoc_run_task_params` SO will get written but not read yet.
4. Remove the `exclude_task_types` config and "upgrade" to this PR
branch and verify that rules continue to run and that the actions are
triggered and the manual rule runs go through
5. Re-add the `exclude_task_types` config and let the rule run again to
schedule action. Schedule another manual rule run.
6. Remove the `exclude_task_types` config and "downgrade" back to main
and verify that rules continue to run, the action gets triggered and
manual rule runs go through.

Co-authored-by: Elastic Machine <[email protected]>
(cherry picked from commit 11e3a0b)
kowalczyk-krzysztof pushed a commit to kowalczyk-krzysztof/kibana that referenced this pull request Jan 7, 2025
… intermediate release (elastic#204657)

## Summary

Redoing [this PR](elastic#203184) which
had to be [reverted](elastic#204218).
This should not be merged until [this update to the task manager v1
schema](elastic#204413) is released.

## To verify
1. Set `xpack.task_manager.unsafe.exclude_task_types:
['ad_hoc_run-backfill', 'actions:*']` in your Kibana config.
2. Run Kibana on main and create some detection rules that run
frequently, with actions.
3. Schedule a manual run for your detection rules.
- Because of the config, the `action_task_params` SO and the
`ad_hoc_run_task_params` SO will get written but not read yet.
4. Remove the `exclude_task_types` config and "upgrade" to this PR
branch and verify that rules continue to run and that the actions are
triggered and the manual rule runs go through
5. Re-add the `exclude_task_types` config and let the rule run again to
schedule action. Schedule another manual rule run.
6. Remove the `exclude_task_types` config and "downgrade" back to main
and verify that rules continue to run, the action gets triggered and
manual rule runs go through.

Co-authored-by: Elastic Machine <[email protected]>
kibanamachine added a commit that referenced this pull request Jan 7, 2025
…changes for intermediate release (#204657) (#205821)

# Backport

This will backport the following commits from `main` to `8.x`:
- [Reapply &quot;[Response Ops][Alerting] Backfill actions schema
changes for intermediate release
(#204657)](#204657)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Ying
Mao","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-01-07T21:37:01Z","message":"Reapply
\"[Response Ops][Alerting] Backfill actions schema changes for
intermediate release (#204657)\n\n## Summary\r\n\r\nRedoing [this
PR](#203184) which\r\nhad to be
[reverted](https://github.com/elastic/kibana/pull/204218).\r\nThis
should not be merged until [this update to the task manager
v1\r\nschema](#204413) is
released.\r\n\r\n## To verify\r\n1. Set
`xpack.task_manager.unsafe.exclude_task_types:\r\n['ad_hoc_run-backfill',
'actions:*']` in your Kibana config.\r\n2. Run Kibana on main and create
some detection rules that run\r\nfrequently, with actions.\r\n3.
Schedule a manual run for your detection rules.\r\n- Because of the
config, the `action_task_params` SO and the\r\n`ad_hoc_run_task_params`
SO will get written but not read yet.\r\n4. Remove the
`exclude_task_types` config and \"upgrade\" to this PR\r\nbranch and
verify that rules continue to run and that the actions are\r\ntriggered
and the manual rule runs go through\r\n5. Re-add the
`exclude_task_types` config and let the rule run again to\r\nschedule
action. Schedule another manual rule run.\r\n6. Remove the
`exclude_task_types` config and \"downgrade\" back to main\r\nand verify
that rules continue to run, the action gets triggered and\r\nmanual rule
runs go through.\r\n\r\nCo-authored-by: Elastic Machine
<[email protected]>","sha":"11e3a0b77ef2e15bcd0eacf0572f27eeed60ea69","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Alerting","release_note:skip","Feature:Task
Manager","Team:ResponseOps","v9.0.0","backport:prev-minor","v8.18.0"],"title":"Reapply
\"[Response Ops][Alerting] Backfill actions schema changes for
intermediate
release","number":204657,"url":"https://github.com/elastic/kibana/pull/204657","mergeCommit":{"message":"Reapply
\"[Response Ops][Alerting] Backfill actions schema changes for
intermediate release (#204657)\n\n## Summary\r\n\r\nRedoing [this
PR](#203184) which\r\nhad to be
[reverted](https://github.com/elastic/kibana/pull/204218).\r\nThis
should not be merged until [this update to the task manager
v1\r\nschema](#204413) is
released.\r\n\r\n## To verify\r\n1. Set
`xpack.task_manager.unsafe.exclude_task_types:\r\n['ad_hoc_run-backfill',
'actions:*']` in your Kibana config.\r\n2. Run Kibana on main and create
some detection rules that run\r\nfrequently, with actions.\r\n3.
Schedule a manual run for your detection rules.\r\n- Because of the
config, the `action_task_params` SO and the\r\n`ad_hoc_run_task_params`
SO will get written but not read yet.\r\n4. Remove the
`exclude_task_types` config and \"upgrade\" to this PR\r\nbranch and
verify that rules continue to run and that the actions are\r\ntriggered
and the manual rule runs go through\r\n5. Re-add the
`exclude_task_types` config and let the rule run again to\r\nschedule
action. Schedule another manual rule run.\r\n6. Remove the
`exclude_task_types` config and \"downgrade\" back to main\r\nand verify
that rules continue to run, the action gets triggered and\r\nmanual rule
runs go through.\r\n\r\nCo-authored-by: Elastic Machine
<[email protected]>","sha":"11e3a0b77ef2e15bcd0eacf0572f27eeed60ea69"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/204657","number":204657,"mergeCommit":{"message":"Reapply
\"[Response Ops][Alerting] Backfill actions schema changes for
intermediate release (#204657)\n\n## Summary\r\n\r\nRedoing [this
PR](#203184) which\r\nhad to be
[reverted](https://github.com/elastic/kibana/pull/204218).\r\nThis
should not be merged until [this update to the task manager
v1\r\nschema](#204413) is
released.\r\n\r\n## To verify\r\n1. Set
`xpack.task_manager.unsafe.exclude_task_types:\r\n['ad_hoc_run-backfill',
'actions:*']` in your Kibana config.\r\n2. Run Kibana on main and create
some detection rules that run\r\nfrequently, with actions.\r\n3.
Schedule a manual run for your detection rules.\r\n- Because of the
config, the `action_task_params` SO and the\r\n`ad_hoc_run_task_params`
SO will get written but not read yet.\r\n4. Remove the
`exclude_task_types` config and \"upgrade\" to this PR\r\nbranch and
verify that rules continue to run and that the actions are\r\ntriggered
and the manual rule runs go through\r\n5. Re-add the
`exclude_task_types` config and let the rule run again to\r\nschedule
action. Schedule another manual rule run.\r\n6. Remove the
`exclude_task_types` config and \"downgrade\" back to main\r\nand verify
that rules continue to run, the action gets triggered and\r\nmanual rule
runs go through.\r\n\r\nCo-authored-by: Elastic Machine
<[email protected]>","sha":"11e3a0b77ef2e15bcd0eacf0572f27eeed60ea69"}},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Ying Mao <[email protected]>
crespocarlos pushed a commit to crespocarlos/kibana that referenced this pull request Jan 8, 2025
… intermediate release (elastic#204657)

## Summary

Redoing [this PR](elastic#203184) which
had to be [reverted](elastic#204218).
This should not be merged until [this update to the task manager v1
schema](elastic#204413) is released.

## To verify
1. Set `xpack.task_manager.unsafe.exclude_task_types:
['ad_hoc_run-backfill', 'actions:*']` in your Kibana config.
2. Run Kibana on main and create some detection rules that run
frequently, with actions.
3. Schedule a manual run for your detection rules.
- Because of the config, the `action_task_params` SO and the
`ad_hoc_run_task_params` SO will get written but not read yet.
4. Remove the `exclude_task_types` config and "upgrade" to this PR
branch and verify that rules continue to run and that the actions are
triggered and the manual rule runs go through
5. Re-add the `exclude_task_types` config and let the rule run again to
schedule action. Schedule another manual rule run.
6. Remove the `exclude_task_types` config and "downgrade" back to main
and verify that rules continue to run, the action gets triggered and
manual rule runs go through.

Co-authored-by: Elastic Machine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) Feature:Alerting release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v8.18.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants